Incluir endereço
POST
/api/seller/external/v1/person/{id}/address
curl --request POST \ "https://api.spelt.com.br/api/seller/external/v1/person/iMRSFHQ9TYBYCWTPTRGW5G9ZPYF/address" \ --header "Authorization: Bearer splt_live_SUA_CHAVE" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"type\": \"architecto\", \"street\": \"architecto\", \"number\": \"architecto\", \"city\": \"architecto\", \"state\": \"architecto\", \"postal_code\": \"architecto\", \"is_primary\": false}"const url = new URL( "https://api.spelt.com.br/api/seller/external/v1/person/iMRSFHQ9TYBYCWTPTRGW5G9ZPYF/address");
const headers = { "Authorization": "Bearer splt_live_SUA_CHAVE", "Content-Type": "application/json", "Accept": "application/json",};
let body = { "type": "architecto", "street": "architecto", "number": "architecto", "city": "architecto", "state": "architecto", "postal_code": "architecto", "is_primary": false};
fetch(url, { method: "POST", headers, body: JSON.stringify(body),}).then(response => response.json());$client = new \GuzzleHttp\Client();$url = 'https://api.spelt.com.br/api/seller/external/v1/person/iMRSFHQ9TYBYCWTPTRGW5G9ZPYF/address';$response = $client->post( $url, [ 'headers' => [ 'Authorization' => 'Bearer splt_live_SUA_CHAVE', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'type' => 'architecto', 'street' => 'architecto', 'number' => 'architecto', 'city' => 'architecto', 'state' => 'architecto', 'postal_code' => 'architecto', 'is_primary' => false, ], ]);$body = $response->getBody();print_r(json_decode((string) $body));import requestsimport json
url = 'https://api.spelt.com.br/api/seller/external/v1/person/iMRSFHQ9TYBYCWTPTRGW5G9ZPYF/address'payload = { "type": "architecto", "street": "architecto", "number": "architecto", "city": "architecto", "state": "architecto", "postal_code": "architecto", "is_primary": false}headers = { 'Authorization': 'Bearer splt_live_SUA_CHAVE', 'Content-Type': 'application/json', 'Accept': 'application/json'}
response = requests.request('POST', url, headers=headers, json=payload)response.json()Cria um endereço para a pessoa. O primeiro nasce principal.
Authorizations
Seção intitulada “Authorizations”Parameters
Seção intitulada “Parameters”Path Parameters
Seção intitulada “Path Parameters”id
required
string
The ID of the person.
Request Bodyrequired
Seção intitulada “Request Bodyrequired”Media typeapplication/json
object
type
required
AddressType (primary, billing, shipping…). Exemplo: billing
string
street
required
Rua. Exemplo: Rua Augusta
string
number
Número. Exemplo: 100
string
city
required
Cidade. Exemplo: São Paulo
string
state
required
UF. Exemplo: SP
string
postal_code
required
CEP. Exemplo: 01305-000
string
is_primary
Endereço principal.
boolean
Responses
Seção intitulada “Responses”Media typeapplication/json
object
data
object
id
string
type
string
street
string
is_primary
boolean
Example
{ "data": { "id": "01JA…", "type": "billing", "street": "Rua Augusta", "is_primary": true }}Media typeapplication/json
object
message
string
Example
{ "message": "Seu papel de acesso não permite esta operação."}Media typeapplication/json
object
error
string
Example
{ "error": "Recurso não encontrado"}Media typeapplication/json
object
message
string
errors
object
street
Array<string>
Example
{ "message": "Erro de validação.", "errors": { "street": [ "O campo street é obrigatório." ] }}