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}¤cy={currency}&correlator={correlator}&description={description}&language={language}
Request Parameters
Name | Description | Type | Usage |
---|---|---|---|
msisdn | The subscriber's MSISDN that you want to charge. | string | mandatory |
campaign | The Alacrity service URI that identifies the service that this transaction belongs to. | string | mandatory |
merchant | The Alacrity merchant URI that identifies which merchant this transaction belongs to. | string | mandatory |
amount | The decimal amount that you want to charge. | numeric | mandatory |
currency | Currency code as defined in [ISO4217]. | string | mandatory |
correlator | A unique string for this transaction. The correlator guards against accidental duplicate transactions. | string | mandatory |
description | The human readable description for this charge that will appear on the customer's bill. | string | mandatory |
pin | The confirmation PIN received by the subscriber via SMS. You can send a PIN to subscribers via the PIN API. (Conditional depending on operator) | string | optional |
language | The 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. | string | optional |
fraud_token | If you are hosting the landing page you may be required to use our fraud prevention API and include a valid/checked token in this request | string | optional |
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
Name | Description | Type | Usage |
---|---|---|---|
type | An indication of the transaction type. Below is a list of possible values: | string | mandatory |
operator | The mobile operator code. | string | mandatory |
merchant | The Alacrity merchant URI that identifies which merchant this transaction belongs to. | string | mandatory |
campaign | The Alacrity service URI that identifies the service that this transaction belongs to. | string | mandatory |
environment | The environment that your API credentials belong to. Below is a list of possible values: | string | mandatory |
msisdn | The subscriber's MSISDN that has been charged. | string | mandatory |
currency | Currency code as defined in ISO4217. | string | mandatory |
amount | The decimal amount that has been charged. | numeric | mandatory |
status | The transaction status. A list of possible values can be found here | string | mandatory |
message | The error description if any. | string | optional |
timestamp | The transaction timestamp in UTC time standard. | string | mandatory |
transaction_id | The API generated and unique transactions identifier. | integer | mandatory |
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.
Updated about 1 year ago