API Documentation

9th Swift Documentation

We help African businesses get paid by anyone, anywhere in the world — while giving them the tools to collect payments, access loans, and manage daily operations through a complete business banking solution.

9TH SWIFT STANDARD API CHECKOUT

9th Swift Logo

Welcome to the 9thSwift Payment Gateway API

The 9thSwift API provides a secure and reliable way to integrate payments, payouts, and bill payments into your applications.

All requests to the API must be authenticated and transmitted over HTTPS to ensure data integrity and security.

Base URL

bash
https://server.9thswift.com/api/v1

Authentication

To interact with the API, you need to include the following headers in your requests:

1. Authorization Header

  • Pass your secret key as a Bearer token.
  • Example: Authorization: Bearer your_secret_key

2. Encryption Header (HMAC Signature)

  • Required only for Payouts and Bill Payments.
  • Signatures are generated using HMAC-SHA512, applied to the request payload, and signed with your API key.
  • This ensures the request payload has not been altered during transmission.

Security Measures

Signature Authentication

  • Provides secure request validation.
  • Ensures both authenticity and integrity of your payload.

IP Whitelisting

  • As part of our firewall security, you must set your TEST and LIVE IPs on your dashboard before making requests.
  • Only whitelisted IPs will be allowed to access the API.

TRANSACTIONS

Standard Checkout

The Transactions API allows you to create and manage payments on your integration.

POST

INITIALIZE TRANSACTION

{{url}}/transaction/init

Initialize a transaction from your backend.

Endpoint: /transaction/init

Header
ParamTypeRequired?Description
authorizationstringYesSet value to Bearer SECRET_KEY
content-typestringYesSet value to application/json
Parameters
ParamTypeRequired?Description
amountnumberYesAmount you are debiting customer.
currencystringYesCurrency charge should be performed in. Allowed values are: NGN, USD or GBP. It defaults to your integration currency.
referencestringYesUnique case sensitive transaction reference. Only -,_,= and alphanumeric characters allowed.
callback_urlstringNoFunction that redirects user after payment completion.
Example Request
curl
curl --location -g '{{url}}/transaction/init' \
--data-raw '{
  "reference": "MCD-12345667",
  "amount": 3000,
  "currency": "NGN",
  "callback_url": "https://www.google.com",
  "customer": {
    "payerName": "John Doe",
    "email": "[email protected]",
    "phoneNumber": "09088563125"
  }
}'
Example Response
json200 OK
{
  "status": "success",
  "message": "Invoice created successfully",
  "data": {
    "statusCode": "00",
    "data": {
      "checkout": "https://staging.9thswift.com/mepvwkmf-SW-ESHI",
      "accessCode": "mepvwkmf-SW-EGoHJylSWS",
      "reference": "MCD-12345667"
    }
  }
}
POST

INITIALIZE REVENUE TRANSACTION

{{url}}/transaction/init-revenue-payment

This endpoint initializes a revenue payment transaction and creates an invoice for government revenue collection. Upon successful initialization, it returns a checkout URL where the payer can complete the payment.

Request Body Parameters
ParameterTypeRequiredDescription
referencestringYesUnique transaction reference identifier (e.g., "GLOB-KLLK9XCFGRGA"). Must be unique for each transaction.
amountnumberYesTransaction amount in the smallest currency unit (e.g., 200 for NGN 2.00 or ₦200 depending on implementation).
currencystringYesThree-letter ISO currency code (e.g., "NGN" for Nigerian Naira).
revenueCodestringYesGovernment revenue code identifier (e.g., "ENUG60123").
taxPayerNumberstringYesTax identification number of the payer (e.g., "2019873451").
callback_urlstringNoURL to redirect the user after payment completion.
Example Request
curl
curl --location -g '{{url}}/transaction/init-revenue-payment' \
--data-raw '{
  "reference": "GLOB-KLLK9XCFGRGA",
  "amount": 200,
  "currency": "NGN",
  "revenueCode": "ENUG60123",
  "taxPayerNumber": "2019873451",
  "callback_url": "https://www.google.com",
  "customer": {
    "payerName": "John Doe",
    "email": "[email protected]",
    "phoneNumber": "09088563125"
  }
}'
Example Response
json200 OK
{
  "status": "success",
  "message": "Invoice created successfully",
  "data": {
    "statusCode": "00",
    "data": {
      "checkout": "https://checkout.9thswift.com/MLNGP00V-SW-G-SHYPCJBW",
      "accessCode": "MLNGP00V-SW-G-SHYPCJBW",
      "reference": "GLOB-KLLK9XCFGRGA"
    }
  }
}

Usage Notes

  1. 1.
    Unique References: Always generate a unique reference for each transaction to avoid conflicts.
  2. 2.
    Amount Format: Verify the amount format with your implementation - confirm whether amounts are in kobo/cents or the base currency unit.
  3. 3.
    Revenue Codes: Ensure you have the correct revenue code from the government authority before initiating transactions.
  4. 4.
    Callback URL: The callback URL must be publicly accessible to receive payment status webhooks.
  5. 5.
    Checkout Flow: After receiving the response, redirect the customer to the checkout URL to complete payment.
  6. 6.
    Transaction Tracking: Store the accessCode and reference for transaction verification and reconciliation.

Best Practices

  • Validate all customer information before submitting the request
  • Implement proper error handling for failed initialization attempts
  • Use HTTPS for callback URLs to ensure secure webhook delivery
  • Log transaction references for audit trails and customer support
  • Consider implementing idempotency checks using the reference field
GET

VERIFY TRANSACTION

{{url}}/transaction/verify/:reference

The Transactions API allows you to verify payments on your integration.

Endpoint: /transaction/verify/:reference

Method: GET

Path Variables
ParamTypeRequired?Description
referencestringYesPayment reference id
Header
ParamTypeRequired?Description
authorizationstringYesSet value to Bearer SECRET_KEY
content-typestringYesSet value to application/json
Example Request
curl
curl --location -g '{{url}}/transaction/verify/MCD-00345667'
Example Response
json200 OK
{
  "status": "success",
  "message": "Invoice verified successfully",
  "data": {
    "statusCode": "00",
    "data": {
      "reference": "MCD-00345667",
      "status": "success",
      "amount": 307.5,
      "settledAmount": 300,
      "feeCharged": 7.5,
      "currency": "NGN",
      "channel": "card",
      "customerEmail": "[email protected]"
    }
  }
}

PAYOUT

POST

ADD PAYOUT RECIPIENT

{{url}}/transaction/add-payout-recipient

The API allows you to create recipient for payout.

Add payout Recipient

Note: after successful creation, this end point will return a 'recipientCode' which will be part of the payload when requesting for a payout

Endpoint: /transaction/add-payout-recipient

Method: POST

Header
ParamTypeRequired?Description
authorizationstringYesSet value to Bearer SECRET_KEY
content-typestringYesSet value to application/json
Parameters
ParamTypeRequired?Description
typestringYesRecipient type (e.g., "nuban")
namestringYesRecipient name
accountNumberstringYesBank account number
bankCodestringYesBank code
bankNamestringYesBank name
currencystringYesCurrency charge should be performed in. Allowed values are: NGN, USD or GBP. It defaults to your integration currency.
Example Request
curl
curl --location -g '{{url}}/transaction/add-payout-recipient' \
--data '{
  "type": "nuban",
  "name": "Oloyede Chizorom",
  "accountNumber": "8104656733",
  "bankCode": "305",
  "bankName": "PAYCOM (OPAY)",
  "currency": "NGN"
}'
Example Response
json200 OK
{
  "status": "success",
  "message": "Invoice created successfully",
  "data": {
    "statusCode": "00",
    "data": {
      "recipientCode": "SW-JTEQBHESCV-RECIPIENT"
    }
  }
}
POST

INITIATE PAYOUT

{{url}}/transaction/init-payout

The API allows you to create recipient for payout.

Add payout Recipient

Note: after successful creation, this end point will return a 'recipientCode' which will be part of the payload when requesting for a payout

Endpoint: /transaction/add-payout-recipient

Method: POST

Header
ParamTypeRequired?Description
authorizationstringYesSet value to Bearer SECRET_KEY
content-typestringYesSet value to application/json
Parameters
ParamTypeRequired?Description
sourcestringYesPayout source (e.g., "wallet")
recipientCodestringYesRecipient code from payout recipient creation
reasonstringYesReason for payout
amountnumberYesPayout amount
referencestringYesUnique transaction reference
currencystringYesCurrency charge should be performed in. Allowed values are: NGN, USD or GBP. It defaults to your integration currency.
Example Request
curl
curl --location -g '{{url}}/transaction/init-payout' \
--data '{
  "source": "wallet",
  "recipientCode": "SW-JTEQBHESCV-RECIPIENT",
  "reason": "Vendor 2 withdwal",
  "amount": 500,
  "reference": "UIOUV-980L980",
  "currency": "NGN"
}'
Example Response
json200 OK
{
  "status": "success",
  "message": "Transfer successfully logged and Processing",
  "data": {
    "statusCode": "00"
  }
}

BANK

GET

GET BANKS LIST

{{url}}/config/bank-list

AUTHORIZATION Bearer Token
Token{{SECRET-KEY}}
Example Request
curl
curl --location -g '{{url}}/config/bank-list'
Example Response
json200 OK
{
  "status": "success",
  "message": "Bank list retrieved",
  "data": {
    "statusCode": "00",
    "currency": "NGN",
    "banks": [
      {
        "bankName": "7B FINANCE COMPANY LIMITED",
        "bankCode": "110072",
        "logoUrl": "https://cdn.buildwithcedar.com/356/3830/283b1ss.png"
      }
    ]
  }
}
POST

ACCOUNT NAME VERIFICATION

{{url}}/config/account-name-verify

AUTHORIZATION Bearer Token
Token{{SECRET-KEY}}

This endpoint allows you to verify account name and number for bank accounts.

WEBHOOKS

POST

WEBHOOK PAYLOAD TO EXPECT

your-web-hook-url

WEBHOOK PAYLOAD TO EXPECT

Endpoint: your-web-hook-url

Method: POST

The webhook service allows real-time communication of transaction notifications between your system and ours. you can receive transaction details promptly, enabling you to process them efficiently within your application.

Webhook URL

You can add you webhook url from your dashboard. Example :

https://api.yourdomain.com/webhook
Signature validation

Events sent from 9thSwift carries ApiKey header . The value of this header is your api key. Verifying the header signature should be done before processing the event. See code sample below

javascript
const apiKey = process.env.SECRET_KEY;
app.post('/my/webhook/url', function(req, res) {
  //validate event
  const signature = req.header('ApiKey').replace('ApiKey ', '');
  if (!signature || (signature !== apiKey)) {
    throw new Error('Webhook notification not from 9th Swift');
  }
  
  // Retrieve the request's body
  const event = req.body;
  // Do something with event
});
Example Request
curl
curl --location 'your-web-hook-url' \
--data-raw '{
  "id": "67ec7641416a8374c865a167",
  "type": "payment.success",
  "created": "2025-09-03T10:40:18.742+00:00",
  "data": {
    "reference": "MFNRCBW0-SW-AFHJTTSA-M",
    "status": "success",
    "amount": 1025,
    "settledAmount": 1000,
    "chargedFee": 25
  }
}'
Body raw (text)
json
{
  "id": "67ec7641416a8374c865a167",
  "type": "payment.success",
  "created": "2025-09-03T10:40:18.742+00:00",
  "data": {
    "reference": "MFNRCBW0-SW-AFHJTTSA-M",
    "status": "success",
    "amount": 1025,
    "settledAmount": 1000,
    "chargedFee": 25
  }
}

EventType

EventTypeDescription
payment.successSuccessful Transaction for all channels
payment.failedFailed Transaction for channels
payment.pendingPending Transaction for all channels
transfer.successSuccessful Payout Transfer
transfer.failedFailed Payout Transfer
refund.processedProcessing Refund

Here are some points to take notes

  1. 1.Add the webhook URL on your 9thSwift dashboard
  2. 2.Ensure your webhook URL is publicly available (localhost URLs cannot receive events)
  3. 3.Test your webhook to ensure you're getting the JSON body and returning a 200 OK HTTP response
  4. 4.If your webhook function has long-running tasks, you should first acknowledge receiving the webhook by returning a 200 OK before proceeding with the long-running tasks
  5. 5.If we don't get a 200 OK HTTP response from your webhooks, we flagged it as a failed attempt
  6. 6.If we are unable to deliver webhook to you, there is an api to re call failed webhook notification.

WALLET

GET

GET WALLET BALANCE

{{url}}/wallet/wallet-balance

Verify Payment

The Transactions API allows you to verify payments on your integration

Endpoint: /transaction/verify/:reference

Method: GET

AUTHORIZATION Bearer Token
Token{{BUSINESS-SECRET-KEY}}
Parameter
ParamTypeRequired?Description
referencestringYesPayment refrence id
Example Request
curl
curl --location -g '{{url}}/wallet/wallet-balance'
Example Response
json200 OK
{
  "status": "success",
  "message": "Wallet balance retrieved successfully",
  "data": {
    "statusCode": "00"
  }
}

RESPONSE DATA ENUMS

Payment Status

TypeDescription
successTransaction successful
pendingTransaction still pending
FailedTransaction failed
abandonedExpired invoice
refundedRefund was processed

Payment Channel

TypeDescription
cardCard Transaction
transferVirtual account transfer Transaction
ussdUSSD bank Transaction

Payment Currency

TypeDescription
NGNNigeria Naira
USDUnited state of america dollar
GBPGreat britsh pounds