POST/EVENT

Used to issue Miles to a Collector’s account in real-time for a non-transactional reason.
POST /checkout/issuance/post/event

Take a look at our OpenAPI (Swagger-Spec) schema to learn more about the API calls.

The POST/EVENT endpoint is used to issue Miles to a Collector’s account in real-time for a non-transactional reason (e.g., issuing Miles for desired activity or issuing a manual correction to a Collector’s account). With this method selected the total Miles to be issued are calculated by the partner.

API call validation process

After making a call to POST/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
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
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
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

Sample request

curl -X POST https://cert.airmilesapis.ca/checkout/issuance/post/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
        }
    ],
    "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.
collectorNumber* The customer’s AIR MILES account number. Must be 11 digits in length and must start with an 8
context Notes or additional information that is desired on each request as a key value pair.
coupon A list of all coupon codes applied to the bill at checkout.
deviceId ID number used to identify the POS terminal currently in use.
issuances* This mandatory object contains data elements related to issuance data.
sponsorCode* Alpha-numeric value used to identify the Partner. To be provided by AIR MILES
transactionDateTime* The date and time the request was sent.

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"
        }
    ],
    "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.
transactionId A unique ID created for the particular transaction. To be provided by AIR MILES

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.