Skip to main content

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​

POST/api/v1/checkout/payments/{paymentId}/refunds
Headers
x-api-keystringRequired
Your API key.
Idempotency-KeystringRequired
For example refund-order-10231-1. See Idempotency.
Body
amountnumber
At least 0.01. Leave it out to refund everything that's still refundable.
reasonstring
Up to 255 characters. Shown in your statements.
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​

StatusReason
404The payment doesn't exist, or it belongs to another merchant.
409The same Idempotency-Key was sent with a different body.
422The payment was never captured, you asked for more than is still refundable, or your balance doesn't cover it.

Refund statuses​

StatusMeaningFinal
REQUESTEDBillPay received the refund.No
UNDER_REVIEWBillPay is checking it first. This applies to merchants on automatic settlement.No
APPROVEDApproved. The money is committed.No
PROCESSINGSent to the payment provider.No
COMPLETEDThe customer has the money back.Yes
FAILEDThe provider refused it. The money goes back to your balance.Yes
REJECTEDRefused at review.Yes
EXPIREDNo 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.

MethodPathReturns
GET/api/v1/checkout/refunds/{refundId}One refund.
GET/api/v1/checkout/payments/{paymentId}/refundsAll refunds of one payment, oldest first.
GET/api/v1/checkout/refundsAll your refunds, newest first, paged.

A refund doesn't change the payment's status. The payment stays CAPTURED, and its refunded amount goes up.