Skip to main content
POST
/
v1
/
withdrawals
cURL
curl https://api.troqpay.com/v1/withdrawals \
  -X POST \
  -H "Authorization: Bearer trq_live_8b3c1d5e6f2a9b0c1d4a8b3c" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: withdrawal_1001" \
  -d '{"rail":"BRL_PIX","amount":"100.00"}'
{
  "id": "wd_4a8b3c1d5e6f2a9b0c1d",
  "livemode": true,
  "rail": "BRL_PIX",
  "currency": "BRL",
  "status": "REQUESTED",
  "requestedAmount": "100.00",
  "destination": {
    "summary": "Pix CPF • 1234...7890",
    "label": "Maria Silva"
  },
  "quote": {
    "sourceAmount": "100.00",
    "sourceCurrency": "BRL",
    "withdrawalFeeAmount": "0.00",
    "withdrawalFeeCurrency": "BRL",
    "netSourceAmount": "100.00",
    "netSourceCurrency": "BRL",
    "destinationAmount": "100.00",
    "destinationCurrency": "BRL",
    "quotedRateBrlPerUsdt": null,
    "quotedAt": "2023-11-07T05:31:56Z",
    "quoteSource": "BRL_PIX_TERMS_V1",
    "network": null
  },
  "requestedAt": "2023-11-07T05:31:56Z",
  "approvedAt": "2023-11-07T05:31:56Z",
  "processingAt": "2023-11-07T05:31:56Z",
  "completedAt": "2023-11-07T05:31:56Z",
  "failedAt": "2023-11-07T05:31:56Z",
  "cancelledAt": "2023-11-07T05:31:56Z",
  "failure": {
    "code": "insufficient_balance",
    "message": "available balance is insufficient for this withdrawal"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.troqpay.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string
required

Chave de idempotência obrigatória para criação de saque. Mesma chave e mesmo corpo retornam o mesmo saque; mesma chave com corpo diferente retorna 409 idempotency_conflict.

Example:

"withdrawal_1001"

Request-Id
string

Identificador opcional fornecido pelo cliente para correlação. A API aceita também X-Request-Id. O valor é ecoado de volta no header de resposta Request-Id. Se nenhum dos dois é enviado, a API gera req_<24 hex>.

Example:

"req_4a8b3c1d5e6f2a9b0c1d2e3f"

Body

application/json

Dados para solicitar um saque. O destino não é enviado no corpo; a API usa o destino aprovado na conta para o trilho escolhido.

rail
enum<string>
required

Trilho do saque.

Available options:
BRL_PIX,
USDT_WALLET
Example:

"BRL_PIX"

amount
string
required

Valor bruto solicitado em BRL, como string decimal.

Example:

"100.00"

Response

Reentrega idempotente: o saque já existente foi retornado.

id
string
required

Identificador público do saque.

Example:

"wd_4a8b3c1d5e6f2a9b0c1d"

livemode
boolean
required

Sempre true para saques criados pela API.

Example:

true

rail
enum<string>
required
Available options:
BRL_PIX,
USDT_WALLET
Example:

"BRL_PIX"

currency
enum<string>
required
Available options:
BRL
Example:

"BRL"

status
enum<string>
required

Estado atual do saque.

Available options:
REQUESTED,
APPROVED,
PROCESSING,
COMPLETED,
FAILED,
CANCELLED
requestedAmount
string
required

Valor bruto solicitado em BRL.

Example:

"100.00"

destination
object
required

Resumo mascarado do destino usado no saque.

quote
object
required

Resumo financeiro usado para calcular o valor do saque.

requestedAt
string<date-time>
required
approvedAt
string<date-time> | null
required
processingAt
string<date-time> | null
required
completedAt
string<date-time> | null
required
failedAt
string<date-time> | null
required
cancelledAt
string<date-time> | null
required
failure
object
required