MO SMS Requiring Reply

Initiate an MO SMS Charge that requires the customer to reply to an SMS.

All HTTP request parameters should be passed in URL Query String - query_params.

HTTP Request

POST /v2.2/mo/charge?msisdn={msisdn}&campaign={campaign}&merchant={merchant}amount={amount}&currency={currency}&correlator={correlator}&description={description}
NameDescriptionTypeUsage
msisdnThe subscriber's MSISDN that you want to charge.stringmandatory
campaignThe Alacrity service URI that identifies the service that this transaction belongs to.stringmandatory
merchantThe Alacrity merchant URI that identifies which merchant this transaction belongs to.stringmandatory
amountThe decimal amount that you want to charge.numericmandatory
currencyCurrency code as defined in [ISO4217].stringmandatory
correlatorA unique string for this transaction. The correlator guards against accidental duplicate transactions.stringmandatory
descriptionThe human readable description for this charge that will appear on the customer's bill.stringmandatory
POST /v2.2/mo/charge?
msisdn=96526925482&
campaign=campaign:940d351138df895e8dedf51e5d7b90788cdc23d0&
merchant=partner:02c76113-0ca7-4aed-88e2-75267bf85e82&
amount=0.5&
currency=KWD&
correlator=we78fehjke8erwhjkre78&
description=Game+from+Acme+Games&
HTTP/1.1
Host: api.sla-alacrity.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json

{
  "success": true
}

πŸ“˜

SMS Sent to customer

After a successful API request an SMS message will be sent to the msisdn asking them to reply to complete the purchase.

πŸ“˜

HTTP Notification

When the customer replies to the message an HTTP notification will be sent to your configured notification URL.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "success":
  {
    "type": "mo_charge",
    "operator": "zain-kw",
    "merchant": "partner:02c76113-0ca7-4aed-88e2-75267bf85e82",
    "campaign": "campaign:940d351138df895e8dedf51e5d7b90788cdc23d0",
    "environment": "test",
    "msisdn": "96526925482",
    "currency": "KWD",
    "amount": "0.5",
    "correlator": "555666777888999000",
    "transaction":
    {
      "status": "CHARGED",
      "timestamp": "2015-08-26T10:58:12.026+08:00",
      "transaction_id": "1910173"
    }
  }
}

πŸ“˜

Correlator

Note that the correlator is sent as part of the response so that you can correctly match the response to your request.

We will send an error response if the charge fails, the PIN has already been used, the PIN has expired, or if we cannot match the reply from the customer with any PIN.

{
    "error":
    {
        "type": "mo_charge",
        "operator": "zain-kw",
        "merchant": "partner:a0c2b23f-97a4-4eb7-9ec1-4333131805cb",
        "campaign": "campaign:ae21af9bc015733bb1d8ba4a04fe6485c5356fdb",
        "environment": "production",
        "msisdn": "96597493654",
        "correlator": "555666777888999000",
        "transaction":
        {
            "status": "PIN_USED",
            "timestamp": "2022-01-28T14:17:17+08:00"
        }
    }
}
{
    "error":
    {
        "type": "mo_charge",
        "operator": "zain-kw",
        "merchant": "partner:a0c2b23f-97a4-4eb7-9ec1-4333131805cb",
        "campaign": "campaign:ae21af9bc015733bb1d8ba4a04fe6485c5356fdb",
        "environment": "production",
        "msisdn": "96597493654",
        "correlator": "555666777888999000",
        "transaction":
        {
            "status": "PIN_EXPIRED",
            "timestamp": "2022-01-28T14:19:48+08:00"
        }
    }
}

πŸ“˜

PIN Not Found

In this case, since we are not able to associate the reply from the customer to a specific request, we cannot include the transaction correlator.

{
    "error":
    {
        "type": "mo_charge",
        "operator": "zain-kw",
        "merchant": "partner:a0c2b23f-97a4-4eb7-9ec1-4333131805cb",
        "campaign": "campaign:ae21af9bc015733bb1d8ba4a04fe6485c5356fdb",
        "environment": "production",
        "msisdn": "96597493654",
        "transaction":
        {
            "status": "PIN_NOT_FOUND",
            "timestamp": "2022-01-28T14:20:17+08:00",
            "pin": "11111111"
        }
    }
}