Converter lead em cliente
POST
/api/seller/external/v1/lead/{id}/convert
curl --request POST \ "https://api.spelt.com.br/api/seller/external/v1/lead/architecto/convert" \ --header "Authorization: Bearer splt_live_SUA_CHAVE" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"customer_id\": \"architecto\"}"const url = new URL( "https://api.spelt.com.br/api/seller/external/v1/lead/architecto/convert");
const headers = { "Authorization": "Bearer splt_live_SUA_CHAVE", "Content-Type": "application/json", "Accept": "application/json",};
let body = { "customer_id": "architecto"};
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/lead/architecto/convert';$response = $client->post( $url, [ 'headers' => [ 'Authorization' => 'Bearer splt_live_SUA_CHAVE', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'customer_id' => 'architecto', ], ]);$body = $response->getBody();print_r(json_decode((string) $body));import requestsimport json
url = 'https://api.spelt.com.br/api/seller/external/v1/lead/architecto/convert'payload = { "customer_id": "architecto"}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()Liga o lead a um cliente já cadastrado (POST /customer), marca como converted e passa as tarefas do lead para
o cliente.
Authorizations
Seção intitulada “Authorizations”Parameters
Seção intitulada “Parameters”Path Parameters
Seção intitulada “Path Parameters”id
required
string
ULID do lead.
Request Bodyrequired
Seção intitulada “Request Bodyrequired”Media typeapplication/json
object
customer_id
required
ULID do cliente.
string
Responses
Seção intitulada “Responses”Media typeapplication/json
object
data
object
object
string
id
string
status
string
customer_id
string
Example
{ "data": { "object": "lead", "id": "01JA0000000000000000000020", "status": "converted", "customer_id": "01JA0000000000000000000040" }}Media typeapplication/json
object
error
string
Example
{ "error": "Recurso não encontrado"}Media typeapplication/json
object
message
string
errors
object
customer_id
Array<string>
Example
{ "message": "Erro de validação.", "errors": { "customer_id": [ "O campo customer id selecionado é inválido." ] }}