curl --request POST \
--url https://api.bevits.com/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": {
"plano": "vip"
},
"consent": {
"email": true,
"whatsapp": true
}
}
'import requests
url = "https://api.bevits.com/v1/customers"
payload = {
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": { "plano": "vip" },
"consent": {
"email": True,
"whatsapp": True
}
}
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_id: 'u_8842',
email: 'ana@exemplo.com.br',
phone: '+5511988887777',
name: 'Ana Souza',
attributes: {plano: 'vip'},
consent: {email: true, whatsapp: true}
})
};
fetch('https://api.bevits.com/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bevits.com/v1/customers",
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_id' => 'u_8842',
'email' => 'ana@exemplo.com.br',
'phone' => '+5511988887777',
'name' => 'Ana Souza',
'attributes' => [
'plano' => 'vip'
],
'consent' => [
'email' => true,
'whatsapp' => true
]
]),
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 := "https://api.bevits.com/v1/customers"
payload := strings.NewReader("{\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"vip\"\n },\n \"consent\": {\n \"email\": true,\n \"whatsapp\": true\n }\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("https://api.bevits.com/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"vip\"\n },\n \"consent\": {\n \"email\": true,\n \"whatsapp\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"vip\"\n },\n \"consent\": {\n \"email\": true,\n \"whatsapp\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "customer",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"html_url": "<string>",
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"attributes": {},
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "<string>",
"is_subscribed": true,
"is_subscribed_to_email": true,
"total_spent_in_cents": 123,
"total_orders": 123,
"first_purchase_date": "2023-11-07T05:31:56Z",
"last_purchase_date": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"identification": "<string>",
"default_address": {
"id": "<string>",
"street": "<string>",
"number": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
}
}{
"object": "customer",
"id": "cus_ckabc123",
"name": "Ana Souza",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"source": "API",
"is_subscribed": true,
"is_subscribed_to_email": true,
"created_at": "2026-11-24T14:03:00.000Z",
"updated_at": "2026-11-24T14:03:00.000Z",
"html_url": "https://app.bevits.com/customers/ckabc123",
"external_id": "u_8842",
"tags": [],
"attributes": {
"plano": "vip"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key does not have the required \"write\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_phone",
"message": "phone is not a valid number. Send it in E.164 (+5511988887777), or without a country code for a number in the store's country.",
"param": "phone",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "service_unavailable",
"code": "temporarily_unavailable",
"message": "The request could not be confirmed right now. Retry it with the same Idempotency-Key: it is applied at most once.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}Criar cliente
Cadastra um cliente na base da loja com pelo menos um identificador: external_id, tax_id, email ou phone. Se um deles já pertence a um cliente ativo (procurados nessa ordem, como nos eventos), esse cliente é devolvido como está, com 200, e nada nele muda. Um cliente novo é criado com 201 e dispara o webhook customer.created, com o mesmo objeto da resposta. Sem consent, o cliente novo não tem opt-in de marketing. Nenhum flow é iniciado e nenhuma mensagem é enviada. Envie Idempotency-Key para repetir a requisição com segurança. Exige uma API key com o escopo write.
curl --request POST \
--url https://api.bevits.com/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": {
"plano": "vip"
},
"consent": {
"email": true,
"whatsapp": true
}
}
'import requests
url = "https://api.bevits.com/v1/customers"
payload = {
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": { "plano": "vip" },
"consent": {
"email": True,
"whatsapp": True
}
}
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_id: 'u_8842',
email: 'ana@exemplo.com.br',
phone: '+5511988887777',
name: 'Ana Souza',
attributes: {plano: 'vip'},
consent: {email: true, whatsapp: true}
})
};
fetch('https://api.bevits.com/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bevits.com/v1/customers",
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_id' => 'u_8842',
'email' => 'ana@exemplo.com.br',
'phone' => '+5511988887777',
'name' => 'Ana Souza',
'attributes' => [
'plano' => 'vip'
],
'consent' => [
'email' => true,
'whatsapp' => true
]
]),
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 := "https://api.bevits.com/v1/customers"
payload := strings.NewReader("{\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"vip\"\n },\n \"consent\": {\n \"email\": true,\n \"whatsapp\": true\n }\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("https://api.bevits.com/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"vip\"\n },\n \"consent\": {\n \"email\": true,\n \"whatsapp\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"vip\"\n },\n \"consent\": {\n \"email\": true,\n \"whatsapp\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "customer",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"html_url": "<string>",
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"attributes": {},
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "<string>",
"is_subscribed": true,
"is_subscribed_to_email": true,
"total_spent_in_cents": 123,
"total_orders": 123,
"first_purchase_date": "2023-11-07T05:31:56Z",
"last_purchase_date": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"identification": "<string>",
"default_address": {
"id": "<string>",
"street": "<string>",
"number": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
}
}{
"object": "customer",
"id": "cus_ckabc123",
"name": "Ana Souza",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"source": "API",
"is_subscribed": true,
"is_subscribed_to_email": true,
"created_at": "2026-11-24T14:03:00.000Z",
"updated_at": "2026-11-24T14:03:00.000Z",
"html_url": "https://app.bevits.com/customers/ckabc123",
"external_id": "u_8842",
"tags": [],
"attributes": {
"plano": "vip"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"code": "missing_scope",
"message": "This API key does not have the required \"write\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_phone",
"message": "phone is not a valid number. Send it in E.164 (+5511988887777), or without a country code for a number in the store's country.",
"param": "phone",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>",
"suggestion": "<string>"
}
}{
"error": {
"type": "service_unavailable",
"code": "temporarily_unavailable",
"message": "The request could not be confirmed right now. Retry it with the same Idempotency-Key: it is applied at most once.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}Cabeçalhos
Corpo
Pelo menos um de external_id, tax_id, email ou phone. São os mesmos campos do customer de um evento.
Resposta
Um cliente ativo já tinha um dos identificadores enviados. Ele é devolvido como está, nada nele muda e nenhum webhook é enviado.