REVERSE/EVENT
Take a look at our OpenAPI (Swagger-Spec) schema to learn more about the API calls.
The REVERSE/EVENT
endpoint is used to reverse Miles from a Collector’s account in real-time for a non-transactional reason (e.g., issuing a manual correction to a Collector’s account). With this method selected the total Miles to be reversed are calculated by the Partner.
API call validation process
After making a call to REVERSE/EVENT
, you will receive one of the following responses:
- If the call is SUCCESSFUL
- You will receive a response code of
200
- No further action is required
- You will receive a response code of
- If the call is SUCCESSFUL but issuances are pending and causing a delay
- You will receive a response code of
202
- No further action is required
- Resubmitting the same request will have no effect on the transaction
- You will receive a response code of
- If the call is REJECTED due to incorrect or invalid details
- You will receive a response code of
400
- You must retry the request with a valid transaction record and/or the corrected details
- You will receive a response code of
- If the call FAILS due to an error or other issue
- You will receive a response code of
500
- It’s recommended you retry the request at least 2 additional times
- You will receive a response code of
Note
The “FAIL” response above could indicate a system error on our end. If this happens, please contact our Support Desk for assistance.Sample request
curl -X POST https://cert.airmilesapis.ca/checkout/issuance/reverse/event \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJ..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 123e4567-e89b-12d3-a456-426655440000" \
-d {
"clientTransactionId": "111112314",
"collectorNumber": "80085102028",
"context": {"key1": "value1","key2": "value2"},
"coupon": [
"coupon"
],
"deviceId": "string",
"issuances": [
{
"issuanceOfferCode": "STANDARD",
"locationCode": "0037",
"milesAmount": 8,
"offerDescription": "offer",
"offerId": 22
}
],
"originalClientTransactionId": "12340001111",
"sponsorCode": "KENY",
"transactionDateTime": "2021-11-09T21:04:45.930Z"
}
Request parameters
* required field
Parameter | Description |
---|---|
clientTransactionId * |
Unique identifier generated by the Partner for the event transaction.
Example: |
collectorNumber * |
The customer’s AIR MILES account number.
Example: |
coupon |
A list of all coupon codes applied to the bill at checkout.
Example: |
context |
Notes or additional information that is desired on each request as a key value pair.
Example: |
deviceId |
ID number used to identify the POS terminal currently in use.
Example: |
issuances * |
This mandatory object contains data elements related to issuance data.
Example:
|
originalClientTransactionId |
This value represents the clientTransactionId returned in the POST/EVENT transaction response from AIR MILES. Alternatively the checkoutTransactionId supplied by the Partner in an POST transaction can be sent in this field.
Example: |
sponsorCode * |
Alpha-numeric value used to identify the Partner.
Example: |
transactionDateTime * |
The date and time the request was sent.
Example: |
Sample response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 29 Oct 2018 15:27:34 GMT
{
"clientTransactionId": "111112314",
"collectorNumber": "80085102028",
"coupon": [
"coupon"
],
"deviceId": "string",
"issuances": [
{
"issuanceOfferCode": "STANDARD",
"locationCode": "0037",
"milesAmount": 8,
"offerDescription": "offer",
"offerId": "22",
"status": "PENDING"
}
],
"originalClientTransactionId": "12340001111",
"sponsorCode": "KENY",
"transactionDateTime": "2021-11-11T12:54:31.780-05:00",
"transactionId": "93a1237c-545c-4f16-96e5-4d890c903bd9"
}
Response parameters
Only parameters unique to the Sample Response are listed below. For all other parameters, refer to the table above.
Parameter | Description |
---|---|
issuances |
Array value describing the issuance offers redeemed by the Collector.
Example:
|
transactionId |
A unique ID created for the particular transaction.
Example: |
Status codes
Refer to our Audit report errors table for more information.
Status Code | Description |
---|---|
200 | Request processed successfully. |
202 | Request still processing, please wait. |
400 | Bad request, failed to process. |
500 | Request failed due to internal error. |