One Off Charge

Immediate charge against a MSISDN using the Billing API. Used for direct One Off charge based services.

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

HTTP Request

POST /v2.2/charge?msisdn={msisdn}&campaign={campaign}&merchant={merchant}amount={amount}&currency={currency}&correlator={correlator}&description={description}&language={language}

Request Parameters

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
pinThe confirmation PIN received by the subscriber via SMS. You can send a PIN to subscribers via the PIN API. (Conditional depending on operator)stringmandatory
languageThe language code as defined in ISO639-1. The chosen language will be used in the SMS message. Below is a list of current supported languages.
  • en for English,
  • ar for Arabic
  • stringoptional
    fraud_tokenIf you are hosting the landing page you may be required to use our fraud prevention API and include a valid/checked token in this requeststringoptional

    📘

    Info

    A token generated via Checkout or Hosted Button can be used instead of msisdn. Also in this case a pin is not required.

    Response Parameters

    NameDescriptionTypeUsage
    typeAn indication of the transaction type. Below is a list of possible values:
  • charge: Immediate charge transaction.
  • refund: Immediate refund transaction.
  • subscription: Subscription's initial charge transaction.
  • stringmandatory
    operatorThe mobile operator code.stringmandatory
    merchantThe Alacrity merchant URI that identifies which merchant this transaction belongs to.stringmandatory
    campaignThe Alacrity service URI that identifies the service that this transaction belongs to.stringmandatory
    environmentThe environment that your API credentials belong to. Below is a list of possible values:
  • test: sandbox credentials.
  • preproduction: UAT credentials.
  • production: live credentials.
  • stringmandatory
    msisdnThe subscriber's MSISDN that has been charged.stringmandatory
    currencyCurrency code as defined in ISO4217.stringmandatory
    amountThe decimal amount that has been charged.numericmandatory
    statusThe transaction status. A list of possible values can be found herestringmandatory
    messageThe error description if any.stringoptional
    timestampThe transaction timestamp in UTC time standard.stringmandatory
    transaction_idThe API generated and unique transactions identifier.integermandatory
    POST /v2.2/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&
    language=ar HTTP/1.1
    Host: api.sla-alacrity.com
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    Accept: application/json
    
    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
      "success":
      {
        "type": "charge",
        "operator": "zain-kw",
        "merchant": "partner:02c76113-0ca7-4aed-88e2-75267bf85e82",
        "campaign": "campaign:940d351138df895e8dedf51e5d7b90788cdc23d0",
        "environment": "test",
        "msisdn": "96526925482",
        "currency": "KWD",
        "amount": "0.5",
        "transaction":
        {
          "status": "CHARGED",
          "timestamp": "2015-08-26T10:58:12.026+08:00",
          "transaction_id": "1910173"
        }
      }
    }
    
    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
      "error":
      {
        "type": "charge",
        "operator": "zain-kw",
        "merchant": "partner:02c76113-0ca7-4aed-88e2-75267bf85e82",
        "campaign": "campaign:940d351138df895e8dedf51e5d7b90788cdc23d0",
        "environment": "test",
        "msisdn": "96526925482",
        "currency": "KWD",
        "amount": "0.5",
        "transaction":
        {
          "status": "ACCOUNT_NOT_FOUND",
          "timestamp": "2015-08-26T10:59:10.000+08:00",
          "transaction_id": "1910174"
        }
      }
    }
    

    📘

    Info

    Please note Alacrity will send an SMS purchase receipt to the customer in the languages defined by the Operator.

    Please note if you want to charge an MSISDN in the Sandbox you will first need to provision it.


    What’s Next