Refunds
You can refund a CAPTURED payment in full or in part. You can refund the same payment several times, up to what the customer paid.
Refunds are paid from your BillPay balance. If your available balance can't cover a refund, BillPay refuses it.
Request a refund
refund-order-10231-1. See Idempotency.0.01. Leave it out to refund everything that's still refundable.curl https://sandbox.api.billpay.et/api/v1/checkout/payments/3f8a2c1e-6b4d-4e9a-8c2f-1a7d5e9b0c34/refunds \
-H "x-api-key: $BILLPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: refund-order-10231-1" \
-d '{
"amount": 250.00,
"reason": "One item out of stock"
}'
BillPay answers 202 Accepted with the message Refund requested successfully.
The refund starts as REQUESTED, or as UNDER_REVIEW
if BillPay checks it first. A 202 means BillPay received the refund, not
that the money has reached the customer yet. Follow its status below.
Errors
| Status | Reason |
|---|---|
404 | The payment doesn't exist, or it belongs to another merchant. |
409 | The same Idempotency-Key was sent with a different body. |
422 | The payment was never captured, you asked for more than is still refundable, or your balance doesn't cover it. |
Refund statuses
| Status | Meaning | Final |
|---|---|---|
| REQUESTED | BillPay received the refund. | No |
| UNDER_REVIEW | BillPay is checking it first. This applies to merchants on automatic settlement. | No |
| APPROVED | Approved. The money is committed. | No |
| PROCESSING | Sent to the payment provider. | No |
| COMPLETED | The customer has the money back. | Yes |
| FAILED | The provider refused it. The money goes back to your balance. | Yes |
| REJECTED | Refused at review. | Yes |
| EXPIRED | No decision within 7 days. | Yes |
Follow a refund
Only a COMPLETED refund sends a webhook, PaymentRefunded.
To find out whether a refund failed, was rejected, or expired, check its
status.
| Method | Path | Returns |
|---|---|---|
GET | /api/v1/checkout/refunds/{refundId} | One refund. |
GET | /api/v1/checkout/payments/{paymentId}/refunds | All refunds of one payment, oldest first. |
GET | /api/v1/checkout/refunds | All your refunds, newest first, paged. |
A refund doesn't change the payment's status. The payment stays
CAPTURED, and its refunded amount goes up.