Pay Bill

This feature enables business owners create a link that is tied to a transaction that can then be shared for a customer to make a one-time payment with.

This feature is best used for uses cases around reservations, invoices, paying bills, and any other use case that requires a link to be generated that is tied to a customer a certain transaction details. E.g a customer calls a restaurant to place an order, the restaurant system sends an API request with the order amount and the customer's details. A link is generated that is then shared to the customer via sms/chat. When the customer pays, the restautant's system is notified by either webhook, or by the redirect url provided.

To get started, you need to have your integration credentials Getting Integration Credentials.

You can try out the API call here Create Bill

Sample Request

{
  "merchantCode": "MX6072",
  "payableCode": "9405967",
  "amount": "5000",
  "redirectUrl": "https://webpay-ui.k8.isw.la/demo-response",
  "customerId": "[email protected]",
  "currencyCode": "566",
  "customerEmail": "[email protected]"
}
Field NameData TypeRequiredDescription
merchantCodeStringtrueThe Merchant's code
payableCodeStringtrueThe merchant's payment item/payable code
amountInttrueCost of the item you want your customer to pay in minor
redirectUrlStringtrueURL you want our gateway to redirect to when customer has completed transaction
customerIdStringtrueThe unique ID of the customer on merchant's system
currencyCodeInttrueISO currency code e.g Naira is 566
customerEmailStringfalseEmail Address of Customer
transactionReferenceStringfalseTransaction Reference of the transaction from the merchant's system

Sample Response

{
  "id": 21067,
  "merchantCode": "MX6072",
  "payableCode": "9405967",
  "amount": 5000,
  "code": "200",
  "redirectUrl": "https://webpay-ui.k8.isw.la/demo-response",
  "customerId": "[email protected]",
  "reference": "3WuIKFZFvGWra4e",
  "customerEmail": "[email protected]",
  "currencyCode": "566",
  "paymentUrl": "https://project-x-merchant.k8.isw.la/paymentgateway/paybill/3WuIKFZFvGWra4e"
}
Field NameData TypeDescription
idLongID of the created bill
payableCodeStringThe merchant's payment item/payable code
amountIntCost of the item you want your customer to pay in minor
paymentUrlStringURL of the created bill to be shared to customer to click and pay
referenceStringUnique reference on our system tied to the bill
redirectUrlStringURL you want our gateway to redirect to when customer has completed transaction
customerIdStringThe unique ID of the customer on merchant's system
currencyCodeIntISO currency code e.g Naira is 566
customerEmailStringEmail Address of Customer

🚧

How to know when a customer has paid

We redirect the customer back to the redirectUrl provided in the payment request. But you can also integrate to Webhooks so we notify you instantly any payment is made into the account

Confirming Transaction Status

When using the redirect to confirm a transaction, you MUST make a server-side request to get the transaction status and amount that was paid before giving value. You make the request using your merchantCode, the relevant transaction reference and amount. Please confirm the amount returned by our server matches your original transaction amount before giving value.

Sample Request

curl https://qa.interswitchng.com/collections/api/v1/gettransaction.json?merchantcode={merchantcode}&transactionreference={reference}&amount={amount} 
# LIVE BASE URL: https://webpay.interswitchng.com
-H "Content-Type: application/json" \
-X GET

👍

Response Codes

You can view the list of response codes and their meaning here.

📘

Test Cards

Click here to get test cards to test your transactions.