Skip to main content
Use the verification endpoint to confirm whether a payment has been completed. This is useful when you need to check status on demand — for example, before fulfilling an order, or when you haven’t received a callback within the expected time window. Endpoint: POST /trdp/verify Base URL: https://starpayqa.starpayethiopia.com/v1/starpay-api

Request parameters

Headers

x-api-secret
string
required
Your merchant API secret key provided by CBE. See Authentication.

Body

orderId
string
required
The unique order identifier returned by POST /trdp/order when the order was created. Example: "5428255034"

Response

A successful request returns HTTP 201 with a PaymentVerificationResponse body.
{
  "status": "success",
  "timestamp": "2025-07-01T11:00:00.000Z",
  "message": "Payment verified successfully",
  "data": {
    "order_id": "5428255034",
    "status": "PAID",
    "amount": 1000,
    "currency": "ETB",
    "updated_at": "2025-07-01T10:45:22.000Z"
  }
}

Response fields

status
string
required
Top-level request status. Value: "success"
timestamp
string
required
ISO 8601 datetime of when the response was generated.
message
string
required
Human-readable result message.
data
object
required

Code examples

curl -X POST https://starpayqa.starpayethiopia.com/v1/starpay-api/trdp/verify \
  -H "Content-Type: application/json" \
  -H "x-api-secret: YOUR_SECRET" \
  -d '{
    "orderId": "5428255034"
  }'

Callbacks vs. verification

Star-Pay offers two ways to receive payment status updates:
MethodWhen to use
Webhook callbackPreferred for real-time updates. Star-Pay POSTs to your callbackURL immediately after a transaction.
Verification endpointUse as a fallback or for on-demand checks — for example, when a user returns to your site after paying.
If you don’t receive a callback within a few minutes of the expected payment time, poll this endpoint to retrieve the current status. Implement exponential back-off to avoid rate limiting.

Polling example

If you need to wait for a payment to complete, poll the verify endpoint with a delay between attempts:
JavaScript
async function waitForPayment(orderId, maxAttempts = 10, delayMs = 5000) {
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
    const response = await fetch(
      "https://starpayqa.starpayethiopia.com/v1/starpay-api/trdp/verify",
      {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "x-api-secret": process.env.STARPAY_API_SECRET,
        },
        body: JSON.stringify({ orderId }),
      }
    );

    const result = await response.json();
    const { status } = result.data;

    if (status === "PAID") return result.data;
    if (status === "FAILED") throw new Error("Payment failed");

    if (attempt < maxAttempts) {
      await new Promise((resolve) => setTimeout(resolve, delayMs * attempt));
    }
  }

  throw new Error("Payment verification timed out");
}
Do not fulfill orders based solely on a redirect back to your redirectUrl. Always verify payment status server-side using the verification endpoint or a signed webhook callback before granting access to goods or services.

Build docs developers (and LLMs) love