Introduction Last updated: 17-03-2023

This document is intended to provide a guide for third parties who want to use the Orchard platform for various transactional services.

Overview

The appsNmobile Orchard API is built around Representational State Transfer (i.e. REST). Our APIs accept only JSON-encoded requests and return JSON-encoded responses, while using standard HTTP verbs and a combination of standard HTTP and custom response codes.

Developer integration to Orchard begins with a Test Mode access, where only a limited number (up to 10) of Mobile Money numbers or last four digits of card numbers are whitelisted for integration testing purposes. This means that any number that is not whitelisted on the Orchard platform cannot be used for testing by the developer.

Prerequisite

Any external service provider who needs access to the Orchard Platform must, first of all, complete all necessary merchant/client on-boarding requirements. The following processes apply to you:

  1. Client On-Boarding Documentation
  2. Client Due Diligence
  3. Technical API Integration
  4. Compliance User Acceptance Testing of Client Platform
  5. Training on use of Client Portal (Optional)
  6. Client Go-live
Client On-Boarding Documentation:
  • Signing of Non-Disclosure Agreement (NDA)
  • Product Service Description
  • AML Questionnaire
  • ID of Directors
  • Company Incorporation Certificates
  • Company Profile from Registrar General’s Department
API Integration Steps:
  • Whitelisting of Static Public IP(s) of server of client
  • Creation of Client Portal Login Access
  • API integration begins
  • Conduct compliance UAT on client’s service
  • Migrate client access to production mode
Client Portal:

Access to our Client Portal is given to you upon a successful completion of the on-boarding procedures. Integration to the Orchard API must first start with your access to the Client Portal, after which you will find the API integration keys on the dashboard of the portal.

Note: Testing of payout transactions will require a prior funding of your Orchard payout account.
Similarly, testing of airtime top-up transactions will require a prior funding of your Orchard airtime account

Connection Procedure


"URL": "https://orchard-api.anmgw.com/{endpoint}"
"Method": POST
"Data format": JSON
"Content Type": application/json

Authentication

The Orchard API uses a pair of keys, i.e. client key and secret key, to perform a Hash-based Message Authentication Code (HMAC) validation of all client requests. The API access keys are located inside the Client Portal. By default, test mode API keys are migrated to the production mode upon completion of integration. These API keys can, however, be changed upon request by the client.


"BODY": "JSON DATA"
"CLIENT_ID": client-key
"CLIENT_SECRET": secret-key
"SIGNATURE": HMAC(sha256, JSON PAYLOAD, CLIENT_SECRET)
"HEADER": Authorization: CLIENT_ID:SIGNATURE

HEADER EXAMPLE
Authorization:"YMMTCfHPFx8hjxg5sdB7aRS98l3ykPzjiNCAr3qJ9NktvyP1jljL9Nfab9VKZn5Q+nBgrgnyVVdCQ==:78fa43ced1aa58a4d721dcf002759c5ccf6e73d2e87fc8a22ff9504af2d50ae0"
  • Generate a hex-encoded hash value, referred to as signature in this document, by running the JSON-encoded payload, which constitute the body of the request, through your preferred programming language’s HMAC function, using sha-256 hashing algorithm
  • The signature and the client key are stored in the HTTP Authorization header, which is part of the HTTP specification.This is done by adding the signature to the end of the client key, with a colon as the separator, and then assigning the resulting string to the HTTP Authorization header

API Details

How to send funds to or receive funds from a customer
This API, when implemented, allows funds to be taken from or sent to a customer’s mobile money wallet, card, or bank account.
Please note that it is currently not possible on Orchard to debit a customer’s bank account; the bank account can, however, be credited.

Balance Inquiry

Use this to retrieve information about the current balance on your Orchard account

The different types of accounts available to you are:

  • Collections
  • Payout

The table below presents the list of parameters that must be used in forming a Check Wallet Balance request to Orchard.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account.
Your service ID is available on the dashboard of the Client Portal
4 Integer M
trans_type Transaction type
Possible list of values:
BLC – Balance Check
3 String M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
19 String M

Sample Request

// Your cURL sample request code
curl https://orchard-api.anmgw.com/check_wallet_balance
-H 'Authorization: CLIENT_ID:SIGNATURE'
-H 'Content-Type: application/json'
-X POST
-d '{"service_id": abcd,"trans_type": "BLC", "ts":"2022-01-01 23:20:50"}'

Sample Response

// Your sample response code
{
	"sms_bal": 56,
	"payout_bal": 3.72,
	"billpay_bal": 4.4,
	"available_collect_bal": 359.765,
	"airtime_bal": 30.9,
	"actual_collect_bal": 359.765
}
		

Transaction Status Check

Use this feature to query an existing transaction from Orchard in order to know the status of that transaction. This feature is useful in cases where you did not receive the transaction status from Orchard via your callback url for a certain payment request.

The table below presents the list of parameters that must be used in forming a Transaction Status Check request to Orchard.

Fields Description Length Example Datatype
exttrid Unique identifier for an existing transaction from you that had already been sent to Orchard for processing. 20 4243846303 String
service_id Represents the ID assigned to your service account 4 Integer
trans_type Type of transaction request
List of possible values:
TSC – Transaction Status Check
3 TSC String

Sample Request

// Your cURL sample request code
curl https://orchard-api.anmgw.com/checkTransaction
-H 'Authorization: CLIENT_ID:SIGNATURE'
-H 'Content-Type: application/json'
-X POST
-d '{"exttrid":"031059294635","trans_type": "TSC", "service_id": abcd}'

Sample Response

// Your sample response code
{
	"trans_status": "000/01",
	"trans_ref": "031059294635",
	"trans_id": "21870173572",
	"message": "SUCCESSFUL"
}
		

SMS API

Use this API to send SMS from the Orchard platform

The table below presents the list of parameters that must be used in forming a Send SMS request to Orchard.

Fields Description Length Datatype O/M
recipient_number Mobile number of the recipient of the message.
Note: Ensure country code is added to the mobile number
20 String M
msg_body This represents the content of the message to be delivered to the customer.
Note: A message length exceeding 160 characters will be considered multiple pages for the SMS and, hence, will attract multiple billing.
160 String M
unique_id Unique identifier for the SMS request from you
This must be unique for each sms request you perform.
Use this id to track the sms record on the Orchard platform
20 String M
sender_id When message is delivered into a subcriber's handset message inbox, sender_id is the label/sender name showing on top of the sms (i.e. alias/identifier)) 9 String M
trans_type Transaction type
List of possible values:
SMS - Text message
3 String M
msg_type Type of message to be sent to customer
List of possible values:
T - Text message
F - Flash message
1 String O
service_id Represents the ID assigned to your service account.
Your service ID is available on the dashboard of the Client Portal
4 Integer M
alert_type The alert type as recognized by the Orchard platform. Default value is B 1 String O
Sample Resquest
curl https://orchard-api.anmgw.com/sendSms
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"msg_body": "Your one-time password is 72755","msg_type": "T","recipient_number": "233XXXXXXXXX","sender_id": "NTC","service_id": "XX","trans_type": "SMS","unique_id": "6528738478597202"}'

Sample Response
{
  "resp_desc":"Message successfully queued for delivery",
  "resp_code":"082"
}

Debit/Credit Customer Wallet

This API, when called on a merchant platform allows clients to make or recieve payments for goods/services.

Steps involved in the payment process

Receiving money from customer:
  1. Customer performs activity on your platform’s customer interface
  2. Customer submits payment request from your platform’s customer interface
  3. Your platform receives request and forwards it to Orchard, after initial validation of request at your end
  4. Orchard performs further validation on request and submits it to the appropriate network for processing
  5. Processing network validates request
  6. Customer receives USSD PIN authorization prompt
  7. Customer confirms and authorizes payment
  8. Fund is deducted from customer’s wallet/account by the network
  9. Customer receives alert from network for the fund deduction
  10. Network sends transaction status to Orchard
  11. Orchard forwards transaction status to you via your callback url
  12. A customized alert with details about the payment from your side is sent to customer
Sending money to customer:
  1. Validate customer mobile money or bank account number
  2. Payment is initiated from your platform to Orchard
  3. Orchard receives and performs validation on payment request from you
  4. Orchard checks the current balance in your account on Orchard
  5. Payment request is forwarded to the network processor
  6. Network performs validation
  7. Money is sent to customer’s mobile money wallet or bank account
  8. Customer receives an alert from network
  9. Network sends transaction status to Orchard
  10. Orchard forwards transaction status to you via your callback url
  11. A customized alert with details about the payment from your side is sent to customer

The table below represents the list of parameters that must be used in forming a Payment Request to Orchard.

Fields Description Length Datatype O/M
customer_number This represents the mobile money wallet, bank account number, or card number depending on the type of transaction being performed and network specified 20 String M
amount This represents the amount involved in the transaction. 6,2 Float M
exttrid Unique identifier for the transaction from you.
This must be unique for each payment request you perform. Use this id to track the transaction on the Orchard platform
20 String M
reference A description for the payment request from you. This will be displayed on the USSD authorization prompt to the customer, in the case of a debit request on the wallet of the customer. 25 String M
nw This represents the network of the customer.
List of possible values:
AIR - Airtel network
TIG - Tigo network
VOD - Vodafone network
MTN - MTN network
MAS - MasterCard
BNK - Bank
VIS - VISA
3 String M
bank_code This represents the code assigned to a bank as provided in bank_code 4 String M
NB: The parameter, bank_code, is mandatory if trans_type is MTC and nw is BNK
recipient_name This represents the name of the recipient involed in the payout 100 String M
NB: The parameter, recipient_name, is mandatory if trans_type is MTC and nw is BNK
trans_type This represents the type of transaction to be performed.
List of possible values:
MTC - Send money to customer’s mobile money wallet or bank account
CTM - Take money from customer’s mobile money wallet or card
AUD - Take money from customer’s mobile money wallet automatically. This is possible after customer has subscribed to this service
AII - Account Inquiry Information. Inquire about name on customer’s mobile money wallet or bank account.
3 String M
callback_url Information on the status of the payment request sent earlier from your platform to Orchard for processing will be sent back to you via the callback url.
This will help you to know whether the payment passed or failed (including reason for the failure)
300 String M
service_id Represents the ID assigned to your service account.
Your service ID is available on the dashboard of the Client Portal
4 Integer M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
19 String M
nickname This represents an alias that displays on the USSD authorization prompt for the customer.
This is mostly useful in the case of a debit request to a customer on the AirtelTigo Mobile Money networK
15 String O
Sample Request
curl https://orchard-api.anmgw.com/sendRequest
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"amount": "10.00","callback_url": "https://my.callback_url.com/payment/callback","customer_number": "0123456789","exttrid": "4243846988303","nw": "MTN","reference": "Test payment","service_id": "XYZ","trans_type": "CTM","ts": "2021-10-21 07:21:43"}'
	
Sample Response
{
    "resp_desc": "Request successfully received for processing",
    "resp_code": "015"
}

Account Information Inquiry

Retrieve the name on customer mobile money wallet or bank account using this feature

Fields Description Length Datatype O/M
customer_number This represents the customer's number you are perfoming the name lookup for. 20 String M
service_id Represents the ID assigned to your service account. Your service ID is available on the Client Portal Dashboard 4 Integer M
trans_type This represents the type of transaction to be performed.
AII should be used
3 String M
bank_code This represents the bank code for the customer number on which you are performing the account inquiry. Here is a list of available bank codes 3 String M
nw BNK must be used as the network type for any account inquiry operation on Orchard
nw - BNK
3 String M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
19 String M
exttrid A unique identifier for the transaction.This identifier must be unique for each account inquiry operation you perform 20 String M
Sample Request
curl https://orchard-api.anmgw.com/sendRequest
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"customer_number": "233200018204","exttrid": "48732659843934", "service_id": "abcd","nw": "BNK", "bank_code": "VOD", trans_type":"AII", "ts": "2021-10-21 07:21:43"}'
Sample Response
{
  "resp_code": "027",
  "resp_desc": "Request successfully completed",
  "name": "John Doe"
}

Ghana Card Verification

Use this api to perform a real time live verification of a person.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account.Your service ID is available on the Client Portal Dashboard 4 Integer M
trans_type Transaction type
Possible list of values:
AII – Account Information Inquiry
3 String M
id_num Your Ghana card id number 13 String M
id_type Default: GCA 3 String M
exttrid This must be a unique identifier for each Ghana card verification request you perform. 20 String M
image base64-encoded-live-photo String M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
19 String M
Sample Request
curl https://orchard-api.anmgw.com/verifyID
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"id_num": "GHA-xxxxxxxxx-x","id_type": "GCA","service_id": abcd,"exttrid": "xxxxxxxxxxxxxs","image": "base64-encoded-live-photo"}'
Sample Response
{
	"resp_code": "027",
	"resp_desc": "Request successfully completed",
	"data": {
		"name": "XXXXXX",
		"gender": "M",
		"verified": "true",
		"card_valid_start": "2022-01-01",
		"card_valid_end": "2028-01-02"
	}
}

Remittance

Use the remittance api to terminate payments from other countries into mobile money wallets or bank accounts of persons in Ghana. For this service to be made available, the Money Transfer Operator (MTO) must provide documentation/evidence of having been licensed in the originating country.

The table below presents the list of parameters that must be used in forming a remittance request to orchard.

Fields Description Length Datatype O/M
customer_number Receiving party account number. e.g. mobile money wallet or bank account number 20 String M
amount Amount received by receiving party 6,2 Float M
transf_amount This represents the amount the recipient will receive 10,2 Float M
exttrid Unique transaction identifier accompanying the transaction.
Use this value to trace that particular transaction on the Orchard platform
25 String M
reference A description for the payment request. 25 String M
nw Network code of the receiving party’s mobile network or bank:
AIR - AirtelTigo network
VOD - Vodafone network
MTN - MTN network
BNK - Bank
3 String M
NB:The parameter BNK is mandatory if nw is BANK
trans_type Type of transaction being performed. Value: RMT 3 String M
callback_url Information on the status of the payment request sent earlier from your platform to Orchard for processing will be sent back to you via the callback url. This will help you to know whether the transaction passed or failed (including reason for the failure) 300 String M
transf_purpose Purpose of fund transfer by sending party 25 String O
service_id Represents the ID assigned to your service account.
Your service ID is available on the Client Portal Dashboard
4 Integer M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
19 String M
sender_name This represents the sender's name involved in the fund transfer. 15 String M
recipient_name This represents the recipient's name involved in the fund transfer. 200 String M
sender_number This represents the sender's number involved in the fund transfer. 200 String M
recipient_address Receiving party contact address 9 String M
ctry_origin_code Three-letter ISO country code 3 String M
sender_gender Gender of sending party. 1 String M
recipient_gender This represents the recipient's gender involed in the fund transfer. 5 String M
transf_curr_code Three-letter ISO currency code 3 String M
Sample Request
curl https://orchard-api.anmgw.com/sendRequest
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"sender_name": "test","recipient_name": "tester","sender_number": "23359562354","recipient_address": "Box MD ABC, Accra","transf_amount": 1.0,"transf_purpose": "Remittance testing","exttrid": "1234567961717","nw": "VOD","trans_type": "RMT","callback_url": "/","ts": "2021-10-21 07:21:43","ctry_origin_code": "GBR","service_id": abcd,"sender_gender": "M","recipient_gender": "F","transf_curr_code": "GBP","customer_number": "233507333959","amount": 0.1}'
Sample Response
{
    "resp_desc": "Request successfully received for processing",
    "resp_code": "015"
}

Hosted Checkout (Indirect Integration)

Using this API gives you access to a user interface for Card and Mobile Money payment. With this, you do not have to worry about directly integrating to the Orchard platform in order to enable Mobile Money payment.

Additionally, Card payment is only available to those who can show a proof of PCIDSS compliance, a prerequisite for direct Card integration.

Implement this API in your application and be able to provide Mobile Money and/or Card payment to your customers without going through the complexity of direct integration to Orchard, including being free from the burden of adhering to strict Card processing compliance standards and costs.

The table below presents the list of parameters that must be used in forming a Hosted Checkout or Redirect URL request to Orchard.

Fields Description Length Datatype O/M
amount This represents the amount involved in the transaction 6,2 Float M
exttrid Unique identifier for the transaction from you.
This must be unique for each payment request you perform. Use this id to track the transaction on the Orchard platform
20 String M
reference A description for the payment request from you. This will be displayed on the USSD authorization prompt to the customer during the payment process 25 String M
callback_url Information on the status of the payment request sent earlier from your platform to Orchard for processing will be sent back to you via the callback url.
This will help you to know whether the payment passed or failed (including reason for the failure)
300 String M
service_id Represents the ID assigned to your service account.
Your service ID is available on the dashboard of the Client Portal
4 Integer M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
19 String M
nickname This represents an alias that displays on the USSD authorization prompt for the customer.
This is mostly useful in the case of a debit request to a customer on the AirtelTigo Mobile Money network
15 String O
landing_page Orchard redirects customer to this page upon payment completion.
Status of the payment is passed along with the call to your landing page.
With this status, you will know whether payment was successful or it failed.
Use your landing page to display information such as receipt details for a success payment, or payment failure information or whatever you may want to communicate to the customer.
300 String M
payment_mode Possible list of values:
CRD - Only display a Card payment form to customer
MOM - Only display a Mobile Money payment form to customer
CRM - Display both Mobile Money and Card payment form to customer. Customer will choose whether to pay with Mobile Money or with Card
3 String M
currency_code select currency code to display on the payment page.
Example: GHS, EUR, USD, etc.
Default: GHS
3 String O
currency_val Amount corresponding to the currency you have displayed on the page, if you specified a value for currency_code. 6,2 Float O

How It Works:
  1. Customer performs activity on your platform’s customer interface
  2. Customer submits payment request from your platform’s customer interface
  3. Your platform receives request and forwards it to Orchard, after initial validation of request at your end
  4. Orchard performs further validation on request and then displays payment interface to customer
  5. Customer makes the appropriate inputs on the payment form and submits
  6. Customer receives an OTP request for a quick validation
  7. Orchard forwards payment request to the payment processor selected by customer
  8. Payment processor performs further validation and proceeds to process request
  9. Fund is deducted from customer’s wallet/account by the network
  10. Customer receives alert from network for the fund deduction
  11. Network sends transaction status to Orchard
  12. Orchard forwards transaction status to you via your callback url
  13. Orchard redirects customer to your landing page
  14. A customized alert with details about the payment from your side is sent to customer
Sample Request
curl https://payments.anmgw.com/third_party_request
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"amount": "0.01","callback_url": "https://my.callback_url.com/payment/callback","exttrid": "4243846303","reference": "Test payment","service_id": abdc,"nickname": "sconty","landing_page" : "url","ts": "2021-10-21 07:21:43","payment_mode": "CRD","currency_code":"GHS","currency_val":"0.01"}'
	
Sample Response
{
  "resp_code": "000",
  "resp_desc": "Passed",
  "redirect_url": "https://payments.anmgw.com/payment_page?code=dG9rZW49NDM3MTkwMjIyMTMxNzk5OSZ0cmFuc19pZD02NDYxOTAyMjIxMzE3OTIxNjI2=="
}

Auto Debit

The auto debit service makes it possible to set recurring debit on a custome's mobile money wallet for subsequent automatic debiting of the wallet without any prior authorization from the mobile money wallet owner.

This is suitable for such services as loan repayment, hire purchase, insurance, among other services that require the customer to make repetitive payments at certain regular intervals/durations

How It Works

To enable recurring debit on a custome's wallet, the following operations must be performed:

i. Subscription

The subscription operation is used to initiate the process of activating recurring debit on a customer's wallet. It triggers an SMS containing the OTP to the customer. The customer would need an interface where the OTP would be entered for validation.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account. Your service ID is available on the dashboard of the Client Portal 4 Integer M
uniq_ref_id Unique identifier for the recurring debit subscription request from you. This must be unique for each customer subscription. Use this id to track and manage the activities relating to the customer's subscription 20 String M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
NB: Timezone must be set to UTC
19 String M
customer_number This represents the customer number that will receive the airtime top-up value. 20 String M
amount This represents the recurring amount to be deducted from the customer's wallet whenever the debit cycle is due 6,2 Float M
nw This represents the network of the customer.
List of possible values:
AIR - AT network
VOD - Vodafone network
MTN - MTN network
3 String M
cycle Frequency of the recurring debit. List of possible freq values
DLY - Daily
WKL - Weekly
MON - Monthly
3 String M
start_date Date and time on which the recurring debit for the subscription will commence on the customer's wallet 19 date M
end_date Date and time on which the recurring debit for the subscription should end on the customer's wallet.
If this value is not set, the recurring debit subscription of the customer will have no end.
19 date O
reference A description for the recurring debit subscription from you. This will show up in all transactions that take place afterwards. 25 String M
return_url Information on the status of the recurring debit subscription as well as all other operations are sent back to you via this return url.
This includes all successful recurring debits that subsequently happen on the customer's wallet.
300 String M
resumable Set this parameter if you want to make it possible for the customer to suspend the recurring debit operation on their wallet at any time. Customer can always resume the recurring debit operations again later.
This feature is optional and can be left out from the subscription request.
List of possible values:
Y - Yes
N - No
1 String O
cycle_skip With this option set, Orchard will skip any outstanding debits at the time the current schedule is due. This feature is optional and can be left out from the subscription request.
List of possible values:
Y - Yes
N - No
1 String O
operation The action to be performed on the recurring debit endpoint.
Possible value:
SUB - Subscribe to the service
3 String M
apply_penalty Amount to be applied upon default by customer:
Y - YES
N - NO
1 O
Sample Request
curl https://orchard-api.anmgw.com/autoDebit
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"service_id":service_id,"uniq_ref_id":"8901234567891","customer_number":"233595999364","amount":"0.10","nw":"MTN","cycle":"DLY","start_date":"2020-10-01","end_date":"2022-11-01","reference":"Auto Debit Test","return_url":"http://localhost/callback_response","resumable":"Y","cycle_skip":"Y","operation":"SUB","apply_penalty": "NO"}'
		

ii. OTP validation

Perform OTP validation by taking the unique authentication code sent to the customer and passing it to the Orchard auto Debit endpoint using the OTP operation. A successful OTP validation activates the subscription request. A status confirmation response is sent via the return url in the subscription request to your application.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account. Your service ID is available on the dashboard of the Client Portal 4 Integer M
uniq_ref_id Unique identifier for the recurring debit subscription request from you. This must be unique for each customer subscription. Use this id to track and manage the activities relating to the customer's subscription 20 String M
operation The action to be performed on the recurring debit endpoint.
Possible value:
OTP - Perform the recurring debit OTP validation
3 String M
Sample Request
curl https://orchard-api.anmgw.com/autoDebit
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"service_id":service_id,"uniq_ref_id":"8901234567891","operation":"OTP"}'
		

iii. Suspend

Put the recurring debit cycle on hold by executing this operation.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account. Your service ID is available on the dashboard of the Client Portal 4 Integer M
uniq_ref_id Unique identifier for the recurring debit subscription request from you. This must be unique for each customer subscription. Use this id to track and manage the activities relating to the customer's subscription 20 String M
operation The action to be performed on the recurring debit endpoint.
Possible value:
SUS - Suspend the service
3 String M
Sample Request
curl https://orchard-api.anmgw.com/autoDebit
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"service_id":service_id,"uniq_ref_id":"8901234567891","operation":"SUS"}'
		

iv. Resume

Re-enable the recurring debit cycle by executing this operation.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account. Your service ID is available on the dashboard of the Client Portal 4 Integer M
uniq_ref_id Unique identifier for the recurring debit subscription request from you. This must be unique for each customer subscription. Use this id to track and manage the activities relating to the customer's subscription 20 String M
operation The action to be performed on the recurring debit endpoint.
Possible value:
RES - Resume the service
3 String M
Sample Request
curl https://orchard-api.anmgw.com/autoDebit
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"service_id":service_id,"uniq_ref_id":"8901234567891","operation":"RES"}'
		

v. Cancel(CAN)

Cancel the recurring debit subscription. This operation is not reversible.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account. Your service ID is available on the dashboard of the Client Portal 4 Integer M
uniq_ref_id Unique identifier for the recurring debit subscription request from you. This must be unique for each customer subscription. Use this id to track and manage the activities relating to the customer's subscription 20 String M
operation The action to be performed on the recurring debit endpoint.
Possible value:
CAN - Cancel the service
3 String M
Sample Request
curl https://orchard-api.anmgw.com/autoDebit
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"service_id":service_id,"uniq_ref_id":"8901234567891","operation":"CAN"}'
		
vi. Status(STA)

Retrieve the status of the recurring debit subscription of the customer.

Fields Description Length Datatype O/M
service_id Represents the ID assigned to your service account. Your service ID is available on the dashboard of the Client Portal 4 Integer M
uniq_ref_id Unique identifier for the recurring debit subscription request from you. This must be unique for each customer subscription. Use this id to track and manage the activities relating to the customer's subscription 20 String M
operation The action to be performed on the recurring debit endpoint.
Possible value:
STA - Status of the service
3 String M
Sample Request
curl https://orchard-api.anmgw.com/autoDebit
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"service_id":service_id,"uniq_ref_id":"8901234567891","operation":"STA"}'
		
Sample Response
{
  profile:{
	"amount": "0.10",
	"callback_url": "http://localhost/callback_response",
	"cancel_date": "",
	"completed": false,
	"customer_number": "233595999364",
	"cycle": "Daily",
	"cycle_skip": "Y",
	"end_date": "2023-07-29 10:30:00",
	"nw": "MTN",
	"resumable": "Y",
	"service_id": service_id,
	"service_name": "Test service",
	"start_date": "2023-07-28 09:00:00",
	"status": "Suspended",
	"subscription_date": "2023-07-24 04:51:50",
	"uniq_ref_id": "8901234567891"
  	},
  transactions: [
	{
       	  "prev_schedule": "",
       	  "processing_id": "PR65565656",
       	  "trans_date": "2023-07-24 04:51:50",
       	  "trans_id": "226566565",
       	  "trans_msg": "SUCCESS",
       	  "trans_ref": "Auto Debit",
       	  "trans_status": "Active"
     }
  ]
}
								

Airtime Top Up

This API, when implemented, allows airtime to be sent to a customer for purposes of electronic airtime refill.

The table below presents the list of parameters that must be used in forming an Airtime top-up request to Orchard

Fields Description Length Datatype O/M
customer_number This represents the customer number that will receive the airtime top-up value. 20 String M
amount This represents the amount involved in the airtime top-up transaction.Minimum amount allowed is GHS 0.2 6,2 Float M
exttrid Unique identifier for the transaction from you.
This must be unique for each airtime top-up request you perform. Use this id to track the transaction on the Orchard platform
20 String M
reference A description for the top-request from you. 25 String M
nw This represents the network of the customer.
List of possible values:
AIR - AirtelTigo network
VOD - Vodafone network
MTN - MTN network
GLO - Glo network
3 String M
trans_type This represents the type of transaction to be performed.
List of possible values:
ATP - Airtime top-up
3 String M
callback_url Information on the status of the airtime top-up request sent earlier from your platform to Orchard for processing will be sent back to you via the callback url 300 String M
service_id Represents the ID assigned to your service account.
Your service ID is available on the dashboard of the Client Portal
4 Integer M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
19 String M
Sample Request
curl https://orchard-api.anmgw.com/sendRequest
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"amount": "10.00","callback_url": "https://my.callback_url.com/payment/callback","customer_number": "0123456789","exttrid": "4243846303","nw": "MTN","reference": "Test payment","service_id": "XYZ","trans_type": "ATP","ts": "2021-10-21 07:21:43"}'
To get the response below, check the callback_url you provided in forming your request
Sample Response
{
    "resp_desc": "Request successfully completed",
    "resp_code": "027"
}

Bill Payment

This API, when called on a merchant platform allows for payment of bills.

The table below presents the list of parameters that must be used in forming a bill_payment request to Orchard

Fields Description Example Datatype O/M
amount Amount to credit/debit, without currency and format. 100.0 Float M
exttrid Unique external transaction reference number. 4243846303 String M
nw This represents the network of the customer.
  1. GOT - GoTV
  2. GTM - GoTV Max
  3. DST - DSTv
  4. MPO - MTN Postpaid
  5. MPP - MTN Prepaid Data
  6. VPO - Vodafone Postpaid
  7. VPP - Vodafone Prepaid Data
  8. SFL - Surfline
  9. TLS - Telesol
  10. STT - Startimes
  11. ECG - ECG Postpaid
  12. VBB - Vodafone Broadband (ADSL)
  13. BXO - Box Office
  14. EPP - ECG Prepaid
  15. GHW - Ghana Water
  16. SCP - School Placement
  17. WRE - WAEC Result
String M
trans_type A description for the transaction type. BLP String M
callback_url The response to a request is sent back to the third-party platform via a callback url String M
service_id This represents the type of transaction to be performed. 3 Integer M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
2022-01-01 23:20:50 String M
account_number Smart card number 123456789012 String M
Sample Request
curl https://orchard-api.anmgw.com/sendRequest
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"amount": "10.00","callback_url": "https://my.callback_url.com/payment/callback","acount_number": "123456789012","exttrid": "4243846303","nw": "MPR","service_id": "XYZ","trans_type": "BLP","ts": "2022-10-21 07:21:43"}'
Sample Response
{
	"resp_desc": "Request successfully completed",
	"resp_code": "027"
}

GHIPSS Payment

This API, when called on a merchant platform allows for payment using a GHIPSS card.

The table below presents the list of parameters that must be used in forming a ghipss payment request to Orchard

Fields Description Datatype O/M
service_id Provided as part of API credentials to client. Integer M
amount This represents the amount involved in the airtime top-up transaction. Float M
exttrid Unique identifier for the transaction from you. String M
nw Network Type. String M
trans_type Transaction type String M
callback_url The response to a request is sent back to the third-party platform via a callback URL String M
ts Current timestamp at the time of sending the request.
Format: YYYY-MM-DD HH:MI:SS
Example: 2023-01-01 23:20:50
Note that Timezone must be set to UTC
String M
landing_page_url The final page where the customer performing the transaction would see String M
Sample Request
curl https://orchard-api.anmgw.com/sendRequest
-H  'Authorization: CLIENT_ID:SIGNATURE'
-H  'Content-Type: application/json'
-X  POST
-d  '{"amount": "10.00","callback_url": "https://my.callback_url.com/payment/callback","exttrid": "4243846303","nw": "MTN","service_id": "XYZ","trans_type": "CTM","landing_page" : "url","ts": "2021-10-21 07:21:43"}'
Sample Response
{
  "resp_code": "000",
  "form_url": "https://gigs-test.ghipss.com:7543/EcomPayment/RedirectAuthLink",
  "form_details": {
	  "MerID": "123",
	  "AcqID": "315",
	  "OrderID": "6582",
	  "MerRespURL": "https://appsnmobileagent.com:8215/return_resp",
	  "PurchaseAmt": "000100",
	  "PurchaseCurrency": 936,
	  "PurchaseCurrencyExponent": 2,
	  "CaptureFlag": "A",
	  "Signature": "IAANKxiU=",
	  "SignatureMethod": "SHA1",
	  "Version": "1.0.0"
	}
}

Callback Response from Orchard

Every payment request from you to Orchard will be followed by a transaction status response from Orchard back to you via the callback_url parameter provided in the original request from you.

Below is the list of parameters that constitute the callback response to your payment request, which is sent back to your platform.

Fields Description Length Example Datatype
trans_id This represents the unique transaction ID generated by the payment processing network for the transaction.
This is mostly same as the transaction reference customer receives, usually via SMS, from the network
40 98765432100 String
trans_ref This is the transaction reference identifier, same as the exttrid in your original request. 20 4243846303 Integer
trans_status This indicates the success or failure status of the payment.
The first three digits of this value must be used to determine whether the payment passed or failed
List of possible values:
000 - Success
001 - Failure
100 000/01 String
message The textual description of the trans_status code 400 Request successfully completed String
Sample Success Response
{
 "trans_id": "98765432100",
 "trans_ref": 4243846303,
 "trans_status": "000/01",
 "message": "SUCCESS"
}
									
								
Sample Failure Response
{
 "trans_id": "98765432100",
 "trans_ref": 4243846303,
 "trans_status": "001/02",
 "message": "FAILED"
}

WooCommerce

Orchard is also avaliable on woocommerce platform. Click on the button below to download the zip file..

Download

Terminologies

Terms Meaning
SMS Short Message Service
USSD Unstructured Supplementary Service Data
MSISDN Mobile Subscriber Integrated Services Digital Network Number (i.e. Mobile Number)
PIN Personal Identification Number
API Application Programming Interface
AM Airtel Money
N/A Not Applicable
Customer /Subscriber Active customer of the mobile operator registered for mobile money services
Wallet/Account A virtual account held by AM customer or Merchant which reflects cash in hand
JSON JavaScript Object Notation
HMAC Hash-based Message Authentication Code
CTM Customer To Merchant(Deposit)
ATP Airtime Top Up
BLP Bill Payment
REQ. TYPE Request Type
NW Network

Wallet Funding

This is the process for funding your Withdrawal/SMS/Airtime/Bill Payment wallet. The funds must be deposited into our ECOBANK or UBA settlement account or credited to our merchant number when you want to do any form of funding.

With bank transfers or cheques from different banks, it takes at least 24 hours for funds to reflect in our bank account. Kindly send the funds in good time in order to prevent total depletion of funds in your wallet before making a funding request

Name Details
MTN Merchant Number: 0245389988
Name: appsNmobile Solutions Limited
Ecobank Account Name: appsNmobile Settlement Account
Account Number: 1441002216437
Bank: Ecobank Ghana Limited
Branch: Madina
United Bank for Africa (UBA) Account Name: appsNmobile settlement account
Account Number: 00111305205580
Bank: United Bank for Africa
Branch: Head Office, Ridge

Bank Codes

Bank Code
REPUBLIC BANK RPB
ADB ADB
VODAFONE CASH VOD
ZEEPAY GHANA ZEE
ABSA BANK ABS
FNB FNB
CBG CBG
GHL BANK GHL
AIRTELTIGO MONEY AIR
UMB UMB
SERVICES INTEGRITY SAVINGS & LOANS SIS
FBN BANK FBN
UBA UBA
CAL BANK CAL
SG SGB
APEX BANK ARB
BANK OF GHANA BOG
OMNI BANK OMN
STANBIC BANK STB
FAB FAB
NIB NIB
G-MONEY GMO
BOA BOA
ECOBANK GHANA ECO
GT BANK GTB
MTN MOBILE MONEY MTN
FIDELITY BANK FIB
ZENITH BANK ZEB
STANDARD CHARTERED SCB
PBL PRB
ACCESS BANK ACB
GCB BANK GCB

In order to perform account/mobile number name lookup or fund termination to bank account operations, a bank code is required as part of the JSON payload for the request. Attached is the list of institutions and their corresponding code (i.e. bank_code) for the operation. You can downlaod the csv file here..

Download

Response Codes

Response Code Description Reason
100 You are not allowed to use this service IP not whitelisted
101 No Authorization header information Authorization header missing in request
102 Invalid tokens received Client or Secret key mismatch
103 Invalid signature Incorrect implementation of HMAC
006 Missing client service identifier Client service identifier missing in request
007 Missing client token in request Client token missing in request
008 Missing customer number in request Customer number missing in request
009 Invalid customer number Customer number not valid
010 Transaction request amount not provided Missing transaction amount in request
011 Invalid service identifier Invalid Service ID in request
012 No IP has been set up for this service
013 Request could not be successfully completed
014 Transaction network missing in request
015 Request successfully received for processing Payment in transist
016 Transaction reference not provided Missing Transaction reference in request
017 Transaction reference not provided Transaction reference missing in request
018 Unique transaction identifier missing in request Exttrid missing in request
019 Account for service does not exist Service account must be created by aNm
020 Request type not provided
021 Duplicate transaction request Exttrid for this transaction already exist
022 Invalid JSON format
023 Invalid timestamp in request
024 Payout mode undefined for service
025 External transaction id too long. Value must be 20 characters or less
026 Request parameters not complete Some paramters are missing in request
027 Request successfully completed
028 Transaction amount invalid
029 Invalid request network Network is invalid in request
030 Reversal transaction could not be queued
031 Reversal transaction successfully queued
032 Empty voucher code in request
033 Transaction not found
034 Rate not set for service Setup process for client incomplete
035 Invalid XML format
036 Request expired Timestamp Invalid
037 Vodafone voucher code not provided
038 Insufficient balance
039 Missing callback url in request
040 Network processor not assigned to service Setup process incomplete/td>
041 Transaction type not provided
042 Undefined service mode
043 Missing service mode for service
044 Service not open to this customer
045 Invalid callback URL provided
046 Amount must be validated with two decimal places
047 Amount must be validated with two decimal places
048 Missing card payment url
049 Top-up Session Identifier could not be generated
050 Customer number not provided
051 Unknown request Invalid endpoint
052 Transaction request network not provided
053 Missing timestamp in request
054 Client mode not set up
055 Service disabled
056 Airtime recipient network undefined
057 Card holder email required
058 Card expiry month required
059 Card expiry year required
060 Card holder name required
061 Card CVV required
062 Card number is required
063 Invalid card number provided in request
064 Insufficient airtime balance
065 Access tokens already generated for this service
066 Token generation failure
067 No record returned
068 Account name not provided in request
069 Account number not provided in request
070 Invalid token type
071 Missing user identifier in request
072 Transaction amount too low
073 Activity identifier required
074 Reference identifier required
075 Settlement destination not provided
076 Insufficient balance in sms account
077 Missing message sender identifier
078 Message sender identifier too long. Maximum length permitted is nine characters
079 SMS body is empty
080 Missing SMS body identifier
081 Missing SMS recipient number
082 Message successfully received for delivery SMS in transist
083 Resend request successfully completed
084 Transaction callback pending
085 External transaction identifier too long. Maximum length is 30
086 Insufficient balance in billpay account
087 SMS unique identifier too long. Maximum length is 40
088 Missing bank code in request
089 Undefined transaction type
090 Undefined transaction network
091 Undefined bank code in request