Create check out order complete card

Initial API to create a card 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

KeyUses
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
metadataThis 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
usernameName to appear to the user after payment completed e.g "payment has done to Swahilies INC"
first_nameFirst name of the billing person
last_nameLast name of the billing person
country_codeThe country code of the billing person
cityCity resident city of the billing person
addressAddress of the billing person

Here are a few examples:

import requests

url = "https://swahiliesapi.invict.site/Api"

payload = "{
    "api":170,
    "code":107, 
      "data":{
          "api_key":"your api key",
           "order_id":"sdvhdvdvjhv",
           "amount":50000,
           "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" : true,
           "first_name":"erick",
           "last_name":"Nyaluke",
           "country_code":"TZ",
           "city":"Dar es salaam",
           "address":"sinza b"
      }
   }"

headers = {}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

The above command returns JSON structured like this:

CodeMessage
200Success
300Error

🚧

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
}