Initial API to create a check order from your site/app or backend environment. Create a new order post-checkout from your e-commerce website or app.
Body request data
| Key | Uses |
|---|---|
| api_key (required) | your api key given after registration |
| order_id (optional) | order_id is the reference of the order/transaction from your platform |
| amount (required) | the amount to be paid by the user/client |
| code (required) (int) | for swahilies purposes default :104 |
| api (required) (int) | for swahilies purposes default:170 |
| cancel_url (optional) | page to redirect when user cancel payment process |
| webhook_url (optional) | callback to send response when your successfully makes the payment |
| success_url (optional) | page to redirect when user successfully makes the payment |
| metadata | this is a key-value array that user can pass and use the data for future reference they will be returned in the webhook or reconciliation |
| is_live (optional) | is_live is boolen put false, for testing purpose to simulate trancation and get callback |
| username | name to appear to the user after payment completed e.g "payment has done to Swahilies INC" |
Here are a few examples:
import requests
url = "https://swahiliesapi.invict.site/Api"
payload = "{
"api":170,
"code":104,
"data":{
"api_key":"csdheruvhhjdhvjadmvjehrve",
"order_id":"sdvhdvdvjhv",
"amount":50000,
"username":"company name",
"is_live" :false,
"phone_number":255783262616,
"cancel_url":"wwww.yoursite.com/cancel",
"webhook_url":"www.yoursite.com/response",
"success_url":www.yoursite.com/success",
"metadata":{
"anykey":"anyvalue",
"another_anyKey":
"another_anyvalue"
},
"username":"busine name",
"is_live" : false
}
}"
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
The above command returns JSON structured like this:
| Code | Message |
|---|---|
| 200 | Success |
| 300 | Error |
Note
The page you should redirect for user to make payment is in the ( payment_url )
{
"code":200,
"payment_url":"https://swahiliespay.invict.site/make-payment-1.html?order="+order.order_id
}
