Skip to main content
POST
/
v1
/
checkouts
Criar checkout Pix
curl --request POST \
  --url https://api.troqpay.com/v1/checkouts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 12990,
  "currency": "BRL",
  "description": "Plano Pro",
  "externalId": "order_1001",
  "expiresIn": 1800,
  "settlementCurrency": "USDT",
  "customer": {
    "name": "Maria Santos",
    "email": "maria@example.com",
    "document": "12345678909"
  },
  "metadata": {
    "plan": "pro"
  }
}
'
{
  "id": "chk_01HR7P8Z5N7A8Q2P8Y7F2D8Q6J",
  "livemode": false,
  "status": "PENDING",
  "amount": 12990,
  "currency": "BRL",
  "createdAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z",
  "pix": {
    "copyPaste": "00020101021226840014br.gov.bcb.pix...",
    "qrCodeUrl": "https://api.troqpay.com/qrcode/chk_01HR7P8Z5N7A8Q2P8Y7F2D8Q6J.png"
  },
  "settlement": {
    "currency": "USDT",
    "status": "PENDING",
    "amount": "24.560000"
  },
  "description": "Plano Pro",
  "externalId": "order_1001",
  "checkoutUrl": "https://pay.troqpay.com/c/chk_01HR7P8Z5N7A8Q2P8Y7F2D8Q6J",
  "paidAt": "2023-11-07T05:31:56Z",
  "customer": {
    "name": "Maria Santos",
    "email": "maria@example.com",
    "document": "12345678909"
  },
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

Chave única para evitar criação duplicada em caso de retry.

Body

application/json
amount
integer
required

Valor em centavos de BRL.

Required range: x >= 1
Example:

12990

currency
enum<string>
default:BRL
Available options:
BRL
description
string
Example:

"Plano Pro"

externalId
string
Example:

"order_1001"

expiresIn
integer
default:1800

Tempo de expiração do checkout em segundos.

Example:

1800

settlementCurrency
enum<string>
default:USDT
Available options:
USDT
customer
object
metadata
object
Example:
{ "plan": "pro" }

Response

Checkout criado com sucesso.

id
string
required
Example:

"chk_01HR7P8Z5N7A8Q2P8Y7F2D8Q6J"

livemode
boolean
required
Example:

false

status
enum<string>
required
Available options:
PENDING,
PAID,
EXPIRED,
CANCELLED
amount
integer
required
Example:

12990

currency
string
required
Example:

"BRL"

createdAt
string<date-time>
required
expiresAt
string<date-time>
required
pix
object
required
settlement
object
required
description
string | null
Example:

"Plano Pro"

externalId
string | null
Example:

"order_1001"

checkoutUrl
string<uri>
Example:

"https://pay.troqpay.com/c/chk_01HR7P8Z5N7A8Q2P8Y7F2D8Q6J"

paidAt
string<date-time> | null
customer
object
metadata
object