The purpose of this documentation is to provide a guide on how to integrate with the AIR MILES Cash API. As part of this documentation, we also include information on RESTful HTTPS requests/responses, error codes, the reconciliation process and integration environments.
Target audience
This material is intended to be used by a Partner wishing to integrate with the AIR MILES Cash API.
What is real-time redemption
The AIR MILES real-time platform provides Partners with a streamlined method for redeeming Collector’s AIR MILES Cash Reward Miles, online or in-store. Real-time redemption ensures your customer’s will be able to see their updated balances immediately before and after using their AIR MILES Cash Reward Miles.
Tip
Collectors maintain one account, but have two balances (AM Cash and Dream Miles).
Reward Miles earned in the AM Cash balance can be used as in-store redemptions at checkout.
95 AM Cash Reward Miles can be redeemed for $10, processed as an in-store purchase (at participating sponsor locations).
Collectors can redeem up to a maximum of $750 a day across all participating sponsors.
Service level objective
Please contact our Partner support team for details on our Service Level Agreement (SLA). Refer to our “Escalation Guide” for contact details.
Integration environments
There are two sets of environments used by partners to integrate with the real-time checkout platform. These environments are configured similarly for consistent production-level quality, whether the partner has deployed to production or is still performing non-production testing.
Contains production code and live user data for real-world 3rd party integrations.
Note
All integration environments must be accessed via HTTPS only.
Your AMRP project team
In preparation for launch, an AIR MILES team is pulled together to assist Partners with integration and setup. This team will provide the following services:
Consulting Partners on the best technical solution to support AIR MILES Issuance based on system compatibility.
Providing guidance for assessing Partner requirements, data exchange methods, and reconciliation.
As well as overseeing a broad range of activities to meet the requirements of launch, including:
Planning
Communications
Delivery
Execution
Monitoring
Commonly used acronyms
Name
Definition
AMRP
AIR MILES Rewards Program: The loyalty program itself consisting both AIR MILES issuance an redemption processes.
AMRM
AIR MILES Rewards Miles: The loyalty program currency that Collectors earn and redeem for travel, merchandise and cash rewards.
RTC
Real-Time Checkout: An AIR MILES API platform specifically tailored for “Real-Time Issuance” & redemption of AIR MILES “Reward Miles”.
M2M
Machine-to-Machine: Refers to direct communication between devices using any communications channel, including wired and wireless. This includes CLIs, daemons, or services running on your back-end that self-authenticates and/or authorizes an application without collector interaction.
POS
Point-of-Sale: Refers to the software/hardware component that handles transactional messages, as well as processing AIR MILES issuances and reversals (return transactions).
1 - Authentication & Authorization
The AIR MILES security layer granting access to member APIs and associated services.
For more information on “Auth0” and the various authentication flows, click the button below.
2 - API Library
This section includes the four (4) AIR MILES Cash API endpoints listed below. Each page offers a brief summary of the API endpoint in question, common use-case scenarios, and sample request/response messages with response codes.
Used to refund (aka reverse) an AM Cash Miles redemption.
Idempotent requests
All the API calls shown above (excluding ECHO & INQUIRY) support idempotency for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. For example, if a request to redeem miles from a Collector does not receive a response due to a network connection error, you can retry the request with the same idempotency key to guarantee that additional miles aren’t accidentally redeemed from the Collector’s account.
Note
To perform an idempotent request, you need to provide an additional Idempotency-Key: <key> header to the request.
What is an “Idempotency Key”
An “Idempotency Key” is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions.
WARNING
If you omit the header in the request, then the content of the transaction itself will be used to detect if it’s a duplicate. This requires that you send the exact same request as before, including an identical timestamp. This process however does not guarantee idempotency and should only be used as a last resort.
As described above, the RESTful specification defines a transaction as a pair of request and response messages that are used for information interchange.
Note
Mandatory parameters will be marked with an asterisk (*) in the subsequent pages.
Message Type
Description
Request
All mandatory parameters MUST be included in each API call.
All other parameters are optional, unless stated otherwise.
Response
Indicates which parameters/elements are always returned.
The “Response” Content-Type is specified in the Header (e.g., application/json.
A “Response” resulting in an ‘error condition’ will include an accompanying responseCode.
Partners are expected to verify and handle each Response Code as necessary.
All response values are NOT not case-sensitive.
Data elements that contain null or ‘empty’ values are automatically excluded from the response body.
The ‘POS’ terminal may use the response elements to display/print information for the customer.
Handling request timeouts
A request timeout has likely occurred if either of the following are true.
You received a Response Code of 0008
You didn’t receive any response at all
Upon experiencing a request timeout, your POS terminal should immediately attempt to retry the same request. The reattempted request MUST be identical to the initial request.
Important
If the new request does not match exactly with the initial request, the system will not recognize it as a “retry” request, but will register it as a brand new transaction. If the request continues to timeout and/or fail, an error message should be displayed to the cashier, as suggested in the section Displaying the reversal result.
If at any time, AIR MILES real-time encounters an internal problem or network error while trying to return a “redemption response” to the partner, the redemption request will be automatically cancelled. Thereby ensuring the customer is not charged for a redemption that could not be redeemed.
Note
If the retry succeeds, then the transaction must be included in the reconciliation report sent to AIR MILES.
If the retry fails, the transaction must NOT be included in the reconciliation report, as no Miles were processed for the transaction.
For all other Response codes; when a particular code is received (e.g., 0002, 0096, etc.), the appropriate message should be displayed to the cashier, as shown in POS Workflows > Redemption.
Status/response codes
Status Code
Response Code
Display Message
Description
200
0000
Approved
The transaction was successful. The POS terminal AND receipt should display the appropriate information.
202
0001
Approved - balance suppressed
The transaction was successful, however the Collector opted to not view their rewards balances. The printed receipt MUST NOT show the Collector’s ‘Cash’/‘Dream’ balances, or the available “AM Cash” that can be redeemed.
401
0002
Collector account inactive
The Collector account is not active. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center.
408
0008
Transaction timeout
The transaction timed out when a request was sent to the “Instant POS” Switch. The Partner’s Switch/POS Terminal should retry the request one (1) time. If a cashier receives this error, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
403
0009
Card not swiped or scanned
Redemption offers will not be sent if the Collector Card is not presented. The Collector Card is physically required to perform instant cash redemptions. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
401
0025
Invalid Collector number
The Collector number is invalid. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
400
0035
Invalid request parameter
A mistake was made when submitting the request. Please correct the error and try again.
202
0051
Insufficient reward miles
The Collector has not earned enough in their “AIR MILES Cash” balance for the requested redemption amount. Please ask the Collector to go to airmiles.ca and check their redemption/earning history.
400
0057
Invalid redemption confirmation number
The redemptionConfirmationNumber submitted is invalid. Please resubmit the request with the correct Redemption Confirmation Number.
202
0065
Exceeded daily redemption limit
The Collector has exceeded the daily redemption limit. The Collector’s account has exceeded the maximum daily redemption amount. Please ask the Collector to wait until the following day to redeem more Cash miles.
202
0066
Insufficient basket size
The Collector’s basket size is too small to make a redemption. The purchase amount is not enough to make a redemption. Ask the customer if they wish to add more items to their basket in order to make an AM Cash redemption.
408
0067
Offer is temporarily unavailable
The offer being requested is temporarily unavailable. Please advise the Collector to try redeeming this offer at a later time.
409
0080
Reversal window expired
The reversal window for the redemption has expired; meaning a reversal can no longer be submitted for this transaction. This usually happens when a reversal is attempted after 3:00 AM the day after the original transaction. Any reversals that are attempted past the 3:00 AM time-frame should be refunded to the customer via in-store credit or gift card. Please DO NOT RETURN CASH to the customer.
503
0092
Scheduled outage
The system is unavailable due to scheduled maintenance. No requests can be sent.
500
0096
Server error or no response
An unknown error occurred while calling the “Instant POS” Switch". The Sponsor Switch/POS Terminal should retry one time and if the error persists, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
null
null
Missing or invalid “bearer” token
No valid “Bearer Token” present. Please generate a valid “Bearer” Token and submit to continue."
2.1 - ECHO
Used to test and confirm that the real-time checkout platform is up and ready to process requests.
This test ensures there are no known connectivity issues between AIR MILES and our partners. The ECHO call functions similarly to a standard ‘ping’ request, determining if a client or host is online and accessible. To receive a “Bearer Token” and authorize your request, use the client_id/client_secret provided to you by AIR MILES.
Note
It is highly recommended that all Partners use the ECHO test upon starting their integration, to ensure both systems can communicate properly. Also at the partner’s discretion, we recommend performing periodic ECHO tests at regular intervals to be notified immediately in the case of any unforeseen outages.
Includes all “Request” parameters listed above, plus the additional ones below.
Parameter
Description
message
Text description of the response code.
Example: "Approved"
responseCode
Number indicating the result of the transaction.
Example: "0000"
0000: Request processed successfully
0001: Approved (balance suppressed).
0002: Collector profile inactive.
0005: Unable to redeem (balance suppressed).
0006: Unable to redeem.
0008: Transaction timed-out, request needs to be retried.
0009: Card not swiped or scanned.
0025: Invalid collector number.
0035: Invalid request parameter.
0051: Insufficient AIR MILES Cash Miles.
0057: Invalid redemption confirmation number.
0065: Exceeded daily redemption limit.
0066: Insufficient basket size.
0067: Offer is temporarily unavailable.
0080: Reversal window expired.
0092: Scheduled outage.
0096: System error.
transDateTime
Date and time when the response was sent. (see ISO-8601)
Example: "1972-07-16T13:32:00+0400"
Note
Responses will always include the responseCode and message fields. If the original request was successful, the response will include the same parameters sent in the request body.
Status/Response codes
Status Code
Response Code
Display Message
Description
200
0000
Approved
The transaction was successful. The POS terminal AND receipt should display the appropriate information.
408
0008
Transaction timeout
The transaction timed out when a request was sent to the “Instant POS” Switch. The Partner’s Switch/POS Terminal should retry the request one (1) time. If a cashier receives this error, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
400
0035
Invalid request parameter
A mistake was made when submitting the request. Please correct the error and try again.
503
0092
Scheduled outage
The system is unavailable due to scheduled maintenance. No requests can be sent.
500
0096
Server error or no response
An unknown error occurred while calling the “Instant POS” Switch". The Sponsor Switch/POS Terminal should retry one time and if the error persists, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
none
none
Missing or invalid Bearer token
No valid Bearer token present. Please generate a valid Bearer token and submit to continue."
2.2 - INQUIRE
Used to retrieve account balances and AIR MILES Cash offer information.
Used to retrieve account balances and AIR MILES Cash offer information. Once a Partner receives a response, the POS terminal can acquire the reward miles Cash/Dream balances.
Note
These balances SHOULD be shown on the Collector’s sales-receipt, but SHOULD NOT be displayed on the POS terminal. The receipt and/or POS terminal may also display the Collector’s remaining daily availableCashBalance and availableDollarAmount taken from the response.
See the Response Model below for more information - or, for additional details on Response Messages and POS System Integration, please refer to POS Terminal Workflows.
Includes all “Request” parameters listed above, plus the additional ones below.
Parameter
Description
availableCashBalance
The remaining available daily limit of AM Cash redemptions, in Miles (post-transaction); or the Collector’s total Miles balance - whichever is lower.
Example: "95"
Standard default is $750 CAD or 7,125 Miles per day
availableDollarAmount
The dollar ($) amount available that the Collector can redeem.
Example: "10"
This value is rounded down to the nearest $10
availableOfferUnits
The number of AM Cash units available to the Collector at checkout (in multiples of $10/95 miles).
Example: "1"
cashBalance
The Collector’s “AM Cash” account balance in Miles (post-transaction).
Example: "120"
dailyOfferLimit
The limit of AM Cash units the Collector can redeem today.
Example: "1"
dreamBalance
The Collector’s “AIR MILES Dream” account balance.
Example: "550"
message
Text description of the response code.
Example: "Approved"
offerDescEn
Offer description (English)
offerDescFr
Offer description (French)
offerId
AM Cash offer ID.
Example: "1111111111"
offerType
Either RGL (regular offers) or SPL (special/discounted offers).
Example: ["RGL", "SPL"]
responseCode
Number indicating the result of the transaction.
Example: "0000"
0000: Request processed successfully.
0001: Approved (balance suppressed).
0002: Collector profile inactive.
0005: Unable to redeem (balance suppressed).
0006: Unable to redeem.
0008: Transaction timed-out, request needs to be retried.
0009: Card not swiped or scanned.
0025: Invalid collector number.
0035: Invalid request parameter.
0051: Insufficient AIR MILES Cash Miles.
0057: Invalid redemption confirmation number.
0065: Exceeded daily redemption limit.
0066: Insufficient basket size.
0067: Offer is temporarily unavailable.
0080: Reversal window expired.
0092: Scheduled outage.
0096: System error.
transDateTime
Date and time when the response was sent. (see ISO-8601)
Example: "1972-07-16T13:32:00+0400"
unitValueAMCash
The number of AM Cash miles required for a single redemption unit.
Example: "95"
unitValueDollars
The dollar ($) value for a single unit of redemption.
Example: "10"
Note
Responses will always include the responseCode and message fields. In addition, all fields that contain values (i.e., not null) will also be included in the response model.
Conditional parameters
The optional data elements contain information required to show the number of miles that can be redeemed and the discount that would be applied towards the purchase.
Note
The conditional response parameters listed below will ONLY be returned if the following conditions are met:
The Collector number is swiped or scanned (i.e., cardEntryMode = SWIPE, SCAN, or PREREGISTERED)
The Collector has enough reward miles in their balance.
The Collector has not exceeded their daily redemption limit.
Parameter
Description
availableOfferUnits
Redemption offer units available for the current transaction.
Example: "1"
(i.e., 1 unit = $10, so 5 units = $50 in redemptions.)
dailyOfferLimit
The maximum number of units a Collector can redeem in a single day (i.e., a 24 hour period).
Example: "10"
offerDescEn
Offer description (English)
offerDescFr
Offer description (French)
offerId
AM Cash offer ID.
Example: "1111111111"
offerType
Either RGL (regular offers) or SPL (special/discounted offers).
Example: ["RGL", "SPL"]
unitValueAMCash
The number of “AM Cash” miles required for a single redemption unit.
Example: "95"
unitValueDollars
The dollar ($) value for a single unit of redemption.
Example: "10"
Status/Response codes
Status Code
Response Code
Display Message
Description
200
0000
Approved
The transaction was successful. The POS terminal AND receipt should display the appropriate information.
202
0001
Approved - Balance suppressed
The transaction was successful, however the Collector opted to not view their rewards balances. The printed receipt MUST NOT show the Collector’s ‘Cash’/‘Dream’ balances, or the available “AM Cash” that can be redeemed.
401
0002
Collector account inactive
The Collector account is not active. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center.
202
0005
Balance suppressed, unable to redeem
The transaction was successful, but the Collector opted to not view their balances, or allow instant cash redemptions. The POS terminal MUST NOT prompt for an “AM Cash” Redemption.
202
0006
Unable to redeem
The transaction was successful, but the Collector account is set to not allow instant “AM Cash” redemptions. The POS terminal MUST NOT prompt for an “AM Cash” Redemption.
408
0008
Transaction timeout
The transaction timed out when a request was sent to the “Instant POS” Switch. The Partner’s Switch/POS Terminal should retry the request one (1) time. If a cashier receives this error, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
403
0009
Card not swiped or scanned
Redemption offers will not be sent if the Collector Card is not presented. The Collector Card is physically required to perform instant cash redemptions. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
401
0025
Invalid collector number
The Collector number is invalid. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
400
0035
Invalid request parameter
A mistake was made when submitting the request. Please correct the error and try again.
202
0051
Insufficient AIR MILES reward Miles
The Collector has not earned enough in their “AIR MILES Cash” balance for the requested redemption amount. Please ask the Collector to go to airmiles.ca and check their redemption/earning history.
408
0067
Offer is temporarily unavailable
The offer being requested is temporarily unavailable. Please advise the Collector to try redeeming this offer at a later time.
503
0092
Scheduled outage
The system is unavailable due to scheduled maintenance. No requests can be sent.
500
0096
Server error or no response
An unknown error occurred while calling the “Instant POS” Switch". The Sponsor Switch/POS Terminal should retry one time and if the error persists, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
none
none
Missing or invalid “Bearer token”
No valid “Bearer Token” present. Please generate a valid “Bearer” Token and submit to continue."
2.3 - REDEEM
Used to redeem AIR MILES Cash Miles from a Collector’s account to be used towards their purchase.
To redeem Miles, the Collector’s card must be either scanned, swiped, or pre-registered (e.g., e-commerce site).
Important
Key-entering the Collector’s number manually is not a valid way to process a redemption request. Using this method will cause the transaction to fail.
Redemption process
The sales associate makes a redemption request at checkout by submitting a dollarRedeemRequest.
The maximum redemption amount is displayed on-screen, which is less than or equal to the postTaxBasketAmount.
The sales associate selects the appropriate redemption amount (unitsRedeemed) before completing the transaction.
Tip
Default redemption amount to be displayed
The total purchase amount after tax, rounded down to the nearest $10. (e.g., if the post-tax basket amount is $43.35, the maximum allowable redemption would be $40)
Or, the Collector’s maximum redeemable Cash balance - in multiples of $10.
Calculating the dollar amount
The dollar amount to be applied towards the purchase is calculated by multiplying the number of unitsRedeemed by unitValueDollars (which is currently $10 CAD).
Upon receiving the redemption response from our real-time checkout, the POS terminal should display and print the transaction confirmation number (i.e., txtConfirmationNumber).
Includes all “Request” parameters listed above, plus the additional ones below.
Parameter
Description
availableCashBalance
The remaining available daily limit of AM Cash redemptions, in Miles (post-transaction); or the Collector’s total Miles balance - whichever is lower.
Example: "95"
Standard default is $750 CAD or 7,125 Miles per day
availableDollarAmount
The dollar ($) amount available that the Collector can redeem.
Example: "10"
This value is rounded down to the nearest $10
cashBalance
The Collector’s AM Cash account balance in Miles (post-transaction).
Example: "120"
dailyOfferLimit
The maximum number of units a Collector can redeem in a single day (i.e., a 24 hour period).
Example: "10"
dreamBalance
The Collector’s “AIR MILES Dream” account balance.
Example: "545"
message
Text description of the response code.
Example: "Approved"
milesRedeemed
The number of AM Cash miles redeemed in the transaction.
Example: "475"
offerDescEn
Offer description (English)
offerDescFr
Offer description (French)
offerId
AM Cash offer ID.
Example: "1111111111"
offerType
Either RGL (regular offers) or SPL (special/discounted offers).
Example: ["RGL", "SPL"]
responseCode
Number indicating the result of the transaction.
Example: "0000"
0000: Request processed successfully.
0001: Approved (balance suppressed).
0002: Collector profile inactive.
0005: Unable to redeem (balance suppressed).
0006: Unable to redeem.
0008: Transaction timed-out, request needs to be retried.
0009: Card not swiped or scanned.
0025: Invalid collector number.
0035: Invalid request parameter.
0051: Insufficient AIR MILES Cash Miles.
0057: Invalid redemption confirmation number.
0065: Exceeded daily redemption limit.
0066: Insufficient basket size.
0067Offer is temporarily unavailable.
0080: Reversal window expired.
0092: Scheduled outage.
0096: System error.
transDateTime
Date and time when the response was sent. (see ISO-8601)
Example: "1972-07-16T13:32:00+0400"
txnConfirmationNumber
The confirmation number returned upon a successful redemption. This value should be printed on the purchase receipt and is required to process a reversal.
Example: "83445182010"
To be provided by AIR MILES
unitsRedeemed
The number of AM Cash units redeemed in the transaction.
Example: "5"
unitValueAMCash
The number of AM Cash miles required for a single redemption unit.
Example: "95"
unitValueDollars
The dollar ($) value for a single unit of redemption.
Example: "10"
Note
Responses will always include the responseCode and message fields. In addition, all fields that contain values (i.e., not null) will also be included in the response model.
Status/Response codes
Status Code
Response Code
Display Message
Description
200
0000
Approved
The transaction was successful. The POS terminal AND receipt should display the appropriate information.
202
0001
Approved - balance suppressed
The transaction was successful, however the Collector opted to not view their rewards balances. The printed receipt MUST NOT show the Collector’s ‘Cash’/‘Dream’ balances, or the available “AM Cash” that can be redeemed.
401
0002
Collector account inactive
The Collector account is not active. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center.
202
0005
Balance suppressed, unable to redeem
The transaction was successful, but the Collector opted to not view their balances, or allow instant cash redemptions. The POS terminal MUST NOT prompt for an “AM Cash” Redemption.
202
0006
Unable to redeem
The transaction was successful, but the Collector account is set to not allow instant “AM Cash” redemptions. The POS terminal MUST NOT prompt for an “AM Cash” Redemption.
408
0008
Transaction timeout
The transaction timed out when a request was sent to the “Instant POS” Switch. The Partner’s Switch/POS Terminal should retry the request one (1) time. If a cashier receives this error, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
403
0009
Card not swiped or scanned
Redemption offers will not be sent if the Collector Card is not presented. The Collector Card is physically required to perform instant cash redemptions. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
401
0025
Invalid collector number
The Collector number is invalid. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
400
0035
Invalid request parameter
A mistake was made when submitting the request. Please correct the error and try again.
202
0051
Insufficient AIR MILES reward Miles
The Collector has not earned enough in their “AIR MILES Cash” balance for the requested redemption amount. Please ask the Collector to go to airmiles.ca and check their redemption/earning history.
202
0065
Exceeded daily redemption limit
The Collector has exceeded the daily redemption limit. The Collector’s account has exceeded the maximum daily redemption amount. Please ask the Collector to wait until the following day to redeem more Cash miles.
202
0066
Insufficient basket size
The Collector’s basket size is too small to make a redemption. The purchase amount is not enough to make a redemption. Ask the customer if they wish to add more items to their basket in order to make an AM Cash redemption.
408
0067
Offer is temporarily unavailable
The offer being requested is temporarily unavailable. Please advise the Collector to try redeeming this offer at a later time.
503
0092
Scheduled outage
The system is unavailable due to scheduled maintenance. No requests can be sent.
500
0096
Server error or no response
An unknown error occurred while calling the “Instant POS” Switch". The Sponsor Switch/POS Terminal should retry one time and if the error persists, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
none
none
Missing or invalid “Bearer token”
No valid “Bearer Token” present. Please generate a valid “Bearer” Token and submit to continue."
2.4 - REVERSE
Used to refund (aka reverse) an AM Cash Miles redemption.
Prior to requesting a “reversal”, a valid “redemption request”/“redemption response” must be exchanged in order to create the txnConfirmationNumber required for the “reversal”.
WARNING
Key-entering the Collector’s number manually is not a valid way to process a redemption request. Using this method will cause the transaction to fail.
Also, please note that reversals can only be issued up until 3:00 AM EST the same day of the purchase, for a given transaction.
Reversal process
The sales associate makes a REVERSAL request at checkout by submitting the redemptionConfirmationNumber for the transaction in question.
The POS system will prompt the sales associate to accept the return and issue a full monetary refund.
Once completed, a response message containing all relevant fields will be returned to the POS system.
Tip
Calculating the reversal amount
The AM Cash API will calculate the Miles to reversed to the Collector when processing a reversal request. This number is based on the transaction ID of the original transaction, which is why it’s required to provide the redemptionConfirmationNumber before proceeding.
Upon receiving the reversal response from our real-time checkout, the POS terminal should display and print the transaction confirmation number (i.e., txtConfirmationNumber).
Receiving a timeout
If you receive a timeout (i.e., responseCode 0008) or you receive NO response at all, your POS terminal should automatically retry the reversal request. If the error persists, the POS terminal should display an error message (as explained in POS Terminal Workflows > Processing a Reversal).
Includes all “Request” parameters listed above, plus the additional ones below.
Parameter
Description
availableCashBalance
The remaining available daily limit of AM Cash redemptions, in Miles (post-transaction); or the Collector’s total Miles balance - whichever is lower.
Example: "95"
Standard default is $750 CAD or 7,125 Miles per day
availableDollarAmount
The dollar ($) amount available that the Collector can redeem.
Example: "10"
This value is rounded down to the nearest $10
cashBalance
The Collector’s AM Cash account balance in Miles (post-transaction).
Example: "120"
dreamBalance
The Collector’s “AIR MILES Dream” account balance.
Example: "550"
message
Text description of the response code.
Example: "Approved"
milesReversed
The number of AM Cash miles reversed (refunded).
Example: "95"
responseCode
Number indicating the result of the transaction.
Example: "0000"
0000: Request processed successfully.
0001: Approved (balance suppressed).
0002: Collector profile inactive.
0005: Unable to redeem (balance suppressed).
0006: Unable to redeem.
0008: Transaction timed-out, request needs to be retried.
0009: Card not swiped or scanned.
0025: Invalid collector number.
0035: Invalid request parameter.
0051: Insufficient AIR MILES Cash Miles.
0057: Invalid redemption confirmation number.
0065: Exceeded daily redemption limit.
0066: Insufficient basket size.
0067Offer is temporarily unavailable.
0080: Reversal window expired.
0092: Scheduled outage.
0096: System error.
transDateTime
Date and time when the response was sent. (see ISO-8601)
Example: "1972-07-16T13:32:00+0400"
txnConfirmationNumber
The confirmation number returned upon a successful redemption. This value should be printed on the purchase receipt and is required to process a reversal.
Example: "83445182010"
To be provided by AIR MILES
unitsReversed
The number of AM Cash units reversed (refunded).
Example: "1"
unitValueAMCash
The number of AM Cash miles required for a single redemption unit.
Example: "95"
unitValueDollars
The dollar ($) value for a single unit of redemption.
Example: "10"
Note
Responses will always include the responseCode and message fields. In addition, all fields that contain values (i.e., not null) will also be included in the response model.
Status/Response codes
Status Code
Response Code
Display Message
Description
200
0000
Approved
The transaction was successful. The POS terminal AND receipt should display the appropriate information.
202
0001
Approved - balance suppressed
The transaction was successful, however the Collector opted to not view their rewards balances. The printed receipt MUST NOT show the Collector’s ‘Cash’/‘Dream’ balances, or the available “AM Cash” that can be redeemed.
401
0002
Collector account inactive
The Collector account is not active. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center.
408
0008
Transaction timeout
The transaction timed out when a request was sent to the “Instant POS” Switch. The Partner’s Switch/POS Terminal should retry the request one (1) time. If a cashier receives this error, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
403
0009
Card not swiped or scanned
Redemption offers will not be sent if the Collector Card is not presented. The Collector Card is physically required to perform instant cash redemptions. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
401
0025
Invalid collector number
The Collector number is invalid. Please ask the Collector to visit the airmiles.ca self-serve page, online chat support, or contact our call-center to request a replacement card.
400
0035
Invalid request parameter
A mistake was made when submitting the request. Please correct the error and try again.
202
0051
Insufficient AIR MILES reward Miles
The Collector has not earned enough in their “AIR MILES Cash” balance for the requested redemption amount. Please ask the Collector to go to airmiles.ca and check their redemption/earning history.
400
0057
Invalid redemption confirmation number
The redemptionConfirmationNumber submitted is invalid. Please resubmit the request with the correct Redemption Confirmation Number.
202
0065
Exceeded daily redemption limit
The Collector has exceeded the daily redemption limit. The Collector’s account has exceeded the maximum daily redemption amount. Please ask the Collector to wait until the following day to redeem more Cash miles.
202
0066
Insufficient basket size
The Collector’s basket size is too small to make a redemption. The purchase amount is not enough to make a redemption. Ask the customer if they wish to add more items to their basket in order to make an AM Cash redemption.
408
0067
Offer is temporarily unavailable
The offer being requested is temporarily unavailable. Please advise the Collector to try redeeming this offer at a later time.
409
0080
Reversal window expired
The reversal window for the redemption has expired; meaning a reversal can no longer be submitted for this transaction. This usually happens when a reversal is attempted after 3:00 AM the day after the original transaction. Any reversals that are attempted past the 3:00 AM time-frame should be refunded to the customer via in-store credit or gift card. Please DO NOT RETURN CASH to the customer.
503
0092
Scheduled outage
The system is unavailable due to scheduled maintenance. No requests can be sent.
500
0096
Server error or no response
An unknown error occurred while calling the “Instant POS” Switch". The Sponsor Switch/POS Terminal should retry one time and if the error persists, they should escalate the issue as indicated in the “AM Cash - Sponsor Escalation Guide”.
none
none
Missing or invalid “Bearer token”
No valid “Bearer Token” present. Please generate a valid “Bearer” Token and submit to continue."
Handling timeouts
A request timeout has occurred if either of the following scenarios is true:
You received a “response code” of 0008
You received no response at all
Upon experiencing a request timeout, your POS terminal should immediately attempt a retry of the same transaction request. The “Retry Request” must match the initial request exactly.
If the new request does not match exactly with the initial request, the system will not recognize it as a “retry”, but will register it as a brand new transaction. If the request continues to timeout/fail, an error message should be displayed to the cashier and/or the customer, as suggested in the section Displaying the reversal result.
If at any time, our real-time checkout encounters an internal problem or network error while trying to return a “redemption response”; the redemption request will be automatically cancelled, thereby ensuring the customer is not charged for a redemption that could not be delivered.
For all other response codes; when a particular code is received (e.g., 0002, 0096, etc.), the appropriate message should be displayed to the cashier, as shown in POS Workflows > Redemption.
Important
Notes regarding “file reconciliation”:
If the retry succeeds then the transaction must be included in the reconciliation report sent to AIR MILES.
If the retry fails, the transaction MUST NOT be included in the reconciliation report, as no Miles were processed for the transaction.
3 - AIR MILES Cash API Docs
4 - Point-of-Sale Terminal Workflows
How to best display AIR MILES Cash redemption details on your POS terminals.
This page provides POS (Point-of-Sale) display mock-ups which demonstrate the preferred method for displaying AM Cash transaction details to the customer.
Display Types
Pop-up displays
From here onward, we are assuming that your terminals can display a pop-up window over the main terminal display. However if your terminals have a more limited display functionality, a similar display interface can be built by integrating the new “AIR MILES Cash” elements into the main display area; this is shown in figure 1 below.
Text-based displays
There are also display mockups for text-based POS terminals. These mockups assume that the POS terminal has at least twenty (20) columns and four (4) rows. Throughout this section, the two mockups will be shown side-by-side where possible, to contrast the different interfaces.
Processing a Redemption
Upon receiving an AM Cash Inquiry response, the POS terminal should display relevant offer information to the Collector, which at a minimum should include the remaining daily limit of AM Cash units the Collector can request.
AM Cash Redemption Facts
95 Miles = 1 unit of AM Cash
1 unit of AM Cash = $10.00 in store credit
Daily AM Cash redemptions limited to 20 units (or $200.00 in store credit)
Collector is required to have a minimum of 95 Cash Miles in their AIR MILES balance before making a redemption request
Daily restriction time-frames reset each day at 03:00AM EST See figure 3 below for more details
AIR MILES Cash Inquiry
In the example above, the AM Cash “Inquiry” screen displays the following key values:
Value
Description
95
The number of reward Miles per unit.
10
The dollar (monetary) amount per unit.
3
The maximum number of units that can be redeemed for this transaction.
20
The maximum number of units that can be redeemed for the day.
As previously stated, an offer is returned ONLY if the Collector has enough reward Miles to redeem at least a single unit AND have not reached their daily redemption cap. If no offer is returned, the POS terminal won’t display any of the information shown above.
Tip
The Real-time Checkout platform returns units that can be redeemed, it DOES NOT return a dollar/monetary amount, nor does it return a bulk number of reward Miles. However, as explained above, it does return the set dollar amount and number of reward Miles per unit, so a quick multiplication is enough to calculate and display the quantities shown in figure 2 above.
The Collector can redeem for a minimum of 95 reward Miles (which is equivalent to $10.00 CAD.), as well as further increments of 95 reward Miles.
Note
The maximum redemption for a purchase is 285 reward Miles (or 95 Miles * 3 Units), which equals a maximum redemption rate of $30.00 CAD per transaction.
The daily maximum redemption limit is 1,900 reward Miles (or 95 Miles * 20 Units), which equals a daily maximum redemption rate of $200.00.
If the AM Cash inquiry response has an offer available for the Collector, the POS terminal should give the cashier a visual cue, so they can ask the Collector for redemption.
We recommend using one of the following options:
Preferred method
Pop-up window with AIR MILES Cash information.
For embedded interfaces
Blinking cue for embedded AIR MILES Cash section.
Alternative method
If there is no way to do either of the above, have the cashier click an on-screen button to activate the AIR MILES Cash section.
Displaying on a text-based POS
Similar to the GUI-based screens shown above, a text-based terminal should display the minimum and increment values together with the maximum allowed (based on the qualifying amount). The Collector at this point has the option to either enter an amount or cancel and proceed with the remaining purchase flow.
Here’s an example of what a text-based display would look like.
Displaying the Redemption
After the redemption request is sent and a response is received by the POS terminal, the redemption information can be shown as follows.
The POS terminal should display the following:
Transaction confirmation number
txnConfirmationNumber
Number of reward Miles redeemed
unitValueAMCash * unitsredeemed
Remaining reward Miles for redemption
cashBalance / unitValueAMCash
Displaying on a text-based POS
A text-based POS terminal could display the redemption information as follows.
Following this screen, the rest of the payment flow continues normally.
Important
Due to the restricted display size, a text-based POS terminal does not have to display the transaction confirmation number (txnConfirmationNumber) and available reward Miles (cashBalance) to the customer and/or cashier; however, the printed receipt MUST ALWAYS include this information.
Text-based POS terminals that have the capability should display the number of reward Miles redeemed.
Printing the receipt
This section provides a mockup of what a receipt could look like.
The receipt shown above follows the examples that has been used so far and shows the following:
Purchase details (item/basket info - includes a negative balance if returning a product).
Sub-total, added sales tax, and total.
Transaction confirmation number together with the dollar/monetary amount of the redemption.
AIR MILES specific basket details
Masked Collector number (at least 3-digits in the middle must be masked, and the last four digits visible).
Base and bonus AIR MILES reward Miles redeemed.
Available “AIR MILES Cash” Rewards Miles balance.
Available “AIR MILES Dream” Rewards Miles balance.
Note
For privacy reasons the Collector number must always be masked when appearing on a receipt or any other print/display materials!
Processing a Reversal
In order to reverse a redemption all that is needed is the original redemption confirmation number, as the redemption is fully reversed (no partial reversals are done).
This is demonstrated in figure 7 below:
The AM Cash reversal function should be made available to the cashier by way of a button or on-screen-display. Once this screen is displayed the cashier will need to enter the transaction confirmation number (txnConfirmationNumber) and press a key to process the reversal (such as the Void button shown in the figure above).
Important
As mentioned previously, a reversal can only be processed up until 03:00AM EST (the same day of the original transaction). This means that if a redemption is completed at 01:00AM EST, then the Collector has only two (2) hours to reverse the transaction and recover their AIR MILES.
Displaying the reversal
After a reversal request has been processed, a response containing a new transaction confirmation number should be received.
This is demonstrated in figure 8 below.
The POS terminal should display the total Miles refunded (milesReversed), the available reward Miles (cashBalance) and the new reversal confirmation number (txnConfirmationNumber).
Printing the receipt
This section provides a mockup of how a receipt showing balances and redemption information could be organized.
See figure 9 below for more details:
The receipt shown above follows the examples that has been used so far and shows the following:
Purchase details (item/basket info - includes a negative balance if returning a product).
Sub-total, added sales tax, and total.
Transaction confirmation number together with the dollar/monetary amount of the redemption.
AIR MILES specific basket details
Masked Collector number (at least 3-digits in the middle must be masked, and the last four digits visible).
Base and bonus AIR MILES reward Miles voided/reversed (calculated by the partner).
Available “AIR MILES Cash” Rewards Miles balance.
Available “AIR MILES Dream” Rewards Miles balance.
5 - File Reconciliation
Used to ensure “Redemption” and “Reverse” transactions match in both the Partner’s and AIR MILES systems.
A Reconciliation process has been established to ensure that successful “Redemption” and “Reverse” transactions match in both the partner’s systems and AIR MILES systems. This matching ensures that the number of transactions in both systems and the transaction values (e.g., amounts, dates) are identical.
What are reconciliation files
The Reconciliation files are sent to the Partner at regular intervals, and contain all successful Redemptions and Reversals that were reconciled on a given day.
The following sections describe the Reconciliation process, files, formats, and file transfer methods.
File formats and schedules
Each Reconciliation file contains the following:
Header Records x2
Trailer Records x2
Detailed Records 0 or more
Reconciliation files are text-based and have a specific format (described below), use delimiters to separate fields, and are uncompressed & un-encrypted. Records within the reconciliation file use the standard ASCII character set, where fields within a record are separated by double percent characters (%%), and records are separated by a new line character at the end of each line.
Since fields in the file records are delimited with percentage characters (%%) there is no need for fillers or padding. As an example, the “amount” field is defined as Numeric and 4 characters in length, so in order to send 190 Miles, it is enough to send just those three digits (i.e., there is no need to send 0190). Similarly, the “Card Terminal ID” is defined as Alphanumeric and 16 characters in length, so in order to send the characters SPON000101 there is no need to append filler spaces at the end of those characters.
Note
All examples in the following sections are based on regular runs containing data for a standard 24-hour period, with cut-off at 12:00AM EST.
During normal processing times, reconciliation files will be created at regular intervals. For resubmissions, the files may contain more (or less) than 24-hours of transactions, and may include a different time range. However, in all instances the “Local Transaction Date/Time” of all records within the file must be between the BeginExtractDate and EndExtractDate values in the “Header” and “Trailer” records (see an example of the file format below).
Files sent to the partner
The naming of the reconciliation file uses the following format:
RECON_LMG_YYYYMMDD.txt
As an example, a reconciliation file created on July 19, 2020 would be named RECON_LMG_20200719.txt.
Tip
The YYYYMMDD value should represent the file creation date (e.g., 20200625 for June 25, 2020). These files are transferred from AIR MILES after 2:00PM EST.
The BeginExtractDate in the header and trailer records is the earliest time boundary for all detailed records in the file - likewise, the EndExtractDate is the latest time boundary for the detailed records. This means that the local transaction date & time of all the detailed records fall within the BeginExtractDate and EndExtractDate date/time frames.
Reconciliation file fields
#
Field
Type (length)
Description
1
Row Type
Alpha (1)
Always ‘D’
2
MTI
Numeric (4)
The values are 2210 for redemptions and 2430 for reversals
3
Collector Number
Numeric (11)
The Collector number
4
Miles Amount
Numeric (4)
Amount (in AIR MILES Reward Miles) of the redemption or reversal
5
System Trace Number
Numeric (12)
Partner issued unique tracking number
6
Local Transaction Time
Numeric (6)
Format: HH24MISS (the time component of Local Date/Time)
7
Local Transaction Date
Numeric (8)
Format: YYYYMMDD (the date component of Local Date/Time)
8
Transaction Confirmation Number
Numeric (12)
The unique identification number included in any “redemption” or “reversal” response message
9
Card Terminal Id
Alphanumeric (16)
Concatenation of sponsorCode, storeId, and deviceId
10
Dollar Amount
Numeric (6, 2)
Format: NNNN.NN (no left padding - the amount in dollars of the redemption or reversal)
File transmission method
The accepted transmission method for receiving the Reconciliation file is via SFTP (Simple File-Transfer-Protocol).