Skip to main content

Check a Payment

Webhooks tell you when a payment finishes. Use these endpoints as a backup:

  • On your return page, if the webhook hasn't arrived yet.
  • For orders still pending after 30 minutes. Cancelled and expired payments don't send a webhook yet.
  • After downtime on your server, to catch up on payments you missed.

Get one payment​

Look up a payment by BillPay's ID or by your own order reference:

GET/api/v1/checkout/payments/{paymentId}
GET/api/v1/checkout/payments/by-reference/{merchantReference}
curl https://sandbox.api.billpay.et/api/v1/checkout/payments/by-reference/order-10231 \
-H "x-api-key: $BILLPAY_API_KEY"

The response is the same payment object you got when you created the payment, with two differences: checkoutUrl is null, and attempts lists each try the customer made. Read status: only CAPTURED means paid.

Response (shortened)
{
"statusCode": 200,
"message": "Payment fetched successfully",
"body": {
"id": "cae54780-b884-4253-829c-1069e1d41e3c",
"merchantReference": "order-10231",
"status": "CAPTURED",
"checkoutUrl": null,
"completedAt": "2026-10-31T17:27:15.005299Z",
"attempts": [
{
"id": "45e92faf-4565-48de-9d7b-9f134ceed4e4",
"attemptNo": 1,
"provider": "SANDBOX_WALLET",
"instrument": "TEST_WALLET",
"payerReference": "****4567",
"status": "SUCCEEDED",
"failureCode": null,
"failureReason": null,
"createdAt": "2026-10-31T17:25:02.380725Z",
"completedAt": "2026-10-31T17:27:15.005299Z"
}
]
},
"timestamp": "2026-10-31T17:52:55.077+00:00"
}

Both endpoints return 404 if the payment doesn't exist, or if it belongs to another merchant.

Node.js
async function getPaymentStatus(orderId) {
const res = await fetch(
`${process.env.BILLPAY_BASE_URL}/api/v1/checkout/payments/by-reference/${encodeURIComponent(orderId)}`,
{headers: {'x-api-key': process.env.BILLPAY_API_KEY}},
);

if (res.status === 404) return null;
const result = await res.json();
if (!res.ok) throw new Error(`BillPay ${result.statusCode}: ${result.message}`);

return result.body.status; // "CAPTURED", "EXPIRED", ...
}

List payments​

GET/api/v1/checkout/payments

Returns your payments, newest first.

Query parameters
statusstring
Only payments with this status, for example CAPTURED.
pageinteger
Page number, starting at 0.
sizeinteger
Payments per page. Default 20, at most 100.

Search payments​

GET/api/v1/checkout/payments/search

Find payments within a period of up to one year, with filters.

Query parameters
fromstringRequired
Start of the period, as an ISO 8601 date.
tostringRequired
End of the period. At most one year after from.
statusstring
Filter by status.
currencystring
Filter by currency.
providerstring
Filter by payment provider.
instrumentstring
Filter by payment instrument.
customerIdstring
Filter by customer.
minAmountnumber
Smallest amount.
maxAmountnumber
Largest amount.
sizeinteger
Results per page. Default 50, at most 100.
cursorstring
The nextCursor from the previous page.

Search pages with a cursor, not page numbers. The response has hasNext and nextCursor. While hasNext is true, send nextCursor back as cursor to get the next page. Search doesn't return a total count.

On the last page, hasNext is false and nextCursor is null.

tip

Search only returns payments created between from and to. To include your newest payments, set to to the current time.

Follow changes​

GET/api/v1/checkout/payments/changes

The change feed returns every payment whose status or refunded amount changed since your last call, oldest change first. It's a good safety net next to webhooks.

  1. Call it once without since. The response has a cursor.
  2. Save the cursor.
  3. Every few seconds, call it again with ?since=<cursor>. Handle the payments it returns, then save the new cursor. If hasMore is true, more changes are waiting, so call again right away.
Different names from search

The change feed uses cursor and hasMore. Payment search uses nextCursor and hasNext. Check which endpoint you're calling.