curl --request POST \
--url https://api.centralcart.io/v1/webstore/checkout \
--header 'Content-Type: application/json' \
--header 'x-store-domain: <x-store-domain>' \
--data '
{
"gateway": "PIX",
"client_email": "[email protected]",
"client_name": "João da Silva",
"client_phone": "+5511999999999",
"client_document": "12345678900",
"client_discord": "123456789012345678",
"fields": {
"client_identifier": "meu_id"
},
"cart": [
{
"package_id": 1,
"quantity": 1,
"options": {
"nickname": "jogador123"
}
}
],
"coupon": "PROMO10"
}
'import requests
url = "https://api.centralcart.io/v1/webstore/checkout"
payload = {
"gateway": "PIX",
"client_email": "[email protected]",
"client_name": "João da Silva",
"client_phone": "+5511999999999",
"client_document": "12345678900",
"client_discord": "123456789012345678",
"fields": { "client_identifier": "meu_id" },
"cart": [
{
"package_id": 1,
"quantity": 1,
"options": { "nickname": "jogador123" }
}
],
"coupon": "PROMO10"
}
headers = {
"x-store-domain": "<x-store-domain>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-store-domain': '<x-store-domain>', 'Content-Type': 'application/json'},
body: JSON.stringify({
gateway: 'PIX',
client_email: '[email protected]',
client_name: 'João da Silva',
client_phone: '+5511999999999',
client_document: '12345678900',
client_discord: '123456789012345678',
fields: {client_identifier: 'meu_id'},
cart: [{package_id: 1, quantity: 1, options: {nickname: 'jogador123'}}],
coupon: 'PROMO10'
})
};
fetch('https://api.centralcart.io/v1/webstore/checkout', 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.centralcart.io/v1/webstore/checkout",
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([
'gateway' => 'PIX',
'client_email' => '[email protected]',
'client_name' => 'João da Silva',
'client_phone' => '+5511999999999',
'client_document' => '12345678900',
'client_discord' => '123456789012345678',
'fields' => [
'client_identifier' => 'meu_id'
],
'cart' => [
[
'package_id' => 1,
'quantity' => 1,
'options' => [
'nickname' => 'jogador123'
]
]
],
'coupon' => 'PROMO10'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/checkout"
payload := strings.NewReader("{\n \"gateway\": \"PIX\",\n \"client_email\": \"[email protected]\",\n \"client_name\": \"João da Silva\",\n \"client_phone\": \"+5511999999999\",\n \"client_document\": \"12345678900\",\n \"client_discord\": \"123456789012345678\",\n \"fields\": {\n \"client_identifier\": \"meu_id\"\n },\n \"cart\": [\n {\n \"package_id\": 1,\n \"quantity\": 1,\n \"options\": {\n \"nickname\": \"jogador123\"\n }\n }\n ],\n \"coupon\": \"PROMO10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/checkout")
.header("x-store-domain", "<x-store-domain>")
.header("Content-Type", "application/json")
.body("{\n \"gateway\": \"PIX\",\n \"client_email\": \"[email protected]\",\n \"client_name\": \"João da Silva\",\n \"client_phone\": \"+5511999999999\",\n \"client_document\": \"12345678900\",\n \"client_discord\": \"123456789012345678\",\n \"fields\": {\n \"client_identifier\": \"meu_id\"\n },\n \"cart\": [\n {\n \"package_id\": 1,\n \"quantity\": 1,\n \"options\": {\n \"nickname\": \"jogador123\"\n }\n }\n ],\n \"coupon\": \"PROMO10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gateway\": \"PIX\",\n \"client_email\": \"[email protected]\",\n \"client_name\": \"João da Silva\",\n \"client_phone\": \"+5511999999999\",\n \"client_document\": \"12345678900\",\n \"client_discord\": \"123456789012345678\",\n \"fields\": {\n \"client_identifier\": \"meu_id\"\n },\n \"cart\": [\n {\n \"package_id\": 1,\n \"quantity\": 1,\n \"options\": {\n \"nickname\": \"jogador123\"\n }\n }\n ],\n \"coupon\": \"PROMO10\"\n}"
response = http.request(request)
puts response.read_bodyCreate Checkout
Cria um pedido e retorna os dados de pagamento.
checkout_url para redirecionar o comprador. O PIX devolve o código copia-e-cola, o QR Code e a URL de acompanhamento do pedido. Consulte GET /webstore/gateway antes de chamar: enviar um checkout sem client_document para um gateway que o exige resulta em 422.curl --request POST \
--url https://api.centralcart.io/v1/webstore/checkout \
--header 'Content-Type: application/json' \
--header 'x-store-domain: <x-store-domain>' \
--data '
{
"gateway": "PIX",
"client_email": "[email protected]",
"client_name": "João da Silva",
"client_phone": "+5511999999999",
"client_document": "12345678900",
"client_discord": "123456789012345678",
"fields": {
"client_identifier": "meu_id"
},
"cart": [
{
"package_id": 1,
"quantity": 1,
"options": {
"nickname": "jogador123"
}
}
],
"coupon": "PROMO10"
}
'import requests
url = "https://api.centralcart.io/v1/webstore/checkout"
payload = {
"gateway": "PIX",
"client_email": "[email protected]",
"client_name": "João da Silva",
"client_phone": "+5511999999999",
"client_document": "12345678900",
"client_discord": "123456789012345678",
"fields": { "client_identifier": "meu_id" },
"cart": [
{
"package_id": 1,
"quantity": 1,
"options": { "nickname": "jogador123" }
}
],
"coupon": "PROMO10"
}
headers = {
"x-store-domain": "<x-store-domain>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-store-domain': '<x-store-domain>', 'Content-Type': 'application/json'},
body: JSON.stringify({
gateway: 'PIX',
client_email: '[email protected]',
client_name: 'João da Silva',
client_phone: '+5511999999999',
client_document: '12345678900',
client_discord: '123456789012345678',
fields: {client_identifier: 'meu_id'},
cart: [{package_id: 1, quantity: 1, options: {nickname: 'jogador123'}}],
coupon: 'PROMO10'
})
};
fetch('https://api.centralcart.io/v1/webstore/checkout', 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.centralcart.io/v1/webstore/checkout",
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([
'gateway' => 'PIX',
'client_email' => '[email protected]',
'client_name' => 'João da Silva',
'client_phone' => '+5511999999999',
'client_document' => '12345678900',
'client_discord' => '123456789012345678',
'fields' => [
'client_identifier' => 'meu_id'
],
'cart' => [
[
'package_id' => 1,
'quantity' => 1,
'options' => [
'nickname' => 'jogador123'
]
]
],
'coupon' => 'PROMO10'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/checkout"
payload := strings.NewReader("{\n \"gateway\": \"PIX\",\n \"client_email\": \"[email protected]\",\n \"client_name\": \"João da Silva\",\n \"client_phone\": \"+5511999999999\",\n \"client_document\": \"12345678900\",\n \"client_discord\": \"123456789012345678\",\n \"fields\": {\n \"client_identifier\": \"meu_id\"\n },\n \"cart\": [\n {\n \"package_id\": 1,\n \"quantity\": 1,\n \"options\": {\n \"nickname\": \"jogador123\"\n }\n }\n ],\n \"coupon\": \"PROMO10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/checkout")
.header("x-store-domain", "<x-store-domain>")
.header("Content-Type", "application/json")
.body("{\n \"gateway\": \"PIX\",\n \"client_email\": \"[email protected]\",\n \"client_name\": \"João da Silva\",\n \"client_phone\": \"+5511999999999\",\n \"client_document\": \"12345678900\",\n \"client_discord\": \"123456789012345678\",\n \"fields\": {\n \"client_identifier\": \"meu_id\"\n },\n \"cart\": [\n {\n \"package_id\": 1,\n \"quantity\": 1,\n \"options\": {\n \"nickname\": \"jogador123\"\n }\n }\n ],\n \"coupon\": \"PROMO10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gateway\": \"PIX\",\n \"client_email\": \"[email protected]\",\n \"client_name\": \"João da Silva\",\n \"client_phone\": \"+5511999999999\",\n \"client_document\": \"12345678900\",\n \"client_discord\": \"123456789012345678\",\n \"fields\": {\n \"client_identifier\": \"meu_id\"\n },\n \"cart\": [\n {\n \"package_id\": 1,\n \"quantity\": 1,\n \"options\": {\n \"nickname\": \"jogador123\"\n }\n }\n ],\n \"coupon\": \"PROMO10\"\n}"
response = http.request(request)
puts response.read_bodyCabeçalhos
Domínio da sua loja (ex: sualoja.centralcart.ai)
Corpo
Método de pagamento. Use um dos valores devolvidos por GET /webstore/gateway.
PIX, CREDITCARD, MERCADOPAGO, STRIPE, PAYPAL, PICPAY, OTHER Email do comprador
Nome completo do comprador. Apenas letras e separadores simples.
Telefone do comprador
CPF do comprador. Validado quando enviado.
Discord ID do comprador
Identificador do comprador no jogo ou serviço.
Endereço do comprador. Exigido pelos gateways que declaram require_address.
Show child attributes
Show child attributes
Campos personalizados de checkout, com a chave sendo o name devolvido por GET /webstore/checkout_fields.
Show child attributes
Show child attributes
Cupom de desconto
Código do afiliado que indicou a venda. Quando ausente, a API usa o cookie de indicação _cc_ref, se presente na requisição.
Número de parcelas (1 a 12). Somente para CREDITCARD.
Token do cartão gerado client-side pelo SDK do provider.
Dados de atribuição da sessão (UTMs e afins). Cookies de tracking presentes na requisição (_gcl_aw, _fbc, _fbp, _ttp) são incorporados automaticamente.
Resposta
Checkout criado
- Option 1
- Option 2