HTTP - Intouchpay - Api - Ver 1.2
HTTP - Intouchpay - Api - Ver 1.2
1. API FUNCTIONS
The IntouchPay payments gateway provides application programming interfaces (APIs) for third-party
applications (App for short) to connect to it and use its payments processing capability to send and
receive payments. The App is generally developed by various partners of theIntouchpay gateway.
Sending Payment The App (functioning as the client) invokes the RequestDeposit • RequestDeposit
API to initiate a deposit request to a subscriber on Intouchpay
(functioning as the server).
Type Description
Mandatory A parameter is always mandatory in a request.
Parameters with the Mandatory requirement are used for access authentication or
service processing. If a parameter with the Mandatory requirement is left empty in a
request, access authentication or service processing fails and the request fails.
Conditional A parameter is mandatory or optional in specified conditions.
Parameters with the Conditional requirement are used for access authentication or
service processing in specified conditions. If the specified conditions is met but a
parameter with the Conditional requirement is left empty in a request, access
authentication or service processing fails and the request fails.
Optional A parameter is always optional.
Parameters with the Optional requirement are not used for service processing.
2.1. Function
The App (functioning as the client) invokes the RequestPayment API to initiate a payment request to a
subscriber on Intouchpay (functioning as the server).
The intouchpay gateway will then respond with a pending status to the App awaiting for subscriber
confirmation of the transaction. After confirmation the Intouchpay gateway will invoke the App on the App
transaction status url with the status of the transaction.
Partners must code the App based on the API field requirements so that the App can send correct
requests to IntouchPay. Intouchpay sends a response within 60 seconds by default.
Request Payment
Request Payment
3
2.2. Request URI
The request URI is the destination URI of the requestpaymentrequest sent by the App to the
IntouchPay to enable a payment request to be sent to the subscriber. The URI is provided by
Intouchpay in the following format:
http://IP:Port/api/requestpayment/
In the format, IP and Port indicate the service IP address and port number of the API provided by
the Intouchpay. Contact carriers to obtain the IP address and port number.
2.3. Request
The App functions as the client and sends a requestpaymentmessage to intouchpayto enable a
payment request to be sent to the subscriber.
data={
'username':'bob',
'timestamp':'20161231115242',
'amount':100,
'password': 'd3cfd05492a2376003f5af9e2e6643b67',
'mobilephone': 250785971082,
’requesttransactionid’:34555
}
response=requests.post('https://www.intouchpay.co.rw/api/requestpayment/', data=data)
Example in Python
password = hashlib.sha256(username+accountno+partnerpassword+timestamp).hexdigest()
4
2.6. RECEIVING PAYMENT RESPONSE
The intouchpay gateway will respond with a json response as below and an HTTP response 200 OK.
{
'status': 'Pending',
'requesttransactionid': '4522233',
'success': True,
'responsecode': '1000',
'transactionid': 1425,
'message': 'Transaction Pending'
}
The intouchpaygateway acts as a client and Invokes the App by sending it the status of the
pending transaction via an HTTP post. Which can either be successfull or failed. Partners are
required to provide an end point url to which the intouchpay gateway will submit the request.
data = {
'requesttransactionid':''4522233',
'transactionid':'6004994884',
'responsecode' :'01',
'status':'Successfull',
'statusdesc':'Successfully Processed Transaction',
'referenceno':'312333883'
}
r = requests.post(url, json={'jsonpayload':data},headers={'content-
type':"application/json"},verify=False)
or
r = requests.post(url,json={'jsonpayload':data},auth=(username, password),headers={'content-
type':"application/json"},verify=False)
5
2.8. COMPLETE RECEIVING PAYMENT REQUEST COMPLETION RESPONSE
The App will respond with an HTTP 200 OK response and the following parameters in json format
'message': 'success',
'success': True
,'request_id': '4522233'
}
Below is a table showing the response codes for the Receiving Payment response
6
3. SENDING PAYMENT REQUEST
3.1. Function
The App (functioning as the client) invokes the RequestDeposit API to initiate a deposit request to a
subscriber on Intouchpay (functioning as the server).
The intouchpay gateway will then attempt to perform the deposit transaction as per request, and will invoke
the App with the response of the deposit request status.
Partners must code the App based on the API field requirements so that the App can send correct
requests to IntouchPay. Intouchpay sends a response within 60 seconds by default.
Request Deposit
Request Deposit
The request URI is the destination URI of the requestdeposit request sent by the App to the
IntouchPay to enable a deposit transaction to be made to the subscriber. The URI is provided by
Intouchpay in the following format:
http://IP:Port/api/requestdeposit/
In the format, IP and Port indicate the service IP address and port number of the API provided by
the Intouchpay. Contact carriers to obtain the IP address and port number.
3.3. Request
The App functions as the client and sends a requestdepositmessage to intouchpay to enable a
deposit request to be sent to the subscriber.
data={
'username':'bob',
'timestamp':'20161231115242',
'amount':100,
"withdrawcharge": 1,
'password': 'd3cfd05492a2376003f5af9e2e6643b67',
'mobilephone': 250785971082,
’requesttransactionid’:34555,
}
response=requests.post('https://www.intouchpay.co.rw/api/requestdeposit/', data=data)
Example in Python
password = hashlib.sha256(username+accountno+partnerpassword+timestamp).hexdigest()
The intouchpay gateway will respond with a json response as below and an HTTP response 200 OK.
Success response:
"requesttransactionid":"1201",
"referenceid":"1123",
"responsecode":"2001",
"success": true
8
}
Failure response:
"requesttransactionid":"1201",
"success":false,
"responsecode":"xxxx"
*Note: referenceid is only returned as part of response if the requestdeposit request was successful
Below is a table showing the response codes for the Receiving Payment response
9
2108 Insufficient Funds on Source Account
2109 Daily Limit Exceeded
2110 Source Account Not Active
2111 Mobile Account Not Active
2100 General Failure
10
4. BALANCE INQUIRY
4.1. Function
The App (functioning as the client) invokes the GetBalance API to query account balance on Intouchpay
(functioning as the server).
The intouchpay gateway will then attempt to query the account balance as per request, and will invoke the
App with the response of the getbalance request status.
Partners must code the App based on the API field requirements so that the App can send correct
requests to IntouchPay. Intouchpay sends a response within 60 seconds by default.
The request URI is the destination URI of the getbalance request sent by the App to the
IntouchPay to enable a deposit transaction to be made to the subscriber. The URI is provided by
Intouchpay in the following format:
http://IP:Port/api/getbalance/
In the format, IP and Port indicate the service IP address and port number of the API provided by
the Intouchpay. Contact carriers to obtain the IP address and port number.
4.3. Request
The App functions as the client and sends a getbalancemessage to intouchpay to enable a
deposit request to be sent to the subscriber.
data={
'username':'bob',
'timestamp':'20161231115242',
'password': 'd3cfd05492a2376003f5af9e2e6643b67',
}
Example in Python
password = hashlib.sha256(username+accountno+partnerpassword+timestamp).hexdigest()
4.5. Request Parameters
The intouchpay gateway will respond with a json response as below and an HTTP response 200 OK.
Success response:
"balance":"0.0"
"success": true
Failure response:
"success":false,
"responsecode":"007",
Below is a table showing the response codes for the Receiving Payment response
12