<aside> 🍩 Summary To accept payment with Zilla, create an order using our API. Every transaction includes a link that can be used to complete payment and redirect the user back to your preferred webpage.
</aside>
Here's the Zilla API to accept a payment. Start by creating an order with this endpoint.
<aside>
🔑 ${baseUrl}/bnpl/purchase-order POST
</aside>
curl --location --request POST '${baseUrl}/bnpl/purchase-order'
-H "Authorization: Bearer TOKEN"
-H "Content-Type: application/json"
--data-raw '{
"amount": "10000.00",
"clientOrderReference": "",
"title": "Uber ride for Maduekwe Chibuike",
"productCategory": "Transport",
"type": "ONE_OFF",
"reusableCount": "",
"customerHandle": "",
"redirectUrl": "<https://zilla.africa>"
}'
After an order has been created successfully:
paymentLink
to complete the payment using Zilla.orderCode
is also generated that is bound to the just created order and can be used for further reference the order.Here's a sample of the response body with a payment link for your customer:
{
"message": "Success",
"errorCode": null,
"data": {
"id": "891930a3-529b-478b-88b8-5aa803e89612",
"createdAt": "2021-11-10T14:57:34.374857Z",
"merchantOutletId": "a308b306-4a14-438d-828f-aee67a00fd63",
"amount": 5000,
"clientOrderReference": "JZTY5676UI",
"title": "Ride",
"productCategory": "Transport",
"type": "ONE_OFF",
"reusableCount": 0,
"usedCount": 0,
"status": "PENDING",
"customerHandle": null,
"customerId": null,
"redirectUrl": "<https://zilla.africa>",
"orderSource": "PROGRAMMATIC",
"createdByPrincipalId": "fcd11593-a436-4add-a082-3f26b3a788e1",
"completedAt": null,
"orderCode": "11111111LL",
"paymentLink": "<https://checkout-webapp-dev.zilla.africa/payment-order/11111111LL>"
},
"meta": null
}