EcoCashPayment Gateway API Spec FINAL v5
EcoCashPayment Gateway API Spec FINAL v5
[SPECIFICATION DOCUMENT]
[Version: 5]
[Date: February 2022]
1
Spec Document
1.0 Introduction
The Pay-Online API allows third parties to integrate and charge Ecocash subscribers for services provided. The API allows you to do the
following:
1. Charge a subscriber for a Merchant Payment
2. Refund a subscriber
3. Query a transaction
NB: The API does not allow for automatic reversals. Any reversals are managed through the Ecocash call center. Subscriber information
is also not accessible through the API.
2.0 Authentication
HTTP Basic Authentication is used for every request. A username and password will be provided.
NB: The POST operations have been in this document as application/json. You can also use XML in the request body.
2
Spec Document
5.0 Charging a Subscriber
This is used to debit the subscriber’s EcoCash wallet and credit the specified Merchant.
Resource URI https://payonline.econet.co.zw/ecocashGateway-preprod/payment/v1/transactions/amount
HTTP Method POST
Operation Charge a subscriber
Response A JSON/XML representation of an amountTransaction object or ServiceError object.
NB: A different Resource URI for testing may be provided.
{ "clientCorrelator":"12-yt-344534454565",
"notifyUrl":"http://mysite.com/notifyURL",
"referenceCode":" REF-12345",
“tranType”,”MER”,
"endUserId":"263774222998",
“remarks”:”test remarks”,
"transactionOperationStatus":"Charged",
"paymentAmount":{
"charginginformation":{
"amount":25, "currency":"ZWL",
"description":"Paynow Online Payment"
},
"chargeMetaData":{
"channel":"WEB", "purchaseCategoryCode":"Online Payment",
"onBeHalfOf":"Paynow Topup"
}
},
"merchantCode":" 019919",
"merchantPin":"4827",
"merchantNumber":" 783361344",
“currencyCode”:”ZWL”,
“countryCode”:”ZW”,
“terminalID”:”TERM123456”,
3
Spec Document
Parameter Description
Parameter Name Description Optional/Mandatory
endUserId (string) Subscriber MSISDN. Mandatory
remarks (string) Transaction description Optional*
amount (decimal) Amount to be debited from EcoCash. Optional *
currency (string) currency identifier as defined in [ISO4217]. (“USD” or Optional *
“ZWL”)
referenceCode (string) Use this field to set your reference code. Mandatory
merchantCode (string) As provided from Ecocash Mandatory
merchantPin (string) As provided from Ecocash Mandatory
merchantNumber (string) As provided from Ecocash Mandatory
(string) Use this field to parse the original EcoCash reference of the
originalEcocashReference transaction to be reversed. This is mandatory for a Refund Optional
transaction
(string) Shows the status of the charge request. Possible values are:
CHARGED – the initial status of a charge request/transaction
COMPLETED – when transaction has been approved by the
transactionOperationStatus subscriber Mandatory
FAILED – when transaction has been rejected by the subscriber.
NB: A HTTP POST whose body is the amountTransaction is done to
the notifyUrl when this field changes to COMPLETED/FAILED.
(URI) URL used by the API to notify your application about
notifyUrl Mandatory
completion of a transaction.
channel (string) Set this field to WEB Mandatory
4
Spec Document
5
Spec Document
{
"clientCorrelator": "DPO-20220825-0044",
"referenceCode": "TEST-REF-0000056",
"endUserId": "263774222021",
"originalEcocashReference": "MP220825.1002.A00218",
"tranType": "REF",
"endUserId": "263774222021",
"remarks": "test Refund",
"paymentAmount": {
"charginginformation": {
"amount": 13,
"currency": "ZWL",
"description": "Paynow Online Payment"
},
"chargeMetaData": {
"channel": "SMS",
"purchaseCategoryCode": "SOAPUI test",
"onBeHalfOf": "developer"
}
},
"merchantCode": "019919",
"merchantPin": "4827",
"merchantNumber": "783361344",
6
Spec Document
"currencyCode": "ZWL",
"countryCode": "ZW",
"terminalID": "TERM123456",
"location": "1906 Borrowdale Road",
"superMerchantName": "CABS",
"merchantName": "Pick and Pay"
}
Parameter Description
Parameter Name Description Optional/Mandatory
endUserId (string) Subscriber MSISDN. Mandatory
remark (string) Transaction description Optional*
originalEcoCashReference (string) The EcoCash transaction reference to be reversed Mandatory
amount (decimal) Amount to be debited from EcoCash. Optional *
(URI) URL used by the API to notify your application about completion of
notifyUrl
a transaction.
channel (string) Set this field to WEB Optional
7
Spec Document
8
Spec Document
8.0 ServiceError
In addition to the usual HTTP Error codes, the gateway may respond with a json/xml ServiceError object. The text field of the ServiceError
gives a description of the exact error.
{
"messageId": "SVC0002",
"text": " Invalid input value for message part %1"
}