Get your API secret
Log in to the Star-Pay merchant dashboard provided by CBE and copy your API secret from the Settings → API Keys section.You will pass this value in the
x-api-secret header on every request.Use your sandbox API secret while testing. Switch to your production key only when you are ready to go live.
Create a payment order
Call A successful request returns HTTP Save the
POST /trdp/order with the customer’s details and the transaction amount. Star-Pay creates an order and returns a hosted payment_url to redirect the customer to.201 with the new order:order_id — you will need it to verify the payment later.Redirect the customer to the payment page
Take the After the customer completes or declines payment, Star-Pay redirects them back to your
payment_url from the response and redirect the customer’s browser to it. Star-Pay hosts the payment page where the customer enters their phone number and approves the USSD Push prompt.Node.js
redirectUrl. If you provided a callbackURL, Star-Pay also sends a POST request to that URL with the payment result.Verify payment status
Call A paid order returns:Check
POST /trdp/verify with the order_id to confirm the payment outcome. Use this endpoint when the customer returns to your site or as a fallback if your webhook does not arrive.data.status in your code before fulfilling the order:| Status | Meaning |
|---|---|
PAID | Payment completed — safe to fulfill |
PENDING | Customer has not yet completed payment |
FAILED | Payment was declined or timed out |
Next steps
Authentication
Learn how to rotate your API secret and manage credentials securely.
Webhooks
Set up real-time payment notifications with HMAC-SHA256 signature verification.
API Reference
Full endpoint documentation with all request fields and response schemas.
Testing
Use sandbox test numbers to simulate successful and failed payments.