Criar tag
POST
/api/seller/external/v1/tag
curl --request POST \ "https://api.spelt.com.br/api/seller/external/v1/tag" \ --header "Authorization: Bearer splt_live_SUA_CHAVE" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"name\": \"architecto\", \"color\": \"architecto\", \"description\": \"Eius et animi quos velit et.\"}"const url = new URL( "https://api.spelt.com.br/api/seller/external/v1/tag");
const headers = { "Authorization": "Bearer splt_live_SUA_CHAVE", "Content-Type": "application/json", "Accept": "application/json",};
let body = { "name": "architecto", "color": "architecto", "description": "Eius et animi quos velit et."};
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/tag';$response = $client->post( $url, [ 'headers' => [ 'Authorization' => 'Bearer splt_live_SUA_CHAVE', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'name' => 'architecto', 'color' => 'architecto', 'description' => 'Eius et animi quos velit et.', ], ]);$body = $response->getBody();print_r(json_decode((string) $body));import requestsimport json
url = 'https://api.spelt.com.br/api/seller/external/v1/tag'payload = { "name": "architecto", "color": "architecto", "description": "Eius et animi quos velit et."}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 uma tag na conta. O nome não se repete: se já existir, a resposta é 400.
Authorizations
Seção intitulada “Authorizations”Request Bodyrequired
Seção intitulada “Request Bodyrequired”Media typeapplication/json
object
name
required
Nome da tag. Exemplo: VIP
string
color
Cor em hexadecimal. Exemplo: #FF5733
string
description
Para que a tag serve.
string
Responses
Seção intitulada “Responses”Media typeapplication/json
object
data
object
id
string
name
string
slug
string
color
string
description
string | null
Example
{ "data": { "id": "01JA0000000000000000000060", "name": "VIP", "slug": "vip", "color": "#FF5733", "description": null }}Media typeapplication/json
object
message
string
Example
{ "message": "Já existe uma tag com este nome."}Media typeapplication/json
object
message
string
errors
object
name
Array<string>
Example
{ "message": "Erro de validação.", "errors": { "name": [ "O campo name é obrigatório." ] }}