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}&currency={currency}&correlator={correlator}&transaction={transaction_id}&language={language}

Request Parameters

NameDescriptionTypeUsage
msisdnThe subscriber's MSISDN that you want to refund.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 refund. This must be a negative amount eg. -0.010numericmandatory
currencyCurrency code as defined in ISO4217.stringmandatory
correlatorA unique string for this transaction. The correlator guards against accidental duplicate transactions.stringmandatory
transactionThe 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.integermandatory
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

    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 credential 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 refunded.stringmandatory
    currencyCurrency code as defined in ISO4217.stringmandatory
    amountThe decimal amount that has been refunded.numericmandatory
    statusThe transaction status. A list of possible values 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/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.