Criar cobranca PIX
curl --request POST \
--url http://localhost:3030/sellers/pix \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"amountCents": 1500,
"description": "Pagamento do pedido #123",
"externalRef": "order-123",
"expiresAt": "2026-12-31T23:59:59.000Z",
"metadata": {
"orderId": "123",
"channel": "api"
}
}
'import requests
url = "http://localhost:3030/sellers/pix"
payload = {
"amountCents": 1500,
"description": "Pagamento do pedido #123",
"externalRef": "order-123",
"expiresAt": "2026-12-31T23:59:59.000Z",
"metadata": {
"orderId": "123",
"channel": "api"
}
}
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amountCents: 1500,
description: 'Pagamento do pedido #123',
externalRef: 'order-123',
expiresAt: '2026-12-31T23:59:59.000Z',
metadata: {orderId: '123', channel: 'api'}
})
};
fetch('http://localhost:3030/sellers/pix', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3030",
CURLOPT_URL => "http://localhost:3030/sellers/pix",
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([
'amountCents' => 1500,
'description' => 'Pagamento do pedido #123',
'externalRef' => 'order-123',
'expiresAt' => '2026-12-31T23:59:59.000Z',
'metadata' => [
'orderId' => '123',
'channel' => 'api'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$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 := "http://localhost:3030/sellers/pix"
payload := strings.NewReader("{\n \"amountCents\": 1500,\n \"description\": \"Pagamento do pedido #123\",\n \"externalRef\": \"order-123\",\n \"expiresAt\": \"2026-12-31T23:59:59.000Z\",\n \"metadata\": {\n \"orderId\": \"123\",\n \"channel\": \"api\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
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("http://localhost:3030/sellers/pix")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amountCents\": 1500,\n \"description\": \"Pagamento do pedido #123\",\n \"externalRef\": \"order-123\",\n \"expiresAt\": \"2026-12-31T23:59:59.000Z\",\n \"metadata\": {\n \"orderId\": \"123\",\n \"channel\": \"api\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3030/sellers/pix")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCents\": 1500,\n \"description\": \"Pagamento do pedido #123\",\n \"externalRef\": \"order-123\",\n \"expiresAt\": \"2026-12-31T23:59:59.000Z\",\n \"metadata\": {\n \"orderId\": \"123\",\n \"channel\": \"api\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"amountCents": 123,
"pix": {
"qrCode": "<string>",
"copyPaste": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"splits": [
{
"id": "<string>",
"merchantId": "<string>",
"amountCents": 123,
"percentage": 123
}
],
"webhook": {
"url": "<string>",
"secret": "<string>",
"events": [
"<string>"
]
},
"payer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"document": "<string>",
"documentType": "CPF",
"institution": "<string>",
"agency": "<string>",
"account": "<string>"
},
"beneficiary": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"document": "<string>",
"documentType": "CPF",
"institution": "<string>",
"account": {
"institution": "<string>",
"type": "<string>"
}
},
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"traceId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"traceId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"traceId": "<string>"
}
}Cobranca PIX
Criar cobranca PIX
Cria uma cobranca PIX para o seller autenticado e retorna QR Code com copia e cola.
POST
/
sellers
/
pix
Criar cobranca PIX
curl --request POST \
--url http://localhost:3030/sellers/pix \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"amountCents": 1500,
"description": "Pagamento do pedido #123",
"externalRef": "order-123",
"expiresAt": "2026-12-31T23:59:59.000Z",
"metadata": {
"orderId": "123",
"channel": "api"
}
}
'import requests
url = "http://localhost:3030/sellers/pix"
payload = {
"amountCents": 1500,
"description": "Pagamento do pedido #123",
"externalRef": "order-123",
"expiresAt": "2026-12-31T23:59:59.000Z",
"metadata": {
"orderId": "123",
"channel": "api"
}
}
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amountCents: 1500,
description: 'Pagamento do pedido #123',
externalRef: 'order-123',
expiresAt: '2026-12-31T23:59:59.000Z',
metadata: {orderId: '123', channel: 'api'}
})
};
fetch('http://localhost:3030/sellers/pix', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3030",
CURLOPT_URL => "http://localhost:3030/sellers/pix",
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([
'amountCents' => 1500,
'description' => 'Pagamento do pedido #123',
'externalRef' => 'order-123',
'expiresAt' => '2026-12-31T23:59:59.000Z',
'metadata' => [
'orderId' => '123',
'channel' => 'api'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$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 := "http://localhost:3030/sellers/pix"
payload := strings.NewReader("{\n \"amountCents\": 1500,\n \"description\": \"Pagamento do pedido #123\",\n \"externalRef\": \"order-123\",\n \"expiresAt\": \"2026-12-31T23:59:59.000Z\",\n \"metadata\": {\n \"orderId\": \"123\",\n \"channel\": \"api\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
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("http://localhost:3030/sellers/pix")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amountCents\": 1500,\n \"description\": \"Pagamento do pedido #123\",\n \"externalRef\": \"order-123\",\n \"expiresAt\": \"2026-12-31T23:59:59.000Z\",\n \"metadata\": {\n \"orderId\": \"123\",\n \"channel\": \"api\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3030/sellers/pix")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCents\": 1500,\n \"description\": \"Pagamento do pedido #123\",\n \"externalRef\": \"order-123\",\n \"expiresAt\": \"2026-12-31T23:59:59.000Z\",\n \"metadata\": {\n \"orderId\": \"123\",\n \"channel\": \"api\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"amountCents": 123,
"pix": {
"qrCode": "<string>",
"copyPaste": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"splits": [
{
"id": "<string>",
"merchantId": "<string>",
"amountCents": 123,
"percentage": 123
}
],
"webhook": {
"url": "<string>",
"secret": "<string>",
"events": [
"<string>"
]
},
"payer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"document": "<string>",
"documentType": "CPF",
"institution": "<string>",
"agency": "<string>",
"account": "<string>"
},
"beneficiary": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"document": "<string>",
"documentType": "CPF",
"institution": "<string>",
"account": {
"institution": "<string>",
"type": "<string>"
}
},
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"traceId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"traceId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"traceId": "<string>"
}
}Caso de uso
Use este endpoint para criar uma cobranca PIX no checkout e receber imediatamente os dados de pagamento (qrCode e copyPaste) para exibir ao pagador.
Autenticacao
Obrigatorio em todas as chamadas:x-client-idx-client-secret
x-idempotency-key
Pre-condicoes e requisitos
amountCentsdeve ser inteiro positivo.- Se usar
webhook_url, a URL precisa ser valida e acessivel. - Se usar
splits, cada item deve contermerchantId. - Use idempotencia para evitar duplicidade de cobranca.
Request
Campos mais importantes do body:amountCents: valor em centavos.description: texto de referencia da cobranca.externalRef: identificador do seu sistema.expiresAt: expiracao em ISO-8601.metadata: dados de conciliacao.splits: divisao de repasse entre merchants.
Response de sucesso
Em201, a API retorna:
idestatusamountCentsedescriptionpix.qrCodeepix.copyPastepix.expiresAtcreatedAteupdatedAt

Erros comuns reais
201 CREATED400 VALIDATION_ERROR502 PROVIDER_ERROR
| HTTP | code | Quando ocorre |
|---|---|---|
400 | VALIDATION_ERROR | Body invalido ou campos fora do contrato. |
400 | MERCHANT_ID_REQUIRED | Merchant nao resolvido na credencial. |
401 | CREDENTIALS_REQUIRED | Credenciais ausentes. |
401 | INVALID_CREDENTIALS | Credenciais invalidas. |
502 | PIX_NOT_ISSUED | Cobranca criada sem payload PIX do provedor. |
502 | PROVIDER_ERROR | Falha no provedor durante emissao. |
500 | INTERNAL_ERROR | Falha interna nao classificada. |
Regras de negocio e observacoes operacionais
- Nao reutilize
x-idempotency-keycom payload diferente. - Se enviar
webhook_url, a cobranca cria webhook escopado para eventos de ciclo de vida. - O alias legado
/rifeiro/pixexiste por compatibilidade; rota canonica publica:/sellers/pix.
Exemplo de codigo
curl --request POST \
--url https://api.turbofypay.com/sellers/pix \
--header "x-client-id: <client-id>" \
--header "x-client-secret: <client-secret>" \
--header "x-idempotency-key: pedido-123" \
--header "Content-Type: application/json" \
--data '{
"amountCents": 2990,
"description": "Pedido #123",
"externalRef": "pedido-123"
}'
Proximos passos
- Consulte o status em Consultar cobranca PIX.
- Configure eventos em Webhooks.
- Revise seguranca em Autenticacao.
Authorizations
Client ID fornecido pela TurbofyPay.
Client Secret fornecido pela TurbofyPay.
Headers
Identificador do integrador.
Segredo de autenticacao do integrador.
Chave de idempotencia para operacoes de escrita.
Body
application/json
Response
Cobranca PIX criada com sucesso.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Last modified on June 1, 2026