API reference
DashboardTry itGet Sandbox keys

API reference

Every Devbox service is one POST to /transactions/initiate. Name the service with its handle, send its fields in payload, and read the same envelope back, whichever service you call.

Base URL
https://api.devbox.africa/api/v1
Endpoint
POST /transactions/initiate
Authentication
X-Api-Key header
Format
JSON over HTTPS

Services

17 handles, grouped by what they do

Quickstart#

From a new product to a working Sandbox request. Two steps happen in your dashboard, one on your server.

  1. Dashboard · ServicesEnable a service

    Add it to your product and fill in its configuration.

  2. Dashboard · API keysCreate an API key

    Scope it to the services you need. You'll see it once.

  3. Your serverSend your first request

    This section's request, with your key. It uses Sandbox test values, so it passes validation.

Authentication#

Create a key on your product's API Keys page and send it in the X-Api-Key header with every request.

Belongs to
One product, and one environment
Can call
Only the services you scope it to
Shown
Once, when you create it
Expires
After 1 to 365 days, or never
Revoke
Any time, from the product's API Keys page

Keep keys on your server. Never put them in browser code, mobile apps, source control or logs.

Environments#

Every API key belongs to one environment. Don't send Live traffic with a Sandbox key, or test with a Live one.

Sandbox

Test requests without processing real transactions. Requests are checked against allow-listed test values.

Limited Live

Live transactions within limits. Ask for it from your product's Go live page in the dashboard.

Full Go Live

Compliance approves your go-live request and your product's limits are removed.

Initiate a transaction#

Starts any operation. The service handle picks it; the payload carries its fields.

POSThttps://api.devbox.africa/api/v1/transactions/initiate

Headers

FieldDescription
X-Api-KeystringRequiredAPI key for the environment you are calling.
Content-TypestringRequiredAlways application/json.
Acceptstringapplication/json.

Body

FieldDescription
servicestringRequiredHandle of the operation to run, such as wallet_debit. One of the 17 below.
payloadobjectRequiredThat service's fields. Include a unique reference wherever the service takes one.

Responses#

Every service answers with the same envelope. What's specific to the operation is in data.

FieldDescription
codestringResult code. "00" means the operation succeeded.
messagestringReadable summary of the result.
systemCodestringPlatform code for the result, such as I000 or E400. Useful when you contact support.
systemMessagestringExtra detail about the result, when there is any.
dataobject or nullThe operation's output. null when the request failed.

Errors#

The HTTP status tells you whether the request got through; code and message tell you what happened to the operation.

  • DoUse a unique reference for every operation.
  • DoRetry only transient failures, with exponential backoff.
  • Don'tRetry validation or authentication errors automatically.
  • Don'tLog API keys or sensitive customer data.

Services#

Set service to one of these handles and send its fields in payload. Each sample uses Sandbox test values.

Mobile money and bank

Collect and pay out

Mobile money and bank

Wallet debit

wallet_debit#

Collects money from a mobile money wallet.

Payload fieldIn the Sandbox sample
referencestring"YOUR_UNIQUE_REFERENCE"
msisdnstring"0241234567"
networkstring"MTN"
amountnumber1
narrationstring"Wallet debit"
Mobile money and bank

Wallet credit

wallet_credit#

Pays money out to a mobile money wallet.

Payload fieldIn the Sandbox sample
referencestring"YOUR_UNIQUE_REFERENCE"
msisdnstring"0241234567"
networkstring"MTN"
amountnumber1
narrationstring"Wallet credit"
Mobile money and bank

Account debit

account_debit#

Collects money from a bank account.

Payload fieldIn the Sandbox sample
accountstring"0012345678"
shortnamestring"GCB"
amountnumber1
narrationstring"Account debit"
Mobile money and bank

Account credit

account_credit#

Pays money out to a bank account.

Payload fieldIn the Sandbox sample
accountstring"0012345678"
shortnamestring"GCB"
amountnumber1
narrationstring"Account credit"

Checkout and links

Get paid without building a form

Checkout and links

Manilla

manilla#

Takes a payment through Manilla, the hosted checkout.

Payload fieldIn the Sandbox sample
referencestring"YOUR_UNIQUE_REFERENCE"
msisdnstring"0241234567"
networkstring"MTN"
amountnumber1
narrationstring"Manilla payment"
paymentMethodstring"momo"

Airtime and bills

Airtime, power, water and TV

Airtime and bills

Airtime top-up

airtime_topup#

Airtime for a phone number. Takes the same payload as airtime_purchase.

Payload fieldIn the Sandbox sample
msisdnstring"0241234567"
networkstring"MTN"
amountnumber1
narrationstring"Airtime purchase"
Airtime and bills

Airtime purchase

airtime_purchase#

Airtime for a phone number. Takes the same payload as airtime_topup.

Payload fieldIn the Sandbox sample
msisdnstring"0241234567"
networkstring"MTN"
amountnumber1
narrationstring"Airtime purchase"
Airtime and bills

ECG prepaid

ecg#

Buys ECG prepaid electricity for a meter number.

Payload fieldIn the Sandbox sample
customerNumberstring"54321098765"
isMonthlybooleanfalse
amountnumber10
Airtime and bills

GWCL water bill

gwcl#

Pays a Ghana Water bill for a customer number.

Payload fieldIn the Sandbox sample
customerNumberstring"GW123456789"
isMonthlybooleanfalse
amountnumber10
Airtime and bills

DStv subscription

dstv_purchase#

Pays for a DStv subscription on a smartcard number.

Payload fieldIn the Sandbox sample
customerNumberstring"7025123456"
isMonthlybooleantrue
amountnumber10
Airtime and bills

GOtv subscription

gotv_purchase#

Pays for a GOtv subscription on a customer number.

Payload fieldIn the Sandbox sample
customerNumberstring"2012345678"
isMonthlybooleantrue
amountnumber10

Messages and menus

SMS and USSD

Messages and menus

SMS (single)

sms_single#

Sends one message to one phone number.

Payload fieldIn the Sandbox sample
recipientstring"0241234567"
senderstring"DevBox"
messagestring"Hello from the DevBox Sandbox"
Messages and menus

SMS (bulk)

sms_bulk#

Sends one message to many phone numbers.

Payload fieldIn the Sandbox sample
recipientsarray of strings["0241234567","0551234567"]
senderstring"DevBox"
messagestring"Hello from the DevBox Sandbox"
Messages and menus

SMS (scheduled)

sms_scheduled#

Sends one message to many phone numbers at the time in runAt.

Payload fieldIn the Sandbox sample
recipientsarray of strings["0241234567","0551234567"]
senderstring"DevBox"
messagestring"Hello from the DevBox Sandbox"
runAtstring"YYYY-MM-DDTHH:mm:ss"
Messages and menus

USSD

ussd#

Starts a USSD session with a phone number.

Payload fieldIn the Sandbox sample
msisdnstring"0241234567"
referencestring"YOUR_UNIQUE_REFERENCE"
narrationstring"USSD session"

Verify

Before you pay

Verify

Name validation

name_validation#

Looks up the name on a mobile money wallet before you pay it.

Payload fieldIn the Sandbox sample
accountNumberstring"0241234567"
networkstring"MTN"

Something here unclear or out of date? Tell us.

Try it#

Send a real Sandbox request from this page. Paste a Sandbox key, pick a service and send. The key stays in this page and is never written to browser storage.

POST/transactions/initiateSandbox only
Response
Send the request to see the status and the response here.