curl --request POST \
--url http://localhost:8090/internal/v1/custom-connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_store_id": "<string>",
"display_name": "<string>",
"country": "<string>",
"currency": "<string>",
"language": "<string>"
}
'import requests
url = "http://localhost:8090/internal/v1/custom-connections"
payload = {
"external_store_id": "<string>",
"display_name": "<string>",
"country": "<string>",
"currency": "<string>",
"language": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_store_id: '<string>',
display_name: '<string>',
country: '<string>',
currency: '<string>',
language: '<string>'
})
};
fetch('http://localhost:8090/internal/v1/custom-connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/custom-connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_store_id' => '<string>',
'display_name' => '<string>',
'country' => '<string>',
'currency' => '<string>',
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8090/internal/v1/custom-connections"
payload := strings.NewReader("{\n \"external_store_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8090/internal/v1/custom-connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_store_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/custom-connections")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_store_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "<string>",
"token": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}Dar de alta una conexión de conector custom
La pide el principal connector de operador, no el custom: el token de un conector custom nace acá, así que no puede ser lo que autorice este alta.
curl --request POST \
--url http://localhost:8090/internal/v1/custom-connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_store_id": "<string>",
"display_name": "<string>",
"country": "<string>",
"currency": "<string>",
"language": "<string>"
}
'import requests
url = "http://localhost:8090/internal/v1/custom-connections"
payload = {
"external_store_id": "<string>",
"display_name": "<string>",
"country": "<string>",
"currency": "<string>",
"language": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_store_id: '<string>',
display_name: '<string>',
country: '<string>',
currency: '<string>',
language: '<string>'
})
};
fetch('http://localhost:8090/internal/v1/custom-connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/custom-connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_store_id' => '<string>',
'display_name' => '<string>',
'country' => '<string>',
'currency' => '<string>',
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8090/internal/v1/custom-connections"
payload := strings.NewReader("{\n \"external_store_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8090/internal/v1/custom-connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_store_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/custom-connections")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_store_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "<string>",
"token": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}Autorizaciones
El conector de plataforma y el operador. Registra conexiones, entrega webhooks, corre la saga de instalación y da de alta conexiones custom. Es el único principal obligatorio del proceso: los otros tres se apagan dejando su token vacío, y una puerta que no se monta no la abre ningún token.
Cuerpo
La pide el principal connector de operador, no el custom: el token de un conector custom nace de este alta y sólo sirve para su propia conexión.
Lo elige el conector; único por provider. Repetir el alta con el mismo valor es 409 connection_exists, no un alta silenciosa que emitiría un segundo token para la misma tienda.
11^[A-Z]{2}$^[A-Z]{3}$^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$Respuesta
La conexión y su token. El token se muestra una sola vez; del lado del servidor queda su hash.