API Methods

To create a payment you will use the callService method. It follows the flow pattern below. You start by making the request, then you will receive an acknowledgement, and later a callback with the updated status of your transaction.

936

callService flow

Available Methods

MethodDescriptionReturn value
callServiceCreate a transactionACK, and Webhook
transactionStatusMethod sent from Onafriq to the Partner via the webhook to return the final status of the transaction created by callServiceStatus of transactions created by callService. See full list of status codes here.

See below for method details

callService Request

Use this method to create a transaction.

{
    "corporateCode": "",
    "password": "",
    "mfsSign": "",
    "batchId": "Wayodi7",
    "requestBody": [
        {
            "instructionType": {
                "destAcctType": 1,
                "amountType": 1
            },
            "amount": {
                "amount": 2,
                "currencyCode": "UGX"
            },
            "sendFee": {
                "amount": 1,
                "currencyCode": "UGX"
            },
            "sender": {
                "msisdn": "",
                "fromCountry": "GB",
                "name": "Wys",
                "surname": "Katlego",
                "address": null,
                "city": null,
                "state": null,
                "postalCode": null,
                "email": null,
                "dateOfBirth": null,
                "document": null
            },
            "recipient": {
                "msisdn": "",
                "toCountry": "UG",
                "name": "Gg",
                "surname": "Lebese",
                "address": null,
                "city": null,
                "state": null,
                "postalCode": null,
                "email": null,
                "dateOfBirth": null,
                "document": null,
                "destinationAccount": null
            },
            "thirdPartyTransId": "MFS11",
            "reference": null
        }
    ]
}

Parameters

FieldTypeMandatoryDescriptionComment
corporateCodeStringYesUnique corporate codeWill be provided by Onafriq.
password StringYesSecure passwordWill be provided by Onafriq.
mfsSign StringYesMFS signatureMessage Level Security
batchIdStringYesSender batch ID.
instructionType:
destAcctTypeIntegerYesDefines remittance destination as either to Mobile Wallet or Bank accountValid values:
1 = Mobile Wallet
2 = Bank
amountTypeIntegerYesDefines amount as either Send amount in send currency or Receive amount in receive currency.Valid values:
1 = Send amount
2 = Receive (payout) amount
amount:
amountNumericYesInstruction amount
currencyCodeStringYesInstruction currency. Currency code (ISO 4217)
sendFee:
amount NumericOptionalSending fee amountRequired when passing instruction with amount type ‘’Send’’.
currencyCodeStringOptionalFee currency code (ISO 4217)Required when passing instruction with amount type ‘’Send’’.
sender:
msisdn StringNoSender mobile number passed in ITU-T E.164 GSM DCS 1800 format, e.g. 250700800900.May be passed as empty if sender has no mobile phone.
fromCountryStringYesSend country (ISO 3166-2)
name StringYesSender first name
surname StringYesSender surname
address StringNoSender address
city StringNoCity
state StringNoState
postalCodeStringNoPostal code
email StringNoSender email
dateOfBirthdateNoSender date of birth; YYYY-MM-DD
document:
idNumberStringNoSender ID number
idTypeStringNoIdentification TypePossible values:
PP = Passport
ID = National ID card)
DL = Driver’s License
idCountryStringNoSender ID country/nationality
idExpirydateNoExpiry date of sender ID; YYYY-MM-DD
recipient:
msisdn StringConditionalRecipient mobile number passed in ITU-T E.164 GSM DCS 1800 format, e.g. 250700800900Required where dest_account_type is mobile wallet.
toCountryStringYesDestination country (ISO 3166-2)
name StringYesRecipient first name
surname StringYesRecipient surname
address StringNoRecipient address
city StringNoCity
state StringNoState
postalCodeStringNoPostal code
email StringNoRecipient email
dateOfBirthdateNoRecipient date of birth; YYYY-MM-DD
document:
idNumberStringNoRecipient ID number
idTypeStringNoIdentification typePossible values:
PP = Passport
ID = National ID card)
DL = Driver’s License
idCountryStringNoRecipient ID country/nationality
idExpirydateNoExpiry date of Recipient ID; YYYY-MM-DD
destinationAccount:
accountNumberStringConditionalRecipient account number. May be mobile wallet account or bank account
mfsBankCodeStringConditionalUnique reference for the bank on the Onafriq systemRequired where the destination account type is a bank account
thirdPartyTransIdStringYesTransaction ID of the sending 3P
reference1000 charsNoA pass-through field that can be used to pass any other relevant detail.Supports comma-separated values, if multiple details are being passed.

Cash pickup reference values

If doing a cash pick-up transaction, see Cash Pickup References for the reference values to use.

callService Response

This is the response returned by the callService method

{
    "totalTxSent": 4,
    "noTxAccepted": 4,
    "noTxRejected": 0,
    "details": {
        "transResponse": [
            {
                "thirdPartyId": "MFS11",
                "status": {
                    "code": "100",
                    "message": "Accepted"
                }
            },
            {
                "thirdPartyId": "MFS12",
                "status": {
                    "code": "100",
                    "message": "Accepted"
                }
            },
            {
                "thirdPartyId": "MFS13",
                "status": {
                    "code": "100",
                    "message": "Accepted"
                }
            },
            {
                "thirdPartyId": "MFSBank12",
                "status": {
                    "code": "100",
                    "message": "Accepted"
                }
            }
        ]
    },
    "timestamp": "2019-12-18 07:50:26.771"
}

Parameters

FieldTypeDescription
totalTxSentNumericTotal number of transaction submitted.
noTxAcceptedNumericTotal number of transaction that passed validation.
noTxRejectedNumericTotal number of transaction that failed validation.
details:ObjectObject containing a list of transResponses
transResponseListDetails of transactions that passed or failed validation stage
thirdPartyIdStringTransaction ID of the sending 3P
status:ObjectStatus Object containing status code, message and/or messageDetail
codeStringResponse status code. See list of codes here
messageStringResponse status message
messageDetailStringDetailed message when transaction fails
timestampDateTimeCurrent TimeStamp for the list/batch sent

callService Callback

Below is the format of the callback notification.

{
   "thirdPartyTransId": "Test11",
   "mfsTransId": "1126231250437",
   "e_trans_id": "11524180437",
   "fxRate": 3720.765,
   "status": {
      "code": "MR101",
      "message": "success"
   },
   "sendAmount": {
      "amount": 0,
      "currencyCode": "UGX"
   },
   "receiveAmount": {
      "amount": 2000,
      "currencyCode": "UGX"
   }
   
}

Parameters

FieldTypeDescription
thirdPartyTransIdStringTransaction ID of the sending partner
mfsTransId StringMFS transaction Id
e_trans_id StringTransaction ID of the receiving platform.
In the case of cash pick-up remittances, this value will be the voucher number.
fxRate NumericValue of the exchange rate
statusObjectStatus Object containing status code and message
code StringResponse status code of transaction. See list of codes here
message StringResponse status message of transaction
sendAmount ObjectObject containing send amount and send currency
amount NumericSend amount
currencyCode StringSend currency code(ISO 4217)
receiveAmount ObjectObject containing receive amount and receive currency
amount Numericreceive amount
currencyCode Stringreceive currency code (ISO 4217)