Skip to content

Interswitch

Provider ID: interswitch

Interswitch is one of Nigeria’s oldest and most widely used payment processors, common in enterprise and government. It accepts amounts in minor units (kobo), which Sanwo passes through without conversion.

Important: Interswitch requires a payItemId for every transaction. You get this from the Interswitch developer portal when you register a payment item.

Terminal window
npm i @sanwohq/interswitch
import { interswitch } from "@sanwohq/interswitch";
const provider = interswitch({
merchantCode: "MX_TEST_xxxxxxxxxxxx",
payItemID: "Default_Payable_MX_xxxxxxxxxxxx",
});

Both merchantCode and payItemID are required. Get them from the Interswitch Developer Console.

Interswitch uses minor units (kobo) natively. Sanwo passes values straight through.

You pass Interswitch receives Meaning
500000 500000 5,000.00 NGN (kobo)
100 100 1.00 NGN

NGN

NG

card, bank_transfer, ussd, qr

Pass these via sanwoProviderOptions on web/React, or as flat fields on Flutter and mobile SDKs.

Option Type Required Description
payItemId string Yes Payment item ID from Interswitch (set during provider init)
payItemName string No Display name for the payment item
siteRedirectUrl string No URL to redirect the customer after payment
mode string No "TEST" or "LIVE"
const result = await checkout({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
});

The merchantCode and payItemID are already set on the provider, so a basic checkout needs no extra options.

const result = await checkout({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
payItemName: "Premium Subscription",
siteRedirectUrl: "https://example.com/payment/complete",
},
});
import { interswitch } from "@sanwohq/interswitch";
const provider = interswitch({
merchantCode: "MX_TEST_xxxxxxxxxxxx",
payItemID: "Default_Payable_MX_xxxxxxxxxxxx",
mode: "TEST",
});

Set mode: "TEST" during development. Switch to mode: "LIVE" with your production credentials when deploying. Test credentials are available in the Interswitch Developer Console.

Use these credentials in test mode:

Field Value
Card Number 5060 9905 8000 0021 7499
Expiry Any future date
CVV 111
PIN 1234
OTP 123456