Withdraw BRL from a customer's balance
Sends a Pix from the customer's BRL balance (what deposits and sales credited to that customer) to one of the customer's own payout destinations. The balance is debited when the withdrawal is created; nothing is converted. The response does not name the account the money leaves from.
The destination must belong to the same customer and be a BRL destination with a Pix key; the payment institution also checks that the destination's document is the customer's. Payments to third parties are not available on this endpoint.
reference is the idempotency lever. The same reference for the same customer returns the existing withdrawal with 200 and its current status, even if the destination was deactivated since. The same reference with a different amount or destination is 409 WITHDRAWAL_IDEMPOTENCY_CONFLICT.
When the institution refuses the Pix, the amount goes back to the customer's balance and the withdrawal is rejected with balance_restored: true. An outcome the institution has not confirmed yet stays pending, with the amount reserved from the balance, until it is confirmed either way.
Refusals, with named codes: withdrawals not enabled for your organization yet (422 WITHDRAWALS_NOT_ENABLED); the balance does not cover the amount (422 WITHDRAWAL_INSUFFICIENT_BALANCE); no account ready to pay this customer (422 WITHDRAWAL_ACCOUNT_NOT_AVAILABLE, the reason in details); the balance is moving to the customer's own account (409 WITHDRAWAL_BALANCE_IN_TRANSIT, retry once it arrives); the institution refused it (502 WITHDRAWAL_DISPATCH_FAILED, nothing left and the balance is restored); the institution did not confirm it (502 WITHDRAWAL_OUTCOME_UNCONFIRMED: the amount stays reserved until the outcome is confirmed; read GET /withdrawals/{withdrawal_id} before retrying). When it cannot be created right now the answer is 503 WITHDRAWAL_UNAVAILABLE: retry with the same reference.
Request
- Base URLhttps://developers.ozav.io/v2
- Auth
- API key in header X-API-Key
- or HTTP bearer
Request body
Example request
{
"amount": {
"value": "100.00"
}
}Response
The same withdrawal already existed (same reference).
Example response
{
"id": "ozav_wdr_01J00000000000000000000000",
"amount": {
"value": "100.00"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.