POST
Take a look at our OpenAPI (Swagger-Spec) schema to learn more about the API calls.
The POST
endpoint is used to issue AIR MILES to a Collector’s account in real-time for a basket transaction at
checkout. With this method selected the total AIR MILES to be issued for a transaction are calculated by the Partner.
API call validation process
After making a call to POST
, 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
Request parameters
* required field
Parameter | Description |
---|---|
basketGSTAmount |
The dollar amount of GST (Government Sales Tax) to be added.
Example: |
basketHSTAmount |
The dollar amount of HST (Harmonized Sales Tax) to be added.
Example: |
basketPSTAmount |
The dollar amount of PST (Provincial Sales Tax) to be added.
Example: |
basketQSTAmount |
The dollar amount of QST (Quebec Sales Tax) to be added.
Example: |
basketPostTaxAmount * |
The total dollar amount of the basket, POST-TAX (i.e., what the Collector spent at checkout).
Example: |
basketPreTaxAmount * |
The total dollar amount of the basket, PRE-TAX (i.e., before taxes are calculated and added to the total).
Example: |
checkoutDateTime * |
Standard date/time format for the transaction at checkout. (see ISO-8601)
Examples:
|
checkoutTransactionId * |
Unique identifier generated by the Partner for the transaction at checkout.
Example: |
collectorNumber * |
The customer’s AIR MILES account number.
Example: |
context |
Notes or additional information that is desired on each request as a key value pair.
Example: |
coupon |
A list of all coupon codes applied to the bill at checkout.
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:
|
items |
This optional object contains data elements related to purchase details, including the list of item(s) purchased, their quantity, individual price, and total amount paid (pre-tax). Click below to see additional details on the data object’s elements, including their descriptions and examples.
Example:
|
locationCode |
A maximum of four alpha-numeric characters created by the Partner and used to identify the Partner’s location. While it is not mandatory to be sent on the issuance record, for partners with retail locations including e-commerce, this field should be populated.
Example: |
sponsorCode * |
Alpha-numeric value used to identify the Partner.
Example: |
tender |
The method of payment used to pay for the transaction at checkout.
Example: |
provider |
The provider of these transactions to AIR MILES. This can be the Partner Name or their data provider name.
Example: |
program |
The program for which these transactions are being sent. If you are part of the core AIR MILES Reward Program, then this value is always “AIRMILES"
Example: |
Sample response
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. |