B2C API New Version
B2C API New Version
B2C
Billing & IT – Mobile Money and VAS
B2C
Version 1.3
10 August 2018
Version History
Contents
Version History.............................................................................................................................................. 2
1 Introduction .......................................................................................................................................... 4
1.1 Prerequisites ................................................................................................................................. 4
2 Service flow ........................................................................................................................................... 5
3 Test details ............................................................................................................................................ 6
4 API Calls Parameters ............................................................................................................................. 7
4.1 Login .............................................................................................................................................. 7
4.1.1 Request Parameters .............................................................................................................. 7
4.1.2 Response Parameters ........................................................................................................... 7
4.2 B2C ................................................................................................................................................ 8
4.2.1 Request Parameters .............................................................................................................. 8
4.2.2 Response Parameters ........................................................................................................... 9
5 API Calls Samples ................................................................................................................................ 10
5.1 Login ............................................................................................................................................ 10
5.1.1 Request ............................................................................................................................... 10
5.1.2 Response ............................................................................................................................. 10
5.2 B2C .............................................................................................................................................. 12
5.2.1 Request ............................................................................................................................... 12
5.2.2 Response ............................................................................................................................. 14
5.2.3 Callback Result .................................................................................................................... 16
1 Introduction
The iNSight Payment Gateway sits in front of G2 which manages a customer’s wallet. This wallet, in the
case of mobile network operators, the “Mobile Money Platform” is physically separated from the
payment gateway (sometimes also referred to as a “Broker” or an “Orchestration Layer”) providing the
benefit of a simplified interface and abstraction of both function and security.
1.1 Prerequisites
In order to issue any query against the iNSight Payment Gateway, a valid session token is required (as
described in the referenced document “TxS_InterfaceBase”).
The following data must be supplied by the owner of the system in order to be able to communicate
with iNSight Payment Gateway.
- Username
- Password
Requests must be posted to iNSight Payment Gateway via the SOAP web service. The web service will be
accessible via HTTPs only. The operation will be either Synchronous or Asynchronous depending on
what is exposed by the Mobile Money platform (a platform that employs a Synchronous approach could
be exposed via iNSight Payment Gateway as either Synchronous or Asynchronous.
2 Service flow
1. The third party initiates the process by sending the Login Request
3. Third Party system sends B2C Request, using SessionID received in step 2 as token. M-Pesa will send a
acknowledge response.
4. After processing the request, M-Pesa will forward the final result of to the Third Party Callback Url
sent on the B2C Request.
5. The Third Party has to send a response with the required format.
3 Test details
Login
URL Login https://uatipg.m-pesa.vodacom.cd:8091/insight/SOAPIn
URL B2C https://uatipg.m-pesa.vodacom.cd:8094/iPG/B2C
Internal IP 10.90.104.50
Public IP 41.78.195.169
Event ID Login 2500
Event ID B2C 12001
CommandID InitTrans_one4allb2c
ShortCode/ServiceProviderCode 15058
4.1 Login
4.1.1 Request Parameters
4.2 B2C
4.2.1 Request Parameters
4.Async eMail
CallBackDestination Dependant on CallBackChannel String Required
Should be populated with relevant
URL, MSISDN (format example
243821111111) or email address
CommandID M-Pesa CommandID. M-Pesa team String Required
to provide.
InitiatorIdentifier Third-Party’s Identifier. M-Pesa String Optional
team to provide.
SecurityCredential Third-Party’s Password. M-Pesa String Optional
team to provide.
5.1 Login
5.1.1 Request
5.1.2 Response
<ns2:getGenericResultResponse
xmlns:ns2="http://www.4cgroup.co.za/genericsoap"
xmlns:ns3="http://www.4cgroup.co.za/soapauth">
<SOAPAPIResult>
<eventInfo>
<code>3</code>
<description>Processed</description>
<detail>Processed</detail>
<transactionID>0c49ec4bbebe44b082aa24e5f548b514</transactionID>
</eventInfo>
<request>
<dataItem>
<name>Username</name>
<type>String</type>
<value>thirdpartyc2bw</value>
</dataItem>
<dataItem>
<name>Password</name>
<type>String</type>
<value>thirdpartyc2bw</value>
</dataItem>
</request>
<response>
<dataItem>
<name>SessionID</name>
<type>String</type>
<value>dbcb63a40afd4191a990d66ed9cb62f7</value>
</dataItem>
</response>
</SOAPAPIResult>
</ns2:getGenericResultResponse>
</S:Body>
</S:Envelope>
5.2 B2C
5.2.1 Request
<type>String</type>
<value>EN</value>
</dataItem>
<dataItem>
<name>ThirdPartyReference</name>
<type>String</type>
<value>Christian-Test1</value>
</dataItem>
<dataItem>
<name>CallBackChannel</name>
<type>String</type>
<value>2</value>
</dataItem>
<dataItem>
<name>CallBackDestination</name>
<type>String</type>
<value>https://mmdrc.myone4all.com/xmlapi/sevice/callbackurl</value>
</dataItem>
<dataItem>
<name>CommandID</name>
<type>String</type>
<value>InitTrans_one4allb2c</value>
</dataItem>
</Request>
</gen:getGenericResult>
</soapenv:Body>
</soapenv:Envelope>
5.2.2 Response
<dataItem>
<name>Shortcode</name>
<type>String</type>
<value>15058</value>
</dataItem>
<dataItem>
<name>Language</name>
<type>String</type>
<value>EN</value>
</dataItem>
<dataItem>
<name>ThirdPartyReference</name>
<type>String</type>
<value>Christian-Test1</value>
</dataItem>
<dataItem>
<name>CallBackChannel</name>
<type>String</type>
<value>2</value>
</dataItem>
<dataItem>
<name>CallBackDestination</name>
<type>String</type>
<value>https://callbackurl</value>
</dataItem>
<dataItem>
<name>CommandID</name>
<type>String</type>
<value>InitTrans_one4allb2c</value>
</dataItem>
</request>
<response>
<dataItem>
<name>Insight_txid</name>
<type>String</type>
<value>lurzsmmaxquh9l1svold6e3hx7x7jp9t</value>
</dataItem>
<dataItem>
<name>ResponseCode</name>
<type>String</type>
<value>0</value>
</dataItem>
</response>
</SOAPAPIResult>
</ns2:getGenericResultResponse>
</S:Body>
</S:Envelope>
To receive the result of an Asynchronous event call via an HTTP post, the CallBackChannel must be set to
“2”. The CallBackDestination should also carry the URL that should be posted to from iNSight (it is
important that iNSight can access this URL). The envelope posted will be a SOAP envelope. iNSight must
be able to post without needing to authenticate or needing to perform any preliminary steps. The Third-
Party must reply with the specified Response packet.
<type>String</type>
</dataItem>
<dataItem>
<name>TransactionID</name>
<value>X-BS281</value>
<type>String</type>
</dataItem>
<dataItem>
<name>Amount</name>
<value>200</value>
<type>String</type>
</dataItem>
<dataItem>
<name>TransactionTime</name>
<value>20170301T22:59:01</value>
<type>String</type>
</dataItem>
<dataItem>
<name>ThirdPartyReference</name>
<value>123456-Test</value>
<type>String</type>
</dataItem>
<dataItem>
<name>InsightReference</name>
<value>12sdxq3634dadsas242</value>
<type>String</type>
</dataItem>
</Request>
</gen:getGenericResult>
</soapenv:Body>
</soapenv:Envelope>
Response