curl --request POST \
--url https://api.cakto.com.br/public_api/payments/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"birthDate": "2023-12-25",
"docType": "<string>",
"docNumber": "<string>",
"ip": "<string>",
"fingerprint": "<string>"
},
"items": [
{
"offerId": "<string>",
"quantity": 1,
"offerType": "main",
"installments": 6
}
],
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"zipcode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
},
"affiliateShortId": "<string>",
"coupon": "<string>",
"metadata": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"sck": "<string>"
},
"dueDate": "2023-12-25",
"pixExpiresIn": 61,
"card": {
"token": "<string>"
},
"threeDSecure": {
"cavv": "<string>",
"eci": "<string>",
"xid": "<string>",
"referenceId": "<string>",
"version": "<string>",
"dataOnly": false
},
"installments": 6,
"antifraud_profiling_attempt_reference": "<string>"
}
'import requests
url = "https://api.cakto.com.br/public_api/payments/"
payload = {
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"birthDate": "2023-12-25",
"docType": "<string>",
"docNumber": "<string>",
"ip": "<string>",
"fingerprint": "<string>"
},
"items": [
{
"offerId": "<string>",
"quantity": 1,
"offerType": "main",
"installments": 6
}
],
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"zipcode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
},
"affiliateShortId": "<string>",
"coupon": "<string>",
"metadata": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"sck": "<string>"
},
"dueDate": "2023-12-25",
"pixExpiresIn": 61,
"card": { "token": "<string>" },
"threeDSecure": {
"cavv": "<string>",
"eci": "<string>",
"xid": "<string>",
"referenceId": "<string>",
"version": "<string>",
"dataOnly": False
},
"installments": 6,
"antifraud_profiling_attempt_reference": "<string>"
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer: {
name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
birthDate: '2023-12-25',
docType: '<string>',
docNumber: '<string>',
ip: '<string>',
fingerprint: '<string>'
},
items: [{offerId: '<string>', quantity: 1, offerType: 'main', installments: 6}],
address: {
country: '<string>',
state: '<string>',
city: '<string>',
zipcode: '<string>',
street: '<string>',
number: '<string>',
neighborhood: '<string>',
complement: '<string>'
},
affiliateShortId: '<string>',
coupon: '<string>',
metadata: {
utm_source: '<string>',
utm_medium: '<string>',
utm_campaign: '<string>',
utm_term: '<string>',
utm_content: '<string>',
sck: '<string>'
},
dueDate: '2023-12-25',
pixExpiresIn: 61,
card: {token: '<string>'},
threeDSecure: {
cavv: '<string>',
eci: '<string>',
xid: '<string>',
referenceId: '<string>',
version: '<string>',
dataOnly: false
},
installments: 6,
antifraud_profiling_attempt_reference: '<string>'
})
};
fetch('https://api.cakto.com.br/public_api/payments/', 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.cakto.com.br/public_api/payments/",
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([
'customer' => [
'name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'birthDate' => '2023-12-25',
'docType' => '<string>',
'docNumber' => '<string>',
'ip' => '<string>',
'fingerprint' => '<string>'
],
'items' => [
[
'offerId' => '<string>',
'quantity' => 1,
'offerType' => 'main',
'installments' => 6
]
],
'address' => [
'country' => '<string>',
'state' => '<string>',
'city' => '<string>',
'zipcode' => '<string>',
'street' => '<string>',
'number' => '<string>',
'neighborhood' => '<string>',
'complement' => '<string>'
],
'affiliateShortId' => '<string>',
'coupon' => '<string>',
'metadata' => [
'utm_source' => '<string>',
'utm_medium' => '<string>',
'utm_campaign' => '<string>',
'utm_term' => '<string>',
'utm_content' => '<string>',
'sck' => '<string>'
],
'dueDate' => '2023-12-25',
'pixExpiresIn' => 61,
'card' => [
'token' => '<string>'
],
'threeDSecure' => [
'cavv' => '<string>',
'eci' => '<string>',
'xid' => '<string>',
'referenceId' => '<string>',
'version' => '<string>',
'dataOnly' => false
],
'installments' => 6,
'antifraud_profiling_attempt_reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/payments/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"docType\": \"<string>\",\n \"docNumber\": \"<string>\",\n \"ip\": \"<string>\",\n \"fingerprint\": \"<string>\"\n },\n \"items\": [\n {\n \"offerId\": \"<string>\",\n \"quantity\": 1,\n \"offerType\": \"main\",\n \"installments\": 6\n }\n ],\n \"address\": {\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"city\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"complement\": \"<string>\"\n },\n \"affiliateShortId\": \"<string>\",\n \"coupon\": \"<string>\",\n \"metadata\": {\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\",\n \"sck\": \"<string>\"\n },\n \"dueDate\": \"2023-12-25\",\n \"pixExpiresIn\": 61,\n \"card\": {\n \"token\": \"<string>\"\n },\n \"threeDSecure\": {\n \"cavv\": \"<string>\",\n \"eci\": \"<string>\",\n \"xid\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"version\": \"<string>\",\n \"dataOnly\": false\n },\n \"installments\": 6,\n \"antifraud_profiling_attempt_reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.cakto.com.br/public_api/payments/")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"docType\": \"<string>\",\n \"docNumber\": \"<string>\",\n \"ip\": \"<string>\",\n \"fingerprint\": \"<string>\"\n },\n \"items\": [\n {\n \"offerId\": \"<string>\",\n \"quantity\": 1,\n \"offerType\": \"main\",\n \"installments\": 6\n }\n ],\n \"address\": {\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"city\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"complement\": \"<string>\"\n },\n \"affiliateShortId\": \"<string>\",\n \"coupon\": \"<string>\",\n \"metadata\": {\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\",\n \"sck\": \"<string>\"\n },\n \"dueDate\": \"2023-12-25\",\n \"pixExpiresIn\": 61,\n \"card\": {\n \"token\": \"<string>\"\n },\n \"threeDSecure\": {\n \"cavv\": \"<string>\",\n \"eci\": \"<string>\",\n \"xid\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"version\": \"<string>\",\n \"dataOnly\": false\n },\n \"installments\": 6,\n \"antifraud_profiling_attempt_reference\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/payments/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Idempotency-Key", "<x-idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"docType\": \"<string>\",\n \"docNumber\": \"<string>\",\n \"ip\": \"<string>\",\n \"fingerprint\": \"<string>\"\n },\n \"items\": [\n {\n \"offerId\": \"<string>\",\n \"quantity\": 1,\n \"offerType\": \"main\",\n \"installments\": 6\n }\n ],\n \"address\": {\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"city\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"complement\": \"<string>\"\n },\n \"affiliateShortId\": \"<string>\",\n \"coupon\": \"<string>\",\n \"metadata\": {\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\",\n \"sck\": \"<string>\"\n },\n \"dueDate\": \"2023-12-25\",\n \"pixExpiresIn\": 61,\n \"card\": {\n \"token\": \"<string>\"\n },\n \"threeDSecure\": {\n \"cavv\": \"<string>\",\n \"eci\": \"<string>\",\n \"xid\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"version\": \"<string>\",\n \"dataOnly\": false\n },\n \"installments\": 6,\n \"antifraud_profiling_attempt_reference\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "10bb51bb-03be-473c-b4c5-3490765c4096",
"refId": "CATDiPp",
"status": "waiting_payment",
"paymentMethod": "pix",
"amount": "49.90",
"baseAmount": "49.90",
"discount": "0.00",
"fees": "0.00",
"externalId": "7e1f0d37-9b5f-4f1f-bf7c-2bd4f97f9d23",
"product": {
"id": "cd287b31-d4b7-4e94-858a-66e05ce2f4a2",
"short_id": "19bruPi",
"name": "Product Name Example"
},
"offer": {
"id": "77BcHrY",
"name": "Product Name Example",
"price": 49.9
},
"pix": {
"qrCode": "00020126360014BR.GOV.BCB.PIX0114+5511999999999...",
"expirationDate": "2026-04-29 01:30:00+00:00",
"user_journey": null
},
"checkoutUrl": "https://pay.cakto.com.br/EXAMPLE",
"createdAt": "2026-04-28T23:30:00-03:00"
}Criar Cobrança Pix
Cria uma cobrança Pix transacional a partir de uma oferta da sua conta. Retorna o QR Code copia-e-cola (BR Code) para exibição ao pagador.
curl --request POST \
--url https://api.cakto.com.br/public_api/payments/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"birthDate": "2023-12-25",
"docType": "<string>",
"docNumber": "<string>",
"ip": "<string>",
"fingerprint": "<string>"
},
"items": [
{
"offerId": "<string>",
"quantity": 1,
"offerType": "main",
"installments": 6
}
],
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"zipcode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
},
"affiliateShortId": "<string>",
"coupon": "<string>",
"metadata": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"sck": "<string>"
},
"dueDate": "2023-12-25",
"pixExpiresIn": 61,
"card": {
"token": "<string>"
},
"threeDSecure": {
"cavv": "<string>",
"eci": "<string>",
"xid": "<string>",
"referenceId": "<string>",
"version": "<string>",
"dataOnly": false
},
"installments": 6,
"antifraud_profiling_attempt_reference": "<string>"
}
'import requests
url = "https://api.cakto.com.br/public_api/payments/"
payload = {
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"birthDate": "2023-12-25",
"docType": "<string>",
"docNumber": "<string>",
"ip": "<string>",
"fingerprint": "<string>"
},
"items": [
{
"offerId": "<string>",
"quantity": 1,
"offerType": "main",
"installments": 6
}
],
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"zipcode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"complement": "<string>"
},
"affiliateShortId": "<string>",
"coupon": "<string>",
"metadata": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"sck": "<string>"
},
"dueDate": "2023-12-25",
"pixExpiresIn": 61,
"card": { "token": "<string>" },
"threeDSecure": {
"cavv": "<string>",
"eci": "<string>",
"xid": "<string>",
"referenceId": "<string>",
"version": "<string>",
"dataOnly": False
},
"installments": 6,
"antifraud_profiling_attempt_reference": "<string>"
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer: {
name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
birthDate: '2023-12-25',
docType: '<string>',
docNumber: '<string>',
ip: '<string>',
fingerprint: '<string>'
},
items: [{offerId: '<string>', quantity: 1, offerType: 'main', installments: 6}],
address: {
country: '<string>',
state: '<string>',
city: '<string>',
zipcode: '<string>',
street: '<string>',
number: '<string>',
neighborhood: '<string>',
complement: '<string>'
},
affiliateShortId: '<string>',
coupon: '<string>',
metadata: {
utm_source: '<string>',
utm_medium: '<string>',
utm_campaign: '<string>',
utm_term: '<string>',
utm_content: '<string>',
sck: '<string>'
},
dueDate: '2023-12-25',
pixExpiresIn: 61,
card: {token: '<string>'},
threeDSecure: {
cavv: '<string>',
eci: '<string>',
xid: '<string>',
referenceId: '<string>',
version: '<string>',
dataOnly: false
},
installments: 6,
antifraud_profiling_attempt_reference: '<string>'
})
};
fetch('https://api.cakto.com.br/public_api/payments/', 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.cakto.com.br/public_api/payments/",
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([
'customer' => [
'name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'birthDate' => '2023-12-25',
'docType' => '<string>',
'docNumber' => '<string>',
'ip' => '<string>',
'fingerprint' => '<string>'
],
'items' => [
[
'offerId' => '<string>',
'quantity' => 1,
'offerType' => 'main',
'installments' => 6
]
],
'address' => [
'country' => '<string>',
'state' => '<string>',
'city' => '<string>',
'zipcode' => '<string>',
'street' => '<string>',
'number' => '<string>',
'neighborhood' => '<string>',
'complement' => '<string>'
],
'affiliateShortId' => '<string>',
'coupon' => '<string>',
'metadata' => [
'utm_source' => '<string>',
'utm_medium' => '<string>',
'utm_campaign' => '<string>',
'utm_term' => '<string>',
'utm_content' => '<string>',
'sck' => '<string>'
],
'dueDate' => '2023-12-25',
'pixExpiresIn' => 61,
'card' => [
'token' => '<string>'
],
'threeDSecure' => [
'cavv' => '<string>',
'eci' => '<string>',
'xid' => '<string>',
'referenceId' => '<string>',
'version' => '<string>',
'dataOnly' => false
],
'installments' => 6,
'antifraud_profiling_attempt_reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/payments/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"docType\": \"<string>\",\n \"docNumber\": \"<string>\",\n \"ip\": \"<string>\",\n \"fingerprint\": \"<string>\"\n },\n \"items\": [\n {\n \"offerId\": \"<string>\",\n \"quantity\": 1,\n \"offerType\": \"main\",\n \"installments\": 6\n }\n ],\n \"address\": {\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"city\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"complement\": \"<string>\"\n },\n \"affiliateShortId\": \"<string>\",\n \"coupon\": \"<string>\",\n \"metadata\": {\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\",\n \"sck\": \"<string>\"\n },\n \"dueDate\": \"2023-12-25\",\n \"pixExpiresIn\": 61,\n \"card\": {\n \"token\": \"<string>\"\n },\n \"threeDSecure\": {\n \"cavv\": \"<string>\",\n \"eci\": \"<string>\",\n \"xid\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"version\": \"<string>\",\n \"dataOnly\": false\n },\n \"installments\": 6,\n \"antifraud_profiling_attempt_reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.cakto.com.br/public_api/payments/")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"docType\": \"<string>\",\n \"docNumber\": \"<string>\",\n \"ip\": \"<string>\",\n \"fingerprint\": \"<string>\"\n },\n \"items\": [\n {\n \"offerId\": \"<string>\",\n \"quantity\": 1,\n \"offerType\": \"main\",\n \"installments\": 6\n }\n ],\n \"address\": {\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"city\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"complement\": \"<string>\"\n },\n \"affiliateShortId\": \"<string>\",\n \"coupon\": \"<string>\",\n \"metadata\": {\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\",\n \"sck\": \"<string>\"\n },\n \"dueDate\": \"2023-12-25\",\n \"pixExpiresIn\": 61,\n \"card\": {\n \"token\": \"<string>\"\n },\n \"threeDSecure\": {\n \"cavv\": \"<string>\",\n \"eci\": \"<string>\",\n \"xid\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"version\": \"<string>\",\n \"dataOnly\": false\n },\n \"installments\": 6,\n \"antifraud_profiling_attempt_reference\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/payments/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Idempotency-Key", "<x-idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"docType\": \"<string>\",\n \"docNumber\": \"<string>\",\n \"ip\": \"<string>\",\n \"fingerprint\": \"<string>\"\n },\n \"items\": [\n {\n \"offerId\": \"<string>\",\n \"quantity\": 1,\n \"offerType\": \"main\",\n \"installments\": 6\n }\n ],\n \"address\": {\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"city\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"complement\": \"<string>\"\n },\n \"affiliateShortId\": \"<string>\",\n \"coupon\": \"<string>\",\n \"metadata\": {\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\",\n \"sck\": \"<string>\"\n },\n \"dueDate\": \"2023-12-25\",\n \"pixExpiresIn\": 61,\n \"card\": {\n \"token\": \"<string>\"\n },\n \"threeDSecure\": {\n \"cavv\": \"<string>\",\n \"eci\": \"<string>\",\n \"xid\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"version\": \"<string>\",\n \"dataOnly\": false\n },\n \"installments\": 6,\n \"antifraud_profiling_attempt_reference\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "10bb51bb-03be-473c-b4c5-3490765c4096",
"refId": "CATDiPp",
"status": "waiting_payment",
"paymentMethod": "pix",
"amount": "49.90",
"baseAmount": "49.90",
"discount": "0.00",
"fees": "0.00",
"externalId": "7e1f0d37-9b5f-4f1f-bf7c-2bd4f97f9d23",
"product": {
"id": "cd287b31-d4b7-4e94-858a-66e05ce2f4a2",
"short_id": "19bruPi",
"name": "Product Name Example"
},
"offer": {
"id": "77BcHrY",
"name": "Product Name Example",
"price": 49.9
},
"pix": {
"qrCode": "00020126360014BR.GOV.BCB.PIX0114+5511999999999...",
"expirationDate": "2026-04-29 01:30:00+00:00",
"user_journey": null
},
"checkoutUrl": "https://pay.cakto.com.br/EXAMPLE",
"createdAt": "2026-04-28T23:30:00-03:00"
}Visão geral
Este endpoint gera uma cobrança Pix e devolve o QR Code que deve ser apresentado ao cliente final.- Retorna
qrCode(código copia-e-cola / BR Code). A imagem do QR Code deve ser gerada pela sua aplicação a partir desse texto — a API não devolve imagem. - Use
pixExpiresInpara definir o tempo de expiração do QR Code.
Autenticação
Todas as requisições exigem um token OAuth2 válido obtido emPOST /public_api/token/.
| Header | Obrigatório | Descrição |
|---|---|---|
Authorization | Sim | Bearer <access_token>. |
Content-Type | Sim | application/json. |
X-Idempotency-Key | Sim | Identificador único da cobrança (até 255 caracteres). Recomendado UUID v4. |
Escopo
write payments
payments habilitado. Configure no Painel Cakto.
Pré-requisitos
pix), Pix Automático (pix_auto) e Boleto (boleto) liquidam em uma conta Cakto Banking do produtor. Sem essa conta, a cobrança é rejeitada com 400 antes de chegar à adquirente.Cartão (credit_card, threeDs) não exige conta Banking e continua funcionando normalmente.- abertura concluída — a proposta chegou até o fim; conta em análise, em documentoscopia ou com proposta apenas aprovada ainda não vale;
- ativa;
- principal do produtor;
- fora de encerramento — encerramento solicitado ou concluído invalida a conta, mesmo que ela ainda apareça como ativa.
/public_api/) não expõe o status dessa conta — não há endpoint para consultá-lo antes de cobrar.
Idempotência
O headerX-Idempotency-Key é obrigatório e permite reenviar a mesma requisição com segurança em caso de instabilidade de rede, sem gerar cobranças duplicadas.
Reuso com payload idêntico
id e mesmo status HTTP). A cobrança não é recriada. Janela de retenção: 24 horas.Reuso com payload diferente
409 Conflict com a mensagem Header X-Idempotency-Key reutilizado com payload diferente. Use uma nova chave para a nova cobrança.Reuso enquanto a requisição original ainda processa
409 Conflict com a mensagem Requisição idempotente em processamento. Aguarde a primeira finalizar.Falha do servidor (5xx)
Rate limit
| Critério | Padrão |
|---|---|
| Por IP de origem | 60 requisições / minuto |
| Por token de acesso | 120 requisições / minuto |
429 Too Many Requests com o header Retry-After indicando os segundos restantes.
Corpo da requisição
Resumo dos campos
| Campo | Tipo | Obrigatório |
|---|---|---|
paymentMethod | "pix" | Sim |
customer | object | Sim |
customer.name | string | Sim |
customer.email | string | Sim |
customer.phone | string | Sim |
customer.fingerprint | string | Sim |
customer.docType | enum (cpf, cnpj) | Não (obrigatório na prática) |
customer.docNumber | string | Não (obrigatório na prática) |
customer.birthDate | string (ISO 8601) | Não |
customer.ip | string | Não |
items (exatamente 1 item) | array | Sim |
items[].offerId | string | Sim |
items[].quantity | integer | Não (default 1) |
items[].offerType | enum (main) | Não (default main) |
address | object | Não (obrigatório se o produto exige entrega física) |
affiliateShortId | string | Não |
coupon | string | Não |
metadata | object | Não |
pixExpiresIn | integer (segundos) | Não (respeita o limite do produto) |
Detalhamento dos campos
"pix" para cobranças Pix transacionais.Show Campos
Show Campos
5511999999999).cpf, cnpj.docType e docNumber. Os dois campos são exigidos para emissão de nota fiscal e conformidade com adquirentes.YYYY-MM-DD).Show Campos do item
Show Campos do item
id da oferta cobrada. A oferta deve estar active e pertencer à sua conta. Encontre o ID no Painel Cakto em Produtos, abrindo a oferta desejada. O produto é resolvido automaticamente a partir da oferta.1.main é aceito.short_id do afiliado responsável pela venda. Deve estar active e cadastrado para o produto.60. Deve respeitar o limite máximo configurado no produto (pixExpiresIn).O valor é repassado à adquirente que processar a cobrança. Se ela impuser um limite próprio,
vale o dela — confira sempre o pix.expirationDate devolvido na resposta. Omitindo o campo,
vale o padrão da adquirente.Resposta de sucesso
201 Created
waiting_payment.pix.Exemplo de resposta
{
"id": "10bb51bb-03be-473c-b4c5-3490765c4096",
"refId": "CATDiPp",
"status": "waiting_payment",
"paymentMethod": "pix",
"amount": "49.90",
"baseAmount": "49.90",
"discount": "0.00",
"fees": "0.00",
"externalId": "7e1f0d37-9b5f-4f1f-bf7c-2bd4f97f9d23",
"checkoutUrl": "https://pay.cakto.com.br/CATDiPp",
"createdAt": "2026-04-28T23:30:00-03:00",
"product": {
"id": "cd287b31-d4b7-4e94-858a-66e05ce2f4a2",
"short_id": "19bruPi",
"name": "Cakto Pro Plan"
},
"offer": {
"id": "77BcHrY",
"name": "Plano Mensal",
"price": 49.9
},
"pix": {
"qrCode": "00020126360014BR.GOV.BCB.PIX0114+5511999999999...",
"expirationDate": "2026-04-29 01:30:00+00:00",
"user_journey": null
}
}
Respostas de erro
| Código | Quando ocorre | Corpo de exemplo |
|---|---|---|
400 | Header X-Idempotency-Key ausente, vazio ou maior que 255 caracteres. | { "detail": "Header X-Idempotency-Key é obrigatório." } |
400 | paymentMethod ausente ou fora da lista aceita. | { "paymentMethod": ["Método de pagamento não suportado."] } |
400 | Oferta inexistente, inativa ou de outro produto. | { "items": ["Oferta não encontrada para o produto informado."] } |
400 | pixExpiresIn acima do limite do produto. | { "pixExpiresIn": ["A expiração do Pix excede o limite do produto (3600 segundo(s))."] } |
400 | Produtor sem conta Cakto Banking válida (só afeta pix, pix_auto e boleto). Veja Pré-requisitos. | { "paymentMethod": ["Pix, Pix Automático e boleto só podem ser cobrados por produtores com conta Cakto Banking aberta, ativa e fora de encerramento — é nela que esses métodos liquidam. Confira o status da conta no Painel Cakto (https://app.cakto.com.br/dashboard); se a abertura não foi concluída, conclua-a. Cobranças com cartão (credit_card, threeDs) não dependem dessa conta e seguem disponíveis."] } |
400 | Conta do produtor bloqueada. | { "detail": "Conta bloqueada." } |
401 | Token ausente, inválido ou expirado. | { "detail": "As credenciais de autenticação não foram fornecidas." } |
403 | Chave de API sem escopo payments. | { "detail": "Você não tem permissão para executar esta ação." } |
409 | X-Idempotency-Key reutilizado com payload diferente. | { "detail": "Header X-Idempotency-Key reutilizado com payload diferente." } |
409 | X-Idempotency-Key em processamento. | { "detail": "Requisição idempotente em processamento." } |
429 | Rate limit excedido. | { "detail": "Request was throttled. Expected available in 60 seconds." } |
5xx indicam falha temporária da Cakto. A chave de idempotência é liberada automaticamente. A próxima retentativa executa a cobrança normalmente.Exemplo de requisição
curl -X POST 'https://api.cakto.com.br/public_api/payments/' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsIn...' \
-H 'Content-Type: application/json' \
-H 'X-Idempotency-Key: 7b1a3d6e-9e4f-4f1f-bf7c-2bd4f97f9d23' \
-d '{
"paymentMethod": "pix",
"customer": {
"name": "Maria Souza",
"email": "maria@example.com",
"phone": "5511999999999",
"fingerprint": "fp_2f8c1e5e-1aa8-4d4d-b9d4-19f7e5e0e1ab",
"docType": "cpf",
"docNumber": "12345678909"
},
"items": [
{ "offerId": "77BcHrY" }
]
}'
import uuid
import requests
response = requests.post(
"https://api.cakto.com.br/public_api/payments/",
headers={
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsIn...",
"Content-Type": "application/json",
"X-Idempotency-Key": str(uuid.uuid4()),
},
json={
"paymentMethod": "pix",
"customer": {
"name": "Maria Souza",
"email": "maria@example.com",
"phone": "5511999999999",
"fingerprint": "fp_2f8c1e5e-1aa8-4d4d-b9d4-19f7e5e0e1ab",
"docType": "cpf",
"docNumber": "12345678909",
},
"items": [{"offerId": "77BcHrY"}],
},
timeout=30,
)
response.raise_for_status()
payment = response.json()
print(payment["pix"]["qrCode"])
import { randomUUID } from "node:crypto";
const response = await fetch("https://api.cakto.com.br/public_api/payments/", {
method: "POST",
headers: {
Authorization: "Bearer eyJhbGciOiJIUzI1NiIsIn...",
"Content-Type": "application/json",
"X-Idempotency-Key": randomUUID(),
},
body: JSON.stringify({
paymentMethod: "pix",
customer: {
name: "Maria Souza",
email: "maria@example.com",
phone: "5511999999999",
fingerprint: "fp_2f8c1e5e-1aa8-4d4d-b9d4-19f7e5e0e1ab",
docType: "cpf",
docNumber: "12345678909",
},
items: [{ offerId: "77BcHrY" }],
}),
});
if (!response.ok) throw new Error(`Cakto API error ${response.status}`);
const payment = await response.json();
console.log(payment.pix.qrCode);
Boas práticas
- Gere uma chave de idempotência por intenção de compra, não por retentativa. Se o usuário recarregar o carrinho e mudar o item, gere uma nova chave.
- Persista o
idretornado junto à intenção de compra. Use-o para conciliar com webhooks e comGET /public_api/orders/{id}/. - Exiba o QR Code assim que receber a resposta. Gere a imagem no seu lado a partir de
pix.qrCode(qualquer biblioteca de QR Code) e ofereça também o texto copia-e-cola. - Não envie dados sensíveis em
metadata. Os campos UTM escksão propagados para webhooks e relatórios.
Authorizations
Token de autenticação do tipo Bearer {access_token}, onde {access_token} é o token obtido no fluxo de autenticação.
Headers
Identificador único por cobrança. Reuso com payload idêntico devolve a mesma resposta (24h). Máximo de 255 caracteres; recomenda-se UUID v4.
Body
Método de pagamento.
pix- pixpix_auto- pix_autoboleto- boletocredit_card- credit_cardthreeDs- threeDs
pix, pix_auto, boleto, credit_card, threeDs Dados do pagador. CPF e CPNJ aceitos conforme contrato existente do checkout.
Show child attributes
Show child attributes
Deve conter exatamente um item.
Show child attributes
Show child attributes
Endereço do pagador. Obrigatório quando o produto exige envio físico.
Show child attributes
Show child attributes
short_id do afiliado responsável pela venda, usado para resolver o split interno. Deve estar com status active e cadastrado para o produto informado.
40Código do cupom de desconto.
255Optional UTM/tracking metadata associated with the payment.
Show child attributes
Show child attributes
Somente para boleto. Data de vencimento (YYYY-MM-DD). Deve ser futura e respeitar o ticketExpiration do produto.
Somente para pix e pix_auto. Expiração do código Pix em segundos. Mínimo 60. Deve respeitar o pixExpiresIn do produto.
x >= 60Dados do cartão de crédito. Obrigatório quando paymentMethod é credit_card ou threeDs.
Show child attributes
Show child attributes
Dados de autenticação 3DS. Opcional para credit_card; recomendado para threeDs.
Show child attributes
Show child attributes
Número de parcelas. Aplicável apenas para pagamentos com cartão de crédito.
1 <= x <= 12Referência de profiling do antifraude. Obrigatório para credit_card e threeDs; deve ser o mesmo attemptReference usado ao inicializar o profiler no navegador.
Response
Corpo da resposta status 201
Cobrança criada pelo endpoint público.
Identificador único do pedido criado.
Código curto de referência do pedido.
Status inicial do pedido. Para Pix e Boleto, normalmente waiting_payment.
Método de pagamento da cobrança, ecoando o valor enviado na requisição.
pix- pixpix_auto- pix_autoboleto- boletocredit_card- credit_cardthreeDs- threeDs
pix, pix_auto, boleto, credit_card, threeDs Valor final cobrado, em reais, como string decimal.
Valor da oferta antes de descontos.
Desconto aplicado.
Taxas da transação.
Identificador da transação no provedor.
URL do checkout Cakto.
Data e hora de criação da cobrança.
Produto resolvido a partir da oferta enviada.
Show child attributes
Show child attributes
Oferta cobrada. Campos vazios no checkout são preenchidos com a oferta validada.
Show child attributes
Show child attributes
Presente apenas para pix e pix_auto.
Show child attributes
Show child attributes
Presente apenas para boleto.
Show child attributes
Show child attributes
Was this page helpful?