curl --request POST \
--url https://api.abacatepay.com/v2/customers/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "daniel_lima@abacatepay.com"
}
'import requests
url = "https://api.abacatepay.com/v2/customers/create"
payload = { "email": "daniel_lima@abacatepay.com" }
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({email: 'daniel_lima@abacatepay.com'})
};
fetch('https://api.abacatepay.com/v2/customers/create', 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.abacatepay.com/v2/customers/create",
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([
'email' => 'daniel_lima@abacatepay.com'
]),
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.abacatepay.com/v2/customers/create"
payload := strings.NewReader("{\n \"email\": \"daniel_lima@abacatepay.com\"\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.abacatepay.com/v2/customers/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"daniel_lima@abacatepay.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacatepay.com/v2/customers/create")
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 \"email\": \"daniel_lima@abacatepay.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cust_aebxkhDZNaMmJeKsy0AHS0FQ",
"devMode": true,
"name": "Daniel Lima",
"cellphone": "(11) 4002-8922",
"email": "daniel_lima@abacatepay.com",
"taxId": "123.456.789-01",
"country": "BR",
"zipCode": "01310-100",
"metadata": {
"source": "landing-page",
"campaign": "black-friday-2025"
}
},
"error": null,
"success": true
}{
"error": "Token de autenticação inválido ou ausente."
}Criar um Cliente
Permite que você crie um cliente para a sua loja.
Campo obrigatório: Apenas o email é obrigatório para criar um cliente.
Recomendado: Embora os demais campos sejam opcionais, é altamente recomendado fornecer name, cellphone, taxId e zipCode quando disponíveis, pois essas informações melhoram a experiência do cliente no checkout e facilitam a identificação.
curl --request POST \
--url https://api.abacatepay.com/v2/customers/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "daniel_lima@abacatepay.com"
}
'import requests
url = "https://api.abacatepay.com/v2/customers/create"
payload = { "email": "daniel_lima@abacatepay.com" }
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({email: 'daniel_lima@abacatepay.com'})
};
fetch('https://api.abacatepay.com/v2/customers/create', 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.abacatepay.com/v2/customers/create",
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([
'email' => 'daniel_lima@abacatepay.com'
]),
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.abacatepay.com/v2/customers/create"
payload := strings.NewReader("{\n \"email\": \"daniel_lima@abacatepay.com\"\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.abacatepay.com/v2/customers/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"daniel_lima@abacatepay.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacatepay.com/v2/customers/create")
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 \"email\": \"daniel_lima@abacatepay.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cust_aebxkhDZNaMmJeKsy0AHS0FQ",
"devMode": true,
"name": "Daniel Lima",
"cellphone": "(11) 4002-8922",
"email": "daniel_lima@abacatepay.com",
"taxId": "123.456.789-01",
"country": "BR",
"zipCode": "01310-100",
"metadata": {
"source": "landing-page",
"campaign": "black-friday-2025"
}
},
"error": null,
"success": true
}{
"error": "Token de autenticação inválido ou ausente."
}Obrigatório
data.email é obrigatório. Inclua name, taxId e cellphone sempre que tiver — melhora a experiência no checkout.{
"email": "joao@exemplo.com",
"name": "João Silva",
"taxId": "12345678900",
"cellphone": "+5511999999999",
"zipCode": "01310-100",
"metadata": { "plano": "premium" }
}
data.id retornado e passe como customerId ao criar checkouts — o cliente não precisa preencher os dados novamente.taxId, a API devolve o registro existente em vez de criar um duplicado.Authorizations
Todas as requisições devem incluir sua chave de API no header Authorization usando o formato Bearer <abacatepay-api-key>. Sem esse header a requisição será rejeitada.
Saiba mais sobre como criar e usar chaves de API na documentação de autenticação.
Body
Os dados do seu cliente.
Obrigatório: Apenas email é obrigatório.
Opcional mas recomendado: name, cellphone, taxId, zipCode e metadata são opcionais, mas recomendados para melhor experiência do cliente.
E-mail do cliente (obrigatório)
"daniel_lima@abacatepay.com"
Nome completo do seu cliente (opcional)
"Daniel Lima"
Celular do cliente (opcional)
"(11) 4002-8922"
CPF ou CNPJ válido do cliente (opcional)
"123.456.789-01"
CEP do cliente (opcional)
"01310-100"
Metadados adicionais do cliente. Campo livre para a sua aplicação (opcional)
{
"source": "landing-page",
"campaign": "black-friday-2025"
}
Was this page helpful?