Idempotency
POST /v1/pix accepts an externalRef in the body. This field is used as an idempotency key so that resending the same charge (network timeout, retry from your application, etc.) does not create duplicates.
How to use it
Include externalRef in the charge creation body:
{
"amountCents": 1000,
"externalRef": "order-123",
"customer": { /* ... */ }
}Use a unique identifier per logical operation (e.g., your system’s order ID).
Behavior
- Same
externalRefrepeated: INFI returns the original charge with HTTP200and an extra field"idempotent": true. - Missing
externalRef: each call creates a new independent charge.
The idempotency key retention window is 7 days after creation. After that, the same externalRef may produce a new charge.
The idempotency key is resolved within the scope of your account. There is no collision between externalRefs of different merchants.
Withdrawals
POST /v1/withdraw accepts externalRef (optional, but strongly recommended) in the body. The behavior is the same as POST /v1/pix:
- Same
externalRefrepeated: returns the original transaction with HTTP200and"idempotent": true. Balance is not debited again. - Missing
externalRef: each call creates an independent withdrawal — real risk of duplication on retries.
{
"amountCents": 5000,
"pixKey": "12345678901",
"pixKeyType": "cpf",
"externalRef": "withdraw-2026-05-08-001"
}Withdrawals are critical financial operations. On retry without externalRef, INFI has no way to know it is the same withdrawal and creates a new one, duplicating the outflow. Always send a unique and stable identifier (internal ID in your system, UUID, etc.).
If you did not use externalRef and the call failed with timeout, do not blindly resend. Instead:
- Wait a few seconds (the webhook may arrive).
- Query
GET /v1/transactions?type=withdrawal&limit=10to see whether it was created. - Use the
transactionIdfrom the response to track it.
See also the anti-burst limits in POST /v1/withdraw — max 1 withdrawal/second and 2 withdrawals/minute per account.
Webhooks received
Webhooks sent by INFI to your endpoint do not carry a unique delivery header. Use transactionId + event as a dedup key on your side. See Webhook · Retry.