latestOpenAPI 3.0.02026-08-1071532.8 KB

cfd1b00f674f

COLLECTIONS

post/collections/initialize

Headers

public-keystring required
x-api-versionnumber required
Accept-Language'en' | 'fr' | 'sw' required

Request body

transaction_method'BANK' | 'CARD' | 'MOBILE_MONEY' | 'CRYPTO' required

The transaction method to be used.

provider_codestring required

The provider code as obtained from the payment options

merchant_referencestring required

The unique reference for this request. It must be at least 8 characters long. Alternatively, the value auto can be passed, and a unique reference will be created for you by the API

msisdnstring

The mobile money number of the customer. Mandatory for Mobile Money.

mobile_money_hppboolean

Should be sent with the value true in order for the API to handle the mobile money payment via hosted page

currencystring required

The 3-character ISO currency code for the request currency

amountnumber required

The amount being requested

descriptionstring required

The description/narration for the transaction. Between 10-30 characters

customer_namestring

The name of the customer

customer_emailstring

The email of the customer

redirect_urlstring

The HTTPs redirect URL to which the API will redirect when the payment is successful/failed

card_cipherstring
charge_customerboolean

Whether or not the customer should bear the charge for the transaction. By default, this is false to mean that the merchant bears the charge

allow_final_status_changeboolean

Whether or not the final transaction status can be altered as described in the document

Example request

{
  "transaction_method": "MOBILE_MONEY",
  "provider_code": "mtn_zm",
  "merchant_reference": "MCTREF123456",
  "msisdn": "256787701800"
}

Response

Collection initiated successfully.

codenumber required

HTTP Status code

status'success' | 'accepted' | 'error' required

The status of the response

messagestring required

Response messae

dataobject required

Response data

Example response

{
  "code": 202,
  "status": "accepted",
  "message": "Request Accepted",
  "data": {
    "internal_reference": "DUSUPAYRMGRXNNYBWATKJ",
    "merchant_reference": "MCTREFT2WMNWZ23SBN6Y"
  }
}