Skip to content
Documentation menu

By EcoCash

Getting Started

Learn how to set up and integrate EcoCash APIs into your application and start moving money today.

Introduction

Welcome to the EcoCash APIs. EcoCash moves money for millions of people in Zimbabwe. These APIs open that same capability to your product: collecting payments, paying money out, and reconciling what you have sent.

In this release we provide endpoints for collections, bulk disbursement, change disbursement, merchant payouts and transaction lookup. The APIs are RESTful, using POST with JSON-encoded request parameters and responses, including errors.

Our APIs comply with HTTP status codes as defined in RFC 2616. You can call them from a REST client such as Postman, or from the command line with cURL.

Every transaction in the sandbox is simulated. No real money moves.

Terminologies

Terms used across the EcoCash API documentation
TermMeaning
EcoCashA mobile money service in Zimbabwe for storing and transferring money by mobile phone.
MSISDNA customer's mobile number. Accepted as 263XXXXXXXXX or 07XXXXXXXX and normalised automatically.
serviceTypeThe field in the request body that selects which service runs. All four EPG services share one endpoint, so this field is what distinguishes them.
Client credentialsA client Id and client secret, sent as headers. They identify and authorize your application.
Channel API userA username and encrypted password, sent in the request body. It identifies the channel making the transaction.
channelCodeThe code identifying the channel a transaction is sent from. Each service validates its own.
externalReferenceA reference your own system generates for each transaction. You use it later to look the transaction up.
walletIdThe wallet type funds are moved into. 12 is the primary EcoCash wallet.
WhitelistThe list of customer numbers your sandbox account may send funds or notifications to.
API ConsoleThe in-portal console where you send requests and see responses without writing code.
Test scriptThe record of your API Console calls. The portal writes it as you test, and it is required to request production access.
EPGEcoCash Payment Gateway. It sits behind the production APIs.

Base URL

Sandbox

https://developers.ecocash.co.zw/api/serviceRequest

Enterprise Cash-In, Disburse Change, Merchant to Subscriber and Transaction Lookup all post to this one endpoint. The serviceType field in the request body decides which service runs. There are no separate paths to configure.

Online Payments uses its own endpoints, documented on its own page.

Your production endpoints are sent to you when your go-live request is approved.

Service types

The serviceType value for each sandbox service
ServiceserviceType
Enterprise Cash-InENTERPRISECASHINV2
Disburse ChangeCHANGEDISBURSEV2
Merchant to SubscriberMERCHTOSUBV2
Transaction LookupEXTERNALTRANSACTIONLOOKUP

Your credentials

Create a developer account and request sandbox access. Five values are issued to you.

The five sandbox credential values and how each is issued
FieldWhere you get it
X-Client-IdReturned immediately when you request sandbox access
X-Client-SecretSent to your developer inbox
usernameReturned immediately. Your channel API user
passwordSent to your developer inbox. Always sent encrypted, never in clear
Encryption keySent to your developer inbox. Used to encrypt the password

Full detail is on the Authorization page.

Channel codes

Each service validates its own channel code. Any other value returns TP40288.

The channel code each service validates
ServicechannelCode
Enterprise Cash-In700002
Disburse Change800002
Merchant to Subscriber800004
Transaction Lookupnot used

Test numbers

Any customer number you send funds or a notification to must be whitelisted against your account first. You whitelist and verify numbers inside the portal.

Nothing is deducted from a whitelisted number, and no real money moves. A number that is not on your whitelist returns IC50103.

externalReference

  • Must be unique per transaction.
  • Used to look the transaction up afterwards.
  • Reusing a reference returns the existing transaction rather than creating a new one.

The services are idempotent on this field. If a request times out and you do not know whether it went through, send it again with the same reference. You get the original transaction back, not a second one.

No PIN

The four EPG services have no PIN. The transaction completes on the API call alone, with no customer confirmation step.

Online Payments does simulate a PIN prompt. See its page for the test PIN matrix.

Going live

After testing in the sandbox you are ready for production. You will need a registered EcoCash merchant account and a completed test script. See the Go Live page.