API Reference

This describes the two main interfaces where Clickatell and a bank interact when dealing with a purchase.

Reserve funds endpoint implemented by bank

The reserveFunds API is the first point of communication between Clickatell and the bank, where Clickatell requests the reservation of funds for a purchase from the client, and the bank replies with the outcome of this reservation.

Reserve funds endpoint implemented by bank

post

The reserveFunds API is the first point of communication between Clickatell and the bank, where Clickatell requests the reservation of funds for a purchase from the client, and the bank replies with the outcome of this reservation Signature Checksum Calculation

Header parameters
SignaturestringOptional

This is an "optional" hash calculated using a shared secret between Clickatell and the client

Body
clientTxnRefstring · max: 64Required

Unique client reference to the transaction

Example: seo8w3-3wsf8cffdd34-f58l
raasTxnRefstring · max: 64Required

Unique Clickatell reference to the transaction

Example: ffdd34-3wsf8c-seo8w3-f58l
productIdinteger · max: 5Required

ID of the product requested to be purchased. A list of products will be supplied by Clickatell

Example: 110
productTypeinteger · max: 32Optional

Unique reference to the product type (classification, group or line) that was purchased, for instance pre-purchased airtime or data

Example: 3
purchaseAmountinteger · max: 12Required

The value of the SKU that the customer wishes to receive, in the lowest denomination (e.g. cents or pennies), for instance, $250.00 would equate to the value 25000. This amount excludes the fee amount charged for the product

Example: 10000
reserveAmountinteger · max: 12Required

The amount to be reserved by the funding source. Typically, the same as the TPV (Total Purchase Value). In the lowest denomination (e.g. cents or pennies), for instance $250.00 would equate to the value 25000. May differ from the purchase amount and vend amount if a fee has been added on top of the purchase amount.

Example: 110
feeAmountinteger · int32 · max: 12Required

A fixed transaction fee that Clickatell charges on top of the requested purchase value of a product. Please note a zero amount needs to be specified if there is no fee applicable. If the fee amount is not correct the request validation will fail

Example: 0
clientShareAmountinteger · max: 12Required

The portion of the TPV due to the client, stated as an amount. In the lowest denomination (e.g. cents or pennies), for instance $250.00 would equate to the value 25000

Example: 487
settlementAmountinteger · max: 12Required

The amount settled to Clickatell by the client. In the lowest denomination (e.g. cents or pennies), for instance $250.00 would equate to the value 25000

Example: 14513
sourceIdentifierstring · max: 32Required

The unique identifier for the source, as recognized by the bank. This is typically the mobile phone number (MSISDN) but can be another unique identifier recognized by the bank.

Example: 2341234567899
targetIdentifierstring · max: 32Required

The unique identifier for the intended recipient (or target/destination) of the product being purchased. This may be the buyer (“Self”) or someone else (a so-called “3rd party purchase”)

Example: 2348012345555
channelIdinteger · int32 · max: 2Required

The channel is the user interface, platform or service that the buyer used to initiate a purchase from

Example: 7
channelNamestring · max: 64Required

This is the specific name of the channel used to initiate a purchase

Example: USSD
channelSessionIdstring · max: 64Optional

This is a unique reference to the channel-specific engagement when the purchase was initiated (for example USSD Session ID, if the purchase was over USSD)

Example: 144974973281
authCodestring · max: 64Optional

An authentication code provided by the buyer that the bank can use to verify the buyer’s identity. Used in the reserveFunds request if supplied

Example: 1234
timestampstring · date-time · max: 32Required

The timestamp of when an API request or response was sent, in ISO-8601 format

Example: 2017-06-29T16:39:42.735Z
accountIdentifierstring · max: 64Optional

The account that will be deducted from. Only mandatory if there is no concept of a default account for the buyer at the funding source

Example: 3745******0762
Responses
200

successful response

application/json
post
/reserveFunds
POST /reserveFunds HTTP/1.1
Host: client_server_hostname/
Content-Type: application/json
Accept: */*
Content-Length: 453

{
  "clientTxnRef": "seo8w3-3wsf8cffdd34-f58l",
  "raasTxnRef": "ffdd34-3wsf8c-seo8w3-f58l",
  "productId": 110,
  "productType": 3,
  "purchaseAmount": 10000,
  "reserveAmount": 110,
  "feeAmount": 0,
  "clientShareAmount": 487,
  "settlementAmount": 14513,
  "sourceIdentifier": "2341234567899",
  "targetIdentifier": "2348012345555",
  "channelId": 7,
  "channelName": "USSD",
  "channelSessionId": "144974973281",
  "authCode": 1234,
  "timestamp": "2017-06-29T16:39:42.735Z",
  "accountIdentifier": "3745******0762"
}
200

successful response

{
  "responseCode": "0000",
  "reserveFundsTxnRef": "ffdd34-3wsf8c-seo8w3-f58l"
}

Endpoint that informs the client of the outcome of a transaction

The transactResult API is the second point of interaction between Clickatell and the bank, where Clickatell confirms the outcome of the dispensing of the product with the bank, and the bank can either proceed with the payment or cancel the fund reservation.

Endpoint that informs the client of the outcome of a transaction

post

The transactResult API is the second point of interaction between Clickatell and the bank, where Clickatell confirms the outcome of the dispensing of the product with the bank, and the bank can either proceed with the payment or cancel the fund reservation Signature Checksum Calculation

Header parameters
SignaturestringOptional

This is a hash calculated using a shared secret between Clickatell and the client

Body
clientTxnRefstring · max: 64Required

Unique client reference to the transaction

Example: seo8w3-3wsf8cffdd34-f58l
raasTxnRefstring · max: 64Required

Unique Clickatell reference to the transaction

Example: ffdd34-3wsf8c-seo8w3-f58l
reserveFundsTxnRefstring · max: 64Required

This is the universally unique identifier that the bank must generate when it reserves funds on a buyer’s account

Example: f58l-3wsf8c-seo8w3-ffdd34
responseCodeinteger · max: 4Required

The response code used on the reserveFunds Response indicates the result of attempting to reserve funds on a buyer’s account. Note that all response codes other than 0000 will be treated as a failed funds reservation (and consequently,not followed by a Transact Result confirmation)

Example: 0
reserveAmountinteger · max: 12Required

The amount to be reserved by the funding source. In the lowest denomination (e.g. cents or pennies), for instance $250.00 would equate to the value 25000. Typically,the same as the TPV (Total Purchase Value). May differ from the purchase amount and vend amount if a fee has been added on top of the purchase amount.

Example: 110
feeAmountinteger · int32 · max: 12Required

A fixed transaction fee that Clickatell charges on top of the requested purchase value of a product. Please Note a zero amount needs to be specified if there is no fee applicable. If the fee amount is not correct the request validation willfail

Example: 0
clientShareAmountinteger · max: 12Required

The portion of the TPV due to the client, stated as an amount. In the lowest denomination (e.g. cents or pennies), for instance $250.00 would equate to the value 25000

Example: 487
settlementAmountinteger · max: 12Required

The amount settled to Clickatell by the Client. In the lowest denomination (e.g. cents or pennies), for instance $250.00 would equate to the value 25000

Example: 14513
timestampstring · date-time · max: 32Required

The timestamp of when an API request or response was sent, in ISO-8601 format

Example: 2017-06-29T16:39:42.735Z
tokenstring · max: 60Required

Some product types return a recharge PIN/Token which consumers use to redeem the value of the purchase (e.g. PIN/Token entered in a Pre-Paid meter). The Clickatell platform will deliver this PIN/Token to the consumer via SMS.The PIN/Token will only be returned via the API when the Clients/Funding sources are configured on the Clickatell platform to receive it

Example: XYZ
Responses
200

successful response

No content

post
/transactResult
POST /transactResult HTTP/1.1
Host: client_server_hostname/
Content-Type: application/json
Accept: */*
Content-Length: 286

{
  "clientTxnRef": "seo8w3-3wsf8cffdd34-f58l",
  "raasTxnRef": "ffdd34-3wsf8c-seo8w3-f58l",
  "reserveFundsTxnRef": "f58l-3wsf8c-seo8w3-ffdd34",
  "responseCode": 0,
  "reserveAmount": 110,
  "feeAmount": 0,
  "clientShareAmount": 487,
  "settlementAmount": 14513,
  "timestamp": "2017-06-29T16:39:42.735Z",
  "token": "XYZ"
}
200

successful response

No content

Last updated