Using the Service
Recommended integration flow from your backend to checkout and then fulfillment.
- Create the order in your own system (status
pending). - Call
POST /paymentwithX-Tenant-ID,X-APIKEY, and order/payment data. - Store returned
paymentIdandredirectUrlagainst your order. - Return
redirectUrlto frontend and redirect user to provider checkout. - User is redirected to your success/cancel pages after payment action.
- Your
/payment/webhookendpoint receives updates and finalizes order fulfilment.
Create Payment Example
POST /payment
Content-Type: application/json
X-Tenant-ID: TENANT_ABC
X-APIKEY: TENANT_API_KEY
{
"orderId": "order-1001",
"amount": 199.99,
"currency": "ZAR",
"userId": 42,
"successUrl": "https://your-app.com/payment/success",
"cancelUrl": "https://your-app.com/payment/cancel"
}
{
"data": {
"paymentId": 321,
"redirectUrl": "https://provider-checkout-url"
},
"provider": "paystack"
}