Validar evento sin guardarlo
curl --request POST \
--url https://api.bevits.com/v1/events/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_shipped",
"customer": {
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": {
"plano": "premium"
}
},
"properties": {
"order_number": "10293",
"tracking": {
"code": "BR123",
"carrier": "Correios"
},
"items": [
{
"sku": "CAM-01",
"name": "Camiseta",
"quantity": 2
}
]
},
"occurred_at": "2026-11-18T14:03:00-03:00",
"external_id": "ship_10293"
}
'import requests
url = "https://api.bevits.com/v1/events/validate"
payload = {
"name": "order_shipped",
"customer": {
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": { "plano": "premium" }
},
"properties": {
"order_number": "10293",
"tracking": {
"code": "BR123",
"carrier": "Correios"
},
"items": [
{
"sku": "CAM-01",
"name": "Camiseta",
"quantity": 2
}
]
},
"occurred_at": "2026-11-18T14:03:00-03:00",
"external_id": "ship_10293"
}
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({
name: 'order_shipped',
customer: {
external_id: 'u_8842',
email: 'ana@exemplo.com.br',
phone: '+5511988887777',
name: 'Ana Souza',
attributes: {plano: 'premium'}
},
properties: {
order_number: '10293',
tracking: {code: 'BR123', carrier: 'Correios'},
items: [{sku: 'CAM-01', name: 'Camiseta', quantity: 2}]
},
occurred_at: '2026-11-18T14:03:00-03:00',
external_id: 'ship_10293'
})
};
fetch('https://api.bevits.com/v1/events/validate', 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/events/validate",
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([
'name' => 'order_shipped',
'customer' => [
'external_id' => 'u_8842',
'email' => 'ana@exemplo.com.br',
'phone' => '+5511988887777',
'name' => 'Ana Souza',
'attributes' => [
'plano' => 'premium'
]
],
'properties' => [
'order_number' => '10293',
'tracking' => [
'code' => 'BR123',
'carrier' => 'Correios'
],
'items' => [
[
'sku' => 'CAM-01',
'name' => 'Camiseta',
'quantity' => 2
]
]
],
'occurred_at' => '2026-11-18T14:03:00-03:00',
'external_id' => 'ship_10293'
]),
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/events/validate"
payload := strings.NewReader("{\n \"name\": \"order_shipped\",\n \"customer\": {\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"premium\"\n }\n },\n \"properties\": {\n \"order_number\": \"10293\",\n \"tracking\": {\n \"code\": \"BR123\",\n \"carrier\": \"Correios\"\n },\n \"items\": [\n {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\",\n \"quantity\": 2\n }\n ]\n },\n \"occurred_at\": \"2026-11-18T14:03:00-03:00\",\n \"external_id\": \"ship_10293\"\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/events/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"order_shipped\",\n \"customer\": {\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"premium\"\n }\n },\n \"properties\": {\n \"order_number\": \"10293\",\n \"tracking\": {\n \"code\": \"BR123\",\n \"carrier\": \"Correios\"\n },\n \"items\": [\n {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\",\n \"quantity\": 2\n }\n ]\n },\n \"occurred_at\": \"2026-11-18T14:03:00-03:00\",\n \"external_id\": \"ship_10293\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/events/validate")
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 \"name\": \"order_shipped\",\n \"customer\": {\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"premium\"\n }\n },\n \"properties\": {\n \"order_number\": \"10293\",\n \"tracking\": {\n \"code\": \"BR123\",\n \"carrier\": \"Correios\"\n },\n \"items\": [\n {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\",\n \"quantity\": 2\n }\n ]\n },\n \"occurred_at\": \"2026-11-18T14:03:00-03:00\",\n \"external_id\": \"ship_10293\"\n}"
response = http.request(request)
puts response.read_body{
"object": "event",
"id": "evt_01jd2v9k3m8q4r5s6t7u8v9w0x",
"name": "order_shipped",
"occurred_at": "2026-11-18T17:03:01.000Z",
"received_at": "2026-11-18T17:03:01.000Z",
"customer": {
"would_create": true
},
"flows": [
{
"id": "flw_ckdef456",
"name": "Pedido enviado",
"status": "queued"
}
],
"properties": {
"tracking_code": "BR123"
},
"backfill": false,
"livemode": true
}{
"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 \"read\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "not_found",
"code": "customer_not_found",
"message": "No customer has this id. Remove customer.id to match by the other identifiers.",
"param": "customer.id",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_event_name",
"message": "Event names use lowercase letters, digits and underscores, start with a letter and have at most 64 characters. Did you mean \"order_shipped\"?",
"param": "name",
"suggestion": "order_shipped",
"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>"
}
}Referencia
Validar evento sin guardarlo
Recibe el mismo cuerpo de POST /v1/events y devuelve lo que devolvería el envío, sin guardar nada ni modificar clientes: qué cliente coincidiría (o would_create), qué flows se encolarían o se omitirían y los avisos. El id del evento devuelto es provisional. Tiene un límite propio de 100 solicitudes por segundo por clave API. Exige una clave API con el permiso read.
POST
/
v1
/
events
/
validate
Validar evento sin guardarlo
curl --request POST \
--url https://api.bevits.com/v1/events/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_shipped",
"customer": {
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": {
"plano": "premium"
}
},
"properties": {
"order_number": "10293",
"tracking": {
"code": "BR123",
"carrier": "Correios"
},
"items": [
{
"sku": "CAM-01",
"name": "Camiseta",
"quantity": 2
}
]
},
"occurred_at": "2026-11-18T14:03:00-03:00",
"external_id": "ship_10293"
}
'import requests
url = "https://api.bevits.com/v1/events/validate"
payload = {
"name": "order_shipped",
"customer": {
"external_id": "u_8842",
"email": "ana@exemplo.com.br",
"phone": "+5511988887777",
"name": "Ana Souza",
"attributes": { "plano": "premium" }
},
"properties": {
"order_number": "10293",
"tracking": {
"code": "BR123",
"carrier": "Correios"
},
"items": [
{
"sku": "CAM-01",
"name": "Camiseta",
"quantity": 2
}
]
},
"occurred_at": "2026-11-18T14:03:00-03:00",
"external_id": "ship_10293"
}
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({
name: 'order_shipped',
customer: {
external_id: 'u_8842',
email: 'ana@exemplo.com.br',
phone: '+5511988887777',
name: 'Ana Souza',
attributes: {plano: 'premium'}
},
properties: {
order_number: '10293',
tracking: {code: 'BR123', carrier: 'Correios'},
items: [{sku: 'CAM-01', name: 'Camiseta', quantity: 2}]
},
occurred_at: '2026-11-18T14:03:00-03:00',
external_id: 'ship_10293'
})
};
fetch('https://api.bevits.com/v1/events/validate', 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/events/validate",
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([
'name' => 'order_shipped',
'customer' => [
'external_id' => 'u_8842',
'email' => 'ana@exemplo.com.br',
'phone' => '+5511988887777',
'name' => 'Ana Souza',
'attributes' => [
'plano' => 'premium'
]
],
'properties' => [
'order_number' => '10293',
'tracking' => [
'code' => 'BR123',
'carrier' => 'Correios'
],
'items' => [
[
'sku' => 'CAM-01',
'name' => 'Camiseta',
'quantity' => 2
]
]
],
'occurred_at' => '2026-11-18T14:03:00-03:00',
'external_id' => 'ship_10293'
]),
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/events/validate"
payload := strings.NewReader("{\n \"name\": \"order_shipped\",\n \"customer\": {\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"premium\"\n }\n },\n \"properties\": {\n \"order_number\": \"10293\",\n \"tracking\": {\n \"code\": \"BR123\",\n \"carrier\": \"Correios\"\n },\n \"items\": [\n {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\",\n \"quantity\": 2\n }\n ]\n },\n \"occurred_at\": \"2026-11-18T14:03:00-03:00\",\n \"external_id\": \"ship_10293\"\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/events/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"order_shipped\",\n \"customer\": {\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"premium\"\n }\n },\n \"properties\": {\n \"order_number\": \"10293\",\n \"tracking\": {\n \"code\": \"BR123\",\n \"carrier\": \"Correios\"\n },\n \"items\": [\n {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\",\n \"quantity\": 2\n }\n ]\n },\n \"occurred_at\": \"2026-11-18T14:03:00-03:00\",\n \"external_id\": \"ship_10293\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/events/validate")
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 \"name\": \"order_shipped\",\n \"customer\": {\n \"external_id\": \"u_8842\",\n \"email\": \"ana@exemplo.com.br\",\n \"phone\": \"+5511988887777\",\n \"name\": \"Ana Souza\",\n \"attributes\": {\n \"plano\": \"premium\"\n }\n },\n \"properties\": {\n \"order_number\": \"10293\",\n \"tracking\": {\n \"code\": \"BR123\",\n \"carrier\": \"Correios\"\n },\n \"items\": [\n {\n \"sku\": \"CAM-01\",\n \"name\": \"Camiseta\",\n \"quantity\": 2\n }\n ]\n },\n \"occurred_at\": \"2026-11-18T14:03:00-03:00\",\n \"external_id\": \"ship_10293\"\n}"
response = http.request(request)
puts response.read_body{
"object": "event",
"id": "evt_01jd2v9k3m8q4r5s6t7u8v9w0x",
"name": "order_shipped",
"occurred_at": "2026-11-18T17:03:01.000Z",
"received_at": "2026-11-18T17:03:01.000Z",
"customer": {
"would_create": true
},
"flows": [
{
"id": "flw_ckdef456",
"name": "Pedido enviado",
"status": "queued"
}
],
"properties": {
"tracking_code": "BR123"
},
"backfill": false,
"livemode": true
}{
"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 \"read\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "not_found",
"code": "customer_not_found",
"message": "No customer has this id. Remove customer.id to match by the other identifiers.",
"param": "customer.id",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "validation_error",
"code": "invalid_event_name",
"message": "Event names use lowercase letters, digits and underscores, start with a letter and have at most 64 characters. Did you mean \"order_shipped\"?",
"param": "name",
"suggestion": "order_shipped",
"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>"
}
}Autorizaciones
Cuerpo
application/json
Respuesta
Lo que devolvería el envío. No se guardó nada.