Refunds
Flowlix supports full refunds on any payment that has thesucceeded status. When you refund a payment, the full amount is returned to the customer’s card.
How refunds work
- Refunds are full only — the entire payment amount is returned.
- A payment can only be refunded once.
- The payment status changes from
succeededtorefunded. - The
refunded_atfield is set to the Unix timestamp of the refund. - Refunds are processed synchronously — the response confirms the refund immediately.
Create a refund
Send aPOST request to /v1/payments/{id}/refund:
Successful response
Error scenarios
Payment already refunded
If you try to refund a payment that is already refunded:422 Unprocessable Entity
Payment not found
If the payment ID does not exist:404 Not Found
Payment not in succeeded status
Onlysucceeded payments can be refunded. If you try to refund a pending or failed payment:
422 Unprocessable Entity
Integration example
Checking refund status
You can check whether a payment has been refunded by retrieving it:status and refunded_at fields in the response:
"status": "refunded"— the payment has been refunded."refunded_at": 1719878400— the Unix timestamp when the refund was processed.
Best practices
- Always use an
Idempotency-Keywhen refunding to prevent duplicate refunds on retries. - Use a deterministic key tied to the refund operation (e.g.,
refund-order-{order_id}). - Check the payment status first if you want to show a preview to the user before confirming.
- Log the
request_idfrom refund responses for audit and support purposes. - Handle the “already refunded” case gracefully — treat it as a success in your UI, not an error.