Skip to content
Documentation menu

By EcoCash

Merchant to Subscriber

Pay a customer directly from your merchant channel.

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

serviceType: MERCHTOSUBV2

Overview

Merchant to Subscriber sends money from a merchant channel to a customer wallet. Use it where you owe a customer rather than the other way round: a refund, a payout, a settlement.

How it works

  1. Your system sends a request with the subscriber number, the amount and your merchant channel code.
  2. EcoCash validates your credentials, the request body, the channel code and the subscriber number.
  3. On success the funds are credited to the subscriber wallet and the response is returned on the same call.
  4. A simulated SMS is sent to the subscriber, naming the merchant.

Getting started

Prerequisites

  • A developer account with sandbox credentials.
  • The subscriber number whitelisted and OTP-verified.
  • A merchant channel with code 800004 in sandbox.

Good to know

  • externalReference is numeric on this service, not a string. It is numeric in the response too.
  • The response returns senderName rather than senderNumber.
  • The response uses timeStamp with a capital S. Disburse Change uses timestamp.
  • All three are specific to this service. Handle them as documented rather than assuming the other services behave the same way.

Use cases

  • Refunding a customer who returned goods.
  • Paying out a marketplace seller.
  • Settling a claim or a rebate.

Request body

externalReference is numeric on this service — send 1787759154, not "1787759154". It comes back numeric too.

REQUEST JSON BODY
{
  "serviceType": "MERCHTOSUBV2",
  "externalReference": 1787759154,
  "amount": "170",
  "currency": "USD",
  "msisdn": "263777000000",
  "username": "epg-sandbox-user-v1",
  "password": "<encrypted>",
  "channelCode": "800004",
  "transferReference": "1749466335",
  "walletId": "12"
}

Request parameter definition

Request parameters for Merchant to Subscriber
NameDescriptionTypeSample value
serviceTypeSelects the service. Must be MERCHTOSUBV2.StringMERCHTOSUBV2
externalReferenceUnique reference generated by your system. Numeric on this service, not a string.Numeric1787759154
amountAmount to pay.String170
currencyISO 4217 currency code. USD or ZWG.StringUSD
msisdnThe subscriber receiving the funds. Must be whitelisted in sandbox.String263777000000
usernameYour channel API user.Stringepg-sandbox-user-v1
passwordYour API user password, encrypted.String<encrypted>
channelCodeThe code identifying your merchant channel. Must be 800004.String800004
transferReferenceYour own reference for the transfer. Free text.String1749466335
walletIdWallet type. 12 is the primary EcoCash wallet.String12

Response body

RESPONSE JSON BODY
{
  "serviceType": "MERCHTOSUBV2",
  "externalReference": 1787759154,
  "requestId": "7a144485-cf4e-4504-a191-c90e181b6e82",
  "transactionId": "CP260826.1752.T6347991",
  "status": "200",
  "statusMessage": "Success",
  "responseCode": "00",
  "responseMessage": "Response is successfully returned.",
  "senderName": "Test Merchant",
  "senderPostBalance": "95261.93",
  "receiverName": "Test Customer",
  "receiverNumber": "263777000000",
  "timeStamp": "2026-08-26T17:53:41.621Z",
  "amount": "170",
  "currency": "USD",
  "transferReference": "1749466335"
}

Response parameter definition

Response parameters for Merchant to Subscriber
NameDescriptionTypeSample value
serviceTypeThe service that ran.StringMERCHTOSUBV2
externalReferenceEchoed from the request. Numeric.Numeric1787759154
requestIdUnique identifier for this API call.UUID7a144485-cf4e-…
transactionIdEcoCash's identifier for the transaction.StringCP260826.1752.T6347991
statusHTTP status.String200
statusMessageOutcome in one word.StringSuccess
responseCodeOutcome code. 00 is success.String00
responseMessageOutcome in full.StringResponse is successfully returned.
senderNameThe merchant the funds came from. This service returns a name, not a number.StringTest Merchant
senderPostBalanceChannel balance after the transaction. Fixed value in sandbox.String95261.93
receiverNameName registered against the whitelisted number.StringTest Customer
receiverNumberThe subscriber who received the funds.String263777000000
timeStampWhen the transaction completed. Capital S on this service.String2026-08-26T17:53:41.621Z
amountAmount paid.String170
currencyCurrency.StringUSD
transferReferenceEchoed from the request.String1749466335

Error codes

Error codes this service returns
HTTPCodeCauseWhat to do
401SBX40100Client Id or Client Secret missing or wrong.Check both headers.
401TP40101Username or decrypted password does not match.Check the username and the encryption key.
400SBX40000Something is wrong with the request body. A missing field, an unrecognised serviceType, a malformed number, a non-positive amount or an unsupported currency.Read the message. It names the field.
400TP40288channelCode is not 800004.Use the channel code for this service.
400IC50103msisdn is not on your whitelist.Add and verify the number on the Test Numbers page.

Match on responseCode, not on the message text. Every code, with an example body, is on the Errors page.

Next steps

Testing

  • Run a successful transaction with a whitelisted number.
  • Run it again with a number that is not whitelisted and confirm IC50103.

Go live

Complete the cases above, then follow the steps on the Go Live page.