Refund
Immediate refund against a previous charge transaction is accessed using the Refund API.
Refunds are not supported using this API call by Zain Jordan and UK based operators. You would need to contact our support team to get a refund applied.
All HTTP request parameters should be passed in URL Query String - query_params.
HTTP Request
POST /v2.2/refund?msisdn={msisdn}&campaign={campaign}&merchant={merchant}amount={amount}¤cy={currency}&correlator={correlator}&transaction={transaction_id}&language={language}
Request Parameters
Name | Description | Type | Usage |
---|---|---|---|
msisdn | The subscriber's MSISDN that you want to refund. | 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 refund. This must be a negative amount eg. -0.010 | 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 |
transaction | The transaction ID for the original transaction that you are refunding. The transaction_id is returned by Alacrity in the response to a successful charge transaction. | integer | mandatory |
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 |
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 credential belong to. Below is a list of possible values: | string | mandatory |
msisdn | The subscriber's MSISDN that has been refunded. | string | mandatory |
currency | Currency code as defined in ISO4217. | string | mandatory |
amount | The decimal amount that has been refunded. | numeric | mandatory |
status | The transaction status. A list of possible values 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/refund?
msisdn=96526925482&
campaign=campaign:940d351138df895e8dedf51e5d7b90788cdc23d0&
merchant=partner:02c76113-0ca7-4aed-88e2-75267bf85e82&
amount=-0.5&
currency=KWD&
correlator=we78fehjke8erwhjkre78&
transaction=1910173&
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": "refund",
"operator": "zain-kw",
"merchant": "partner:02c76113-0ca7-4aed-xxx-75267bf85e82",
"campaign": "campaign:940d351138df895e8dedf51e5dxxxx",
"environment": "test",
"msisdn": "9652692xxx",
"currency": "KWD",
"amount": "-0.5",
"transaction":
{
"status": "REFUNDED",
"timestamp": "2020-06-10 15:20:34 +0000"
"transaction_id": "209xxxx"
}
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"error":
{
"type": "refund",
"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 notification to the customer in the languages defined by the Operator.
Updated almost 4 years ago