Prevail Group of Companies

PrevailPay Gateway

API Reference

One API for every Prevail SBU to take payments through ZB Smile&Pay. Start here for the concepts that apply everywhere, then pick a section for the routes themselves.

Base URL https://13-247-53-102.sslip.ioDev http://localhost:8080JSON only

Sections

Getting started

  1. 1. Get your key. Head office registers your SBU and hands you an X-SBU-Key. Send it on every payment request.
  2. 2. Initiate a payment. Hosted checkout for a redirect flow, or express checkout to keep customers in your own UI.
  3. 3. Wait for the result. We receive the gateway webhook and update the transaction; poll ?refresh=true if you need it sooner.
  4. 4. Fulfill on PAID. Never on PENDING — the customer may still abandon or fail.
Your first call
curl -X POST https://13-247-53-102.sslip.io/api/v1/payments/checkout/initiate \
  -H 'X-SBU-Key: sbu_your_key_here' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": 10.00,
    "currencyCode": "840",
    "itemName": "Invoice INV-1042",
    "returnUrl": "https://yourapp.example/payment/return"
  }'

Authentication

Two header-based keys, issued by head office. Send the right one for the route you are calling — there are no tokens or OAuth flows.

X-SBU-KeyIdentifies one SBU. Grants /api/v1/payments/** and that SBU's own /api/v1/reports/**. Rotatable at any time.
X-Admin-KeyHead office only. Grants /api/v1/admin/** (SBUs, keys, dashboard users) and group-wide reports.
(none)/api/v1/webhooks/** is unauthenticated — it is called by ZB Smile&Pay servers, not by you.

The Payment object

Every endpoint under Payments returns this shape. Fields that do not apply to a method are omitted rather than null.

FieldTypeDescription
orderReferencestringGateway-generated reference, format {SBUCODE}-{16 hex}. Use it for status checks, confirm and cancel.
sbuCodestringCode of the SBU that owns the transaction.
sbuReferencestringYour own invoice/order number, echoed back if you sent one.
paymentMethodenumINNBUCKS, ECOCASH, OMARI, SMILECASH, CARD, WALLETPLUS, ONEMONEY or HOSTED.
statusenumPENDING, AWAITING_CONFIRMATION, PAID, FAILED, CANCELED or UNKNOWN.
amountnumberTransaction amount.
currencyCodestring"840" = USD, "924" = ZWG.
itemNamestringItem name supplied at initiation.
gatewayReferencestringSmile&Pay's own transaction reference.
innbucksPaymentCodestringInnBucks only — code the customer enters in the InnBucks app.
innbucksDeepLinkstringInnBucks only — deep link that opens the app pre-filled with the code.
paymentUrlstringHosted checkout only — URL to redirect the customer to.
clientFeenumberFee charged to the customer, when reported by the gateway.
merchantFeenumberFee charged to the merchant, when reported by the gateway.
createdAtstringISO-8601 timestamp of creation.
completedAtstringISO-8601 timestamp of the final state, once reached.
gatewayResponseobjectRaw Smile&Pay response for anything not modelled above (e.g. 3DS HTML). Only on calls that hit the gateway.

Statuses & payment methods

Transaction statuses

PENDINGInitiated; awaiting customer action or gateway processing.
AWAITING_CONFIRMATIONOTP sent (Omari/SmileCash); waiting for the confirm call.
PAIDCompleted successfully — fulfill the order.
FAILEDPayment failed or was declined.
CANCELEDTransaction was canceled.
UNKNOWNGateway returned a status we could not map.

Payment methods

ECOCASHExpress — USSD push to the customer's phone. Needs walletNumber.
INNBUCKSExpress — returns a payment code and deep link for the InnBucks app.
OMARIExpress, two legs — OTP, then confirm. Needs walletNumber.
SMILECASHExpress, two legs — OTP, then confirm. Needs walletNumber.
CARDExpress — 3DS redirect HTML in gatewayResponse. Needs the card object.
WALLETPLUSHosted checkout only (preselectable).
ONEMONEYHosted checkout only (preselectable).
HOSTEDCustomer picks the method on the Smile&Pay page.

Currencies are ISO numeric codes sent as strings: "840" = USD, "924" = ZWG.

Errors

Errors use standard HTTP status codes with a JSON body. Anything from the upstream gateway is surfaced as 502 with the original response attached.

400Validation failure or bad input. Body: { error, message, details? }.
401Missing or invalid X-SBU-Key / X-Admin-Key.
404Unknown resource — including another SBU's orderReference, which is never leaked.
502Smile&Pay gateway error. Body includes gatewayStatus and the raw gatewayBody.
Generated from src/lib/api-docs.ts — update it alongside backend changes.