Follow a payout to completion
Track every payout with webhooks and polling, reconcile with the transaction list, and handle failures, returns and manual review.
Track every bank payout with webhooks and polling, reconcile payouts with the transaction list, and handle failures, returns and manual review.
Who it is for. Every business that reconciles bank payouts.
Status. Available.
Money example
completed, and your ledger shows -2,501.50 USD.transfer.status.returned arrives, a refund row appears, and the money is back in the account.failed, and Gravv refunds the amount and the fee.Before you start
Manage, then Configure, then Webhooks. The API has no route for this. The URL uses HTTPS, and your endpoint verifies X-Signature (and X-Signature-Next after a secret roll), an HMAC-SHA256 of the raw body with your full secret.reference (the webhook event_group_id) and the transaction_id from the transfer response.Find out what is required
You need nothing new. The status comes from the webhooks and the transaction.
Steps
1. Listen
For each delivery, do these steps:
event_id. Never deduplicate on X-Event-ID, because every event of one transfer shares it.Order events by the number after : in idempotency_key (<reference>:<sequence>). Ignore an event whose number is lower than one you already applied.
2. Map the status
Read event_data.status:
| Status | What it means |
|---|---|
pending | The payout is still moving. transfer_status names the internal step. Do not build logic on those names |
completed | The payee was paid |
failed with transfer_status failed or rejected | Final. Nothing was paid, and Gravv returns the amount and fee to the source |
failed with transfer_status manual_processing_required | Not final. A person is checking the payout, and the transaction stays pending. Do not send it again, because a later event may still say completed |
paused | The transfer is waiting for you. See Paused transfers |
returned | The payout came back after completed. The original transaction stays completed, and Gravv adds a new transfer_refund row |
3. Poll as a backup
A transaction's status is pending, paused, waiting_approval, completed or failed. An unknown id returns HTTP 400 transaction not found.
4. Reconcile
List completed bank payouts. Filters take comma-separated lists. The list has no date filter. The API sorts it newest first, so page until you pass your date, and stop on an empty page.
GET /v1/transactions/volume sums amounts. Filter it by transaction_type and status, or it mixes currencies and directions. GET /v1/transactions/export (export_format=csv, lower case) returns only the 10 newest matching rows as a base64 file. Use the list for more rows.
5. Catch missed webhooks
List deliveries that failed:
Each row has its own id. Use it with GET /v1/webhooks/event/{id} (attempts, payload and your endpoint's response) and GET /v1/webhooks/calls/{id} (each HTTP attempt). The row's event_id field holds the resource id, not the payload's event_id. To resend one delivery, send this request:
A resent delivery carries the same X-Signature headers as an automatic one, and X-Signature-Next as well while you roll a secret. It goes to the endpoint the event was queued for. Gravv refuses the resend if you deleted that endpoint.
What can go wrong
| What you see | Why | Fix |
|---|---|---|
transfer.status.failed with transfer_status manual_processing_required, transaction pending | A person must review it, because the bank's answer was unclear or the route is held | Do not refund your customer or send again. Wait, or contact support with the reference |
A new bank-held payout account, such as your first payout from it, stays pending for a while | The bank approves the payee for that paying account before it pays out. Gravv checks again every 5 minutes for the first hour, then every 15 minutes. | Wait. If the bank has not approved it within 72 hours, the transfer fails with transfer_status failed and Gravv refunds the amount and fee |
A transfer pending for days | The bank has not given a final answer. Gravv never fails a payout on time alone, and keeps checking it | Contact support with the reference if your customer is waiting |
transfer.status.returned days after completed | The receiving bank returned it, for example because the account is closed or the details are wrong | Contact the payee. If their bank reported changed details, Gravv blocks the payee until you save a new one |
transfer.status.failed, transfer_status failed | The bank refused the payout. Nothing was paid, and Gravv refunds the amount and fee | Fix the cause (often the payee's details) and send a new transfer |
| You receive the same event twice | Gravv delivers each event at least once | Deduplicate on event_id |
You dropped a completed event | You deduplicated on X-Event-ID | Deduplicate on the body's event_id |
| Events arrive out of order | Deliveries run in parallel | Use the number in idempotency_key |
| You cannot cancel a transfer | The API has no cancel route for transfers | Only a paused transfer ends on its own. Contact support for anything else |
| The transfer request itself returns a 5xx | The outcome is unknown | Before you send again, look the payout up. List the customer's newest transactions and match your client_reference |
400 create export writer: unknown export format: CSV | You sent the format in upper case | Send csv |
Webhooks you will receive
Gravv sends these events:
transfer.status.pending, several times.transfer.status.completed, transfer.status.failed or transfer.requires_information.transfer.status.returned.event_data.amount is a string with trailing zeros removed ("2500"). The event has no currency field. See Transfer events.
Testing in sandbox
In sandbox, Gravv checks unfinished payouts every minute. You cannot force a return or manual review. Use POST /v1/webhooks/event/send/{id} to send an event to your endpoint again.