Collection/Purchase
Step 1 - Initiate
This API method is utilized to trigger a collection/purchase request, resulting in a JSON response being returned to you.
POST
{base url}/api/v1/purchases/
Headers
Authorization*
Bearer {{secret key}}
Content-Type*
String
application/json
The transaction ID in JSON response is then used to execute request(Step 2) to initiate a PIN prompt on the Subscriber's mobile handset to be debited.
Step 2 - Execute
You have two methods to execute the transaction
Redirect the customer to the {{checkout_url}} provided in the response from step 1 on the Paytota platform. Take note the following parameters should be added to your Initial JSON body on using this method
success_redirect
,failure_redirect
After the payment is processed, the system will redirect the customer back to your website.Alternatively, you can initiate a PIN prompt on the subscriber handset by sending a form-data request through your backend system. Following a successful execution, you will receive asynchronous status update via webhook. The notification will have the status 'pending_execute'.
Using the transaction ID received in Step 1, this method is then queried by sending a form-data request to initiate a PIN prompt on the subscriber handset.
POST
{base url}/p/{id}/
Headers
Content-Type*
String
multipart/form-data
Request Body
Phone*
String
256751123456
pm*
String
Should be airtel or mtnmomo
You will receive a callback on your webhook URL regarding the status of the transaction
Check Collection/Purchase Status
This method is used to query the collections/purchases transaction status using the transaction ID. Please note that this API also requires authorization using the Secret Key.
GET
{base url}/api/v1/purchases/{id}/
Headers
Content-Type*
String
application/json
Authorization*
String
Bearer {{secret key}}
Last updated