Consultar cliente
curl --request GET \
--url https://api.bevits.com/v1/customers/{customer_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bevits.com/v1/customers/{customer_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bevits.com/v1/customers/{customer_id}', 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/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bevits.com/v1/customers/{customer_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bevits.com/v1/customers/{customer_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "<string>",
"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",
"identification": "<string>",
"default_address": {
"id": "<string>",
"street": "<string>",
"number": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Referencia
Consultar cliente
Retorna datos de contacto, métricas, etiquetas, atributos y la dirección predeterminada del cliente.
GET
/
v1
/
customers
/
{customer_id}
Consultar cliente
curl --request GET \
--url https://api.bevits.com/v1/customers/{customer_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bevits.com/v1/customers/{customer_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bevits.com/v1/customers/{customer_id}', 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/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bevits.com/v1/customers/{customer_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bevits.com/v1/customers/{customer_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "<string>",
"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",
"identification": "<string>",
"default_address": {
"id": "<string>",
"street": "<string>",
"number": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Autorizaciones
Clave API creada en la configuración de la organización.
Parámetros de ruta
ID público del cliente.
Pattern:
^cus_[A-Za-z0-9_-]+$Respuesta
Cliente encontrado.
Allowed value:
"customer"Pattern:
^cus_[A-Za-z0-9_-]+$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Teléfono con código de país, cuando esté disponible.
Show child attributes
Show child attributes
⌘I