Offer Service
Get currently active offers from AIRMILES.
Table of contents
Offer Service
The purpose of this document is to prvide a guide on how to integrate with the Offer Service API. This documentation will include use cases, request/response
High level
The Offer Service allows for a client to get offers available on the AIR MILES platform. There are two streams the Offer Service can flow, Authenticated and Public. Depending on the flow new functionality is provided by the Offer Service.
These are the API’s avaliable to clients from the Offer Service:
x |
Authenticated |
Public |
/offers |
✅ |
✅ |
/offers/{id} |
✅ |
✅ |
/offers/{id}/state |
✅ |
➖ |
There are more differences between Authenticated and Public, which we will get to when going more in-depth about each of the above API
API Overview
GET /offers
GET a list of offers, with applying filters, sorting, pagination and limits. The Offer API will return all the offers details that are needed to display the offer to the collector.
GET /offers/{id}
GET offer details for a specific offer, same offer object retuned as /offers. This API will also return the offer details for targeted offers without authorization as well as offers not in region.
PUT /offers/{id}/state
PUT offer states at collector-level, which tracking when a collector saved or unsaved an offer, or when a collector opted in to an offer.
Auth vs. Public
Two ways to integrate with any Offer Service API, depending on header.
Authentication
- This allows for partners to request offers that are avaliable to specific collectors (targeted offers), also allows for showing collector their state (saved/opted) for an offers, and allows collector to update the state of an offer.
- NO
Authentication
- This allows viewing of public offers (mass offers), also allows to get details of public offers.
1 - Mapping
Refrence UUID with partner, category and promotions.
This document contains the mappings of UUID’s to Partners, Categories, SubCategories, Promotions.
We can discuss later how Offer Service /offers
API can be used to get some of these mappings aswell.
Region
Code |
Name |
BC |
British Columbia |
AB |
Alberta |
SK |
Saskatchewan |
MB |
Manitoba |
ON |
Ontario |
QC |
Quebec |
TB |
Thunder Bay |
NB |
New Brunswick |
NS |
Nova Scotia |
PE |
Prince Edward Island |
NL |
Newfoundland and Labrador |
NT |
Northwest Territories |
NU |
Nunavut |
YT |
Yukon |
ZZ |
for automated tests |
Partner
Id |
Name |
5058f22a-1f5c-4625-b8ff-ffe116756722 |
TIMBER MART |
33d0cf88-5eae-4186-be03-05092061eed9 |
HP |
63e8543d-fbf7-458e-8712-d25332da3614 |
AIR MILES Travel |
22a2cdfd-ff82-45f6-bc94-c14a3a533922 |
BMO Bank of Montreal |
e914624c-9676-4287-8ce9-04de68dd0507 |
airmilesshops.ca |
87ab4dd0-65b5-41a3-acd2-b97540dc1aff |
United Van Lines |
ef73e58a-db63-4b27-baae-bd1e1d2ae86c |
Peter & Paul’s Gifts |
0c988dcd-b2a9-4391-b2c4-48f0294d5658 |
Canadian Appliance Source |
fbdc481f-3fa4-40e9-b1ca-d4dab4c36c30 |
All Purpose Realty |
11892e84-a87e-48b0-bf13-fcd0be389588 |
Additional AIR MILES Partners |
c13f2e1b-f828-4781-9369-fde0581c400d |
Onlia Insurance |
19e1bb2b-88d4-4b37-be72-262a694ae58d |
National Car Rental |
4a755252-876b-478e-9440-42961525e307 |
Metro |
1563e943-25fd-480b-b77d-94aedc7202af |
LG Electronics |
cbfcd38f-b1c0-4443-881c-c342833649a0 |
Fresh |
91adc45f-0037-4fa8-9424-2e6e8f999467 |
SMASH + TESS |
b90e694d-3510-4cc2-84be-f9b6f61bd31b |
Shell Mobility |
27568f1b-c48d-4c27-8d9b-7c67666308c2 |
Dollarama |
98d43a31-1c04-4db7-bfd3-b9a4a0ced034 |
Mayflower |
9ab6f70f-588e-4460-b14c-ad4ad8c9a524 |
La Vie en Rose |
1b36212c-87a6-448c-82a7-c2f28c8b6d52 |
HelloFresh |
5a92c696-cddd-4255-920e-1f74b121e7ea |
Kernels |
40786f15-10e1-490f-a4bf-38003770ad73 |
redtag.ca |
38178928-9281-42aa-9f70-8c39c453baf1 |
Alamo Rent a Car |
There are many partners not listed in this list, you can contact REPLACE_ME to get more details
Categories
Id |
Name |
22b666ae-97c2-4e57-a437-e977de6beef4 |
Grocery (Épicerie) |
1ba636e3-799d-44c3-9c84-42a3df6430b0 |
Household Supplies (Entretien ménager) |
0f597ee1-16b8-4a4f-beb7-4654cfd0b45a |
Pharmacy (Pharmacie) |
c7a208f3-8f94-4460-b76c-3c75ae53417d |
Liquor (Alcool) |
38d878d7-c3e0-4ea1-8e6c-d4759f307042 |
Pets (Animaux de compagnie) |
77c6067e-bd25-43a9-826c-7a4788581952 |
Home and Garden (Maison et jardin) |
0333d0e5-68be-4833-939f-3a20d0cc9806 |
Fuel and Auto (Carburant et auto) |
0cbc9203-2811-4eae-9dc1-68da692658b8 |
Financial (Produits financiers) |
0a889711-9ab8-4972-a0b5-b9eafc8fa312 |
Retail (Articles de détail) |
0387d04b-2736-48e4-b804-ac50f4222b79 |
Office (Bureau) |
121fa2dd-1fab-4492-8c5d-fb34624f4dda |
Travel (Voyage) |
17180943-4cef-4fb8-833d-9919e359e4f3 |
Gift Cards (Cartes-cadeaux) |
e10dea41-3aee-4a24-bc8d-0d8de8c3e5ae |
airmilesshops.ca (airmilesshops.ca) |
cc1b19d6-72e0-47bc-8b81-2b1fbb49d050 |
Other (Autre) |
SubCategories
Id |
Name |
Parent |
4683cd1f-bba8-4dd0-b960-4324a246960b |
Baby (Bébé) |
Grocery (Épicerie) |
873c7bfa-745e-4bdd-afe2-55425821d721 |
Bakery (Boulangerie) |
Grocery (Épicerie) |
d614fed9-8c17-4c20-a179-2351e54679c1 |
Beverages (Boissons) |
Grocery (Épicerie) |
eab2662b-bfc5-4457-8cbf-33d9e10f9bb6 |
Dairy and Eggs (Produits laitiers et œufs) |
Grocery (Épicerie) |
f1f75e01-8b8f-460c-bc89-8bdb40060e7c |
Deli and Prepared Food (Charcuterie et plats préparés) |
Grocery (Épicerie) |
da4cdf1b-e2f0-4b1c-99b7-c0ce4696292f |
Frozen Foods (Produits surgelés) |
Grocery (Épicerie) |
37485ad6-07ad-4145-80f1-fbecdd46a26a |
Fruits and Vegetables (Fruits et légumes) |
Grocery (Épicerie) |
0d3245ac-9812-4bc3-9020-16b1349f1531 |
Meat and Seafood (Viande et produits de la mer) |
Grocery (Épicerie) |
be58904e-4ae9-49fc-ac6d-0e966dc193bb |
Pantry (Garde-manger) |
Grocery (Épicerie) |
d295e726-8205-4a41-8207-a6e31714dde3 |
Snacks (Collations) |
Grocery (Épicerie) |
53a177af-b923-43ea-ac7d-0230ea0db805 |
Vegan and Vegetarian (Aliments végétariens et végétaliens) |
Grocery (Épicerie) |
3c4b099b-061c-493b-8bc4-4ced119949c4 |
Organic Groceries (Épicerie Biologique) |
Grocery (Épicerie) |
e9c77b08-a3e5-4846-90e5-9e9ad0f34de1 |
Other Grocery (Autre Épicerie) |
Grocery (Épicerie) |
279ecbd8-b81b-4d46-9726-8fdd4dee8af8 |
Cleaning (Nettoyage) |
Household Supplies (Entretien ménager) |
43cf7742-601f-43ef-9934-3a461493eb4e |
Laundry (Lessive) |
Household Supplies (Entretien ménager) |
0b9d187d-bbf2-4884-9e10-2df4c97bcd3f |
Paper and Plastics (Papier et plastiques) |
Household Supplies (Entretien ménager) |
4683cd1f-bba8-4dd0-b960-4324a246960b |
Baby (Bébé) |
Pharmacy (Pharmacie) |
dc725f55-1c70-4088-8108-cc199bd2ca32 |
Beauty (Beauté) |
Pharmacy (Pharmacie) |
ef1ff9bd-6032-4c14-8c51-8b1f43dd0970 |
Medicine and Health (Médicaments et santé) |
Pharmacy (Pharmacie) |
d871a234-93f3-47f0-991a-b230cb797d74 |
Personal Care (Soins personnels) |
Pharmacy (Pharmacie) |
0dd2f52d-af4a-45f9-aa1c-c66cd13f16e6 |
Beer and Cider (Bières et cidres) |
Liquor (Alcool) |
6cad2024-2bc8-47f5-b563-53f97c1f7205 |
Coolers (Coolers) |
Liquor (Alcool) |
b3962476-bb50-47c2-af54-3bdec43fa499 |
Spirits (Spiritueux) |
Liquor (Alcool) |
8b618c88-cd2c-47fa-9de7-677fe1d3737f |
Wine (Vins) |
Liquor (Alcool) |
Mapping from Offer Service
We can make a call to the Offer Service API to get these extended_metedata
values.
Request
/offers?region=ON&extended_metadata=true
Response
{
"offers":[],
"metadata":{
"total": N
"partners": [...],
"categories": [...],
}
}
The field partners
in the response has id and labels. Region Dependent
The field categories
in the response contains id and labels for categories and subcategories. Region agnostic
2 - API Library
This section provides information on the 3 API’s provided by the Offer Service.
Used to get multiple offers based on parametes.
Used to get single offer detail.
Used to update single offer state for a collector.
Common Use Case
-
Get Offers By Province
Request |
Response |
/offers?region=ON |
Get all offers in Ontario |
-
Get Offers By Partner
Request |
Response |
/offers?region=ON&partner_id=ID_1,ID_2 |
Get all offers related to partner with ID_1 OR ID_2, in Ontario |
ID_1 & ID_2 are UUID’s for partners. To get partner id for a specific partner check Mapping -> Partner
documentation
Filter Combination
When multiple request parameters are passed, and/or multiple values are passed, the offers that satisfy the following logic are returned in the response.
(param1.valueA OR param1.valueB OR ...) AND (param2.valueX OR param2.valueY OR ...) AND (...)
For example, if request:
partner_id
= A, B, C
category_id
= X
/offers?region=ON&partner_id=A,B,C&category_id=X
Then the /offers
response will return offers that satisfy:
Offers where (partner=A OR partner=B OR partner=C) AND (category=X).
2.1 - GET /offers
Used to get multiple offers based on parametes.
GET /offers
This is the core API for Offer Service. API to get all details for displaying offers to collectors and the general public. This API has multiple query paramenter and headers that can change the response of the offers returned in varios ways.
Query Parameters
Name |
Rquired |
Type |
Discription |
region |
✔️ |
String (single value) |
Will only show offers from a single region |
partner_id |
|
UUID (multiple value) |
Will return offers with only the provided parters |
category_id |
|
UUID (multiple value) |
Will return offers with only the provided category |
subcategory_id |
|
UUID (multiple value) |
Will return offers with only the provided subcategory |
promotion_id |
|
UUID (single value) |
Will return offers with only the provided promotion |
type |
|
String (multiple value) |
Specify offer types. ie: buy , spend , amCashEarn , amCashDiscount |
program_type |
|
String (multiple value) |
Specify offer program types. allowed values: traditionalcore , cardlinked , airmilesshops , bmopreapp |
availability |
|
String (multiple value) |
Specify where offer is avaliable. allowed values: online , in-store |
sort |
|
String (multiple value) |
Specify the order of the offers returned, check allowed values list. |
offset |
|
Number (int) |
Specify how many offers to skip at the begining and then start showing the offers. |
limit |
|
Number (int, min = 1, max = 96) |
Specify the number of offers to return |
Authenticated
When calling /offers with a token (as a collector), a few more query paramaters are available to use in addition to all the ones metioned above.
Name |
Rquired |
Type |
Discription |
states |
|
String (single value) |
Specify offers that have been interacted in some way by the collector. allowed values: SAVED , OPTED_IN |
mass_offer |
|
Boolean |
Specify to show offers that are targeted, when mass_offer = false |
Sort Value and Behaviours
Behaviour |
Sort Value |
Need Authentication? |
Discription |
Default |
[promotionId,massOffer,…] |
|
Offers are grouped and sorted by promotion id, mass offer, and then ranked by partner priority, and then sorted by offer priority. This is the default sort used on the AirMiles website and mobile. |
Ending soon |
[..] |
|
Offers are sorted by End Date first, grouped and sorted by partner priority second, and finally sorted by offer priority. |
Collector Relevance |
[collectorRelevance] |
✔️ |
This is sorting based on Collector prefrences powered by magic. |
Region Relevance |
[regionRelevance] |
|
This is sorting based on most popular offers in the region powered by more magic. |
Name |
Rquired |
Type |
Discription |
X-Correlation-Id |
|
UUID |
This is used to track the request through the logs, if not provided it will be auto generated by API and returned in the header response |
X-Origin-Client |
✔️ |
String |
This field is to let us know where the request is coming from. ie: internal:amrp:postman , external:web:bmo |
Accept-Language |
|
String - Locale |
This is let API know if you want the response back in some supported language. Allowed value: en-US , fr-CA |
Authenticated
To make authenticated request you need an additional header. The tokens that are supported are member
tokens, these tokens have an associated collecter specification.
Name |
Rquired |
Type |
Discription |
Authorization |
|
Bearer {token} |
Specifies a collector when making call to this api. This will give the ability to see the offers tarrgeted for that collector and the states of offers |
Response
The response has two main section offers
and metadata
. The latter is very simple just containing total count of offers that match the given filters in the query parameter.
lets focus on the offers:[]
list which is a list of offer objects, lets talk about some key information thats returned to us in these offer objects (for full list of values retuned, check out Sample Response) :
Name |
Type |
Discription |
id |
UUID |
Offer object ID |
partnerId |
UUID |
Associated partner id |
categoryId |
UUID |
Associated category id |
awardShort |
String |
description of the award associated with offer |
qualifierShort |
String |
Short description of what is needed to qualify for offer award |
displayDate |
LocalDateTime |
When can this offer show up for collectors |
startDate |
LocalDateTime |
When can this offer be avalilable for use by collectors. Usually same as displayDate |
endDate |
LocalDateTime |
When can this offer be marked as expired so that no more collectors are able to see/use it |
massOffer |
Boolean |
true = Offer is publicly avaliable, false = Offer is targeted to specific collectors. |
tiers |
List<tier> |
Offers can have multiple qualifers and each can have a different award |
mechanisms |
List |
How to qualify for the offer |
states |
List<States> |
Authenticated Request Only Will give a list of states which are object showing the name, value and when it was updated |
legalText |
String |
Legal copy for offer |
Sample
Request
GET /offers?region=ON&limit=1 HTTP/1.1
Host: cdn.airmilesapis.ca
X-Origin-Client: internal:amrp:postman
Authorization: Bearer `TOKEN`
Response Body
{
"offers": [
{
"id": "4a80ad4a-de28-4c77-8180-0a89a71f4a55",
"partnerId": "3267588b-791d-49bc-a321-d85d5f818480",
"partnerLabel": "AIR MILES",
"partnerLogo": {
"url": "https://dev.cdn.airmilesapis.ca/partner-logo/7m10wxejlkq7/69ZErUapt6c8WQioe6iYSS/5107f862d6a2b238ff6f7739c5a90992/AIRMILES_PLANE_ELECTRIC_BLUE_RGB_E.png"
},
"partnerProfileURL": "https://www.airmiles.ca/en/offers/partners/air-miles-reward-program-bonus-offers.html",
"categoryId": "121fa2dd-1fab-4492-8c5d-fb34624f4dda",
"categoryLabel": "Travel",
"awardShort": "You could win a Walt Disney World vacation from AIR MILES®",
"qualifierShort": "Enter with your Collector info. Plus, earn 4 extra entries when you book any trip with AIR MILES® Travel.*",
"image": {
"url": "https://s3.amazonaws.com/prod-l1-amrpwl-post-images/processed-images/4008e08c-cd46-4429-bdc6-ce763cf4731a"
},
"displayDate": "2024-05-07T00:00:00",
"startDate": "2024-05-07T00:00:00",
"endDate": "2024-05-26T23:59:59",
"description": "Contest ends May 26, 2024. Must be 18 years or older to enter. No purchase necessary. Contest Rules apply. ",
"programType": "traditionalcore",
"massOffer": true,
"displayPriority": 1000,
"tiers": [
{
"awardLong": "You could win a Walt Disney World vacation from AIR MILES®",
"qualifierLong": "Enter with your Collector info. Plus, earn 4 extra entries when you book any trip with AIR MILES® Travel.*"
}
],
"mechanisms": [
{
"mechanismType": "button",
"mechanismLabel": "Enter now",
"mechanismValue": "https://www.airmiles.ca/arrow/Splash?splashId=26100080&changeLocale=en_CA"
}
],
"states": [
{
"name": "OPT_IN",
"value": "OPTED_IN",
"updatedAt": "2024-04-29T13:56:09.083363Z"
},
{
"name": "SAVE",
"value": "SAVED",
"updatedAt": "2024-04-29T13:56:09.082147Z"
}
],
"legalText": "The Contest runs from May 6, 2024 to May 26, 2024 and is open to Canadian resident AIR MILES® collectors who have reached the age of 18. *NO PURCHASE NECESSARY Collectors can visit https://airmiles.ca/magicalmemories\nto complete and submit the form and get 1x entry. To get 4 additional entries collectors must book any trip on AIR MILES Travel during the contest period and complete their trip by July 31, 2024 (or complete the alternative bonus entry method outlined in the full contest rules). Limit one (1) base entry and four (4) bonus entries per collector number. One (1) prize is available to be won consisting of a vacation for four (4) to the Walt Disney World Resort in Florida. Approximate Prize value is $10,219.00 USD ($13,285.00 CDN). Correctly answered math skill-testing question required upon selection as a potential winner. Odds of winning depend on the number of eligible entries received. For full contest rules and details, visit https://airmiles.ca/magicalmemories\n\n®™ Trademarks of AM Royalties Limited Partnership used under license by AIR MILES Loyalty Inc.\n"
}
],
"metadata": {
"total": 265
}
}
|
|
X-Correlation-Id |
a0ccb3a7-2b19-4916-8b7e-d3059ccc17bb |
For support its best to keep track of the X-Correlation-Id
value, as that can be used to track down logs for this request.
2.2 - GET /offers/{id}
Used to get single offer detail.
GET /offers/{id}
API to get all details for displaying a specific offer to collectors and the general public. This API has limited query paramenter as this is accessing a specific offer resource.
Path Parameter
Name |
Rquired |
Type |
Discription |
id |
✔️ |
UUID (single value) |
Returns the offer detail associated with this id |
Query Parameter
Name |
Rquired |
Type |
Discription |
region |
✔️ |
String (single value) |
Will only show offers from a single region |
Name |
Rquired |
Type |
Discription |
X-Correlation-Id |
|
UUID |
This is used to track the request through the logs, if not provided it will be auto generated by API and returned in the header response |
X-Origin-Client |
✔️ |
String |
This field is to let us know where the request is coming from. ie: internal:amrp:postman , external:web:bmo |
Accept-Language |
|
String - Locale |
This is let API know if you want the response back in some supported language. Allowed value: en-US , fr-CA |
Authenticated
To make authenticated request you need an additional header. The tokens that are supported are member
tokens, these tokens have an associated collecter specification.
Name |
Rquired |
Type |
Discription |
Authorization |
|
Bearer {token} |
Specifies a collector when making call to this api. This will give the ability to see the offers states for the collector |
Response
The response has two main section offers
and warning
.
The warning object has two states depending on region query parameter, authentication header and offer id passed:
OR
"warning": {
"errorCode": "String - errCodes",
"message": "String"
}
Error Code
name |
Offer Returned |
description |
err-login-required |
YES |
When viewing a targetted offer without any authorization header |
err-region |
YES |
When viewing an offer that does not match the region query parameter in the request |
err-not-found |
NO |
Offer Id does not exist, Offer Id not valid |
err-expired |
NO |
Offer is expired |
err-not-live |
NO |
Future offer, Not live yet (current date < display start date) |
err-exclusive |
NO |
Targeted Offer - Collector is not eligible for the Offer |
lets talk about some key information thats returned to us in the offer objects (for full list of values retuned, check out Sample Response) :
Name |
Type |
Discription |
id |
UUID |
Offer object ID |
partnerId |
UUID |
Associated partner id |
categoryId |
UUID |
Associated category id |
awardShort |
String |
description of the award associated with offer |
qualifierShort |
String |
Short description of what is needed to qualify for offer award |
displayDate |
LocalDateTime |
When can this offer show up for collectors |
startDate |
LocalDateTime |
When can this offer be avalilable for use by collectors. Usually same as displayDate |
endDate |
LocalDateTime |
When can this offer be marked as expired so that no more collectors are able to see/use it |
massOffer |
Boolean |
true = Offer is publicly avaliable, false = Offer is targeted to specific collectors. |
tiers |
List<tier> |
Offers can have multiple qualifers and each can have a different award |
mechanisms |
List |
How to qualify for the offer |
states |
List<States> |
Authenticated Request Only, Will give a list of states which are object showing the name, value and when it was updated |
legalText |
String |
Legal copy for offer |
Sample
Request
GET /offers/4a80ad4a-de28-4c77-8180-0a89a71f4a55?region=ON HTTP/1.1
Host: cdn.airmilesapis.ca
X-Origin-Client: internal:amrp:postman
Authorization: Bearer `TOKEN`
Response Body
{
"offer": {
"id": "4a80ad4a-de28-4c77-8180-0a89a71f4a55",
"partnerId": "3267588b-791d-49bc-a321-d85d5f818480",
"partnerLabel": "AIR MILES",
"partnerLogo": {
"url": "https://dev.cdn.airmilesapis.ca/partner-logo/7m10wxejlkq7/69ZErUapt6c8WQioe6iYSS/5107f862d6a2b238ff6f7739c5a90992/AIRMILES_PLANE_ELECTRIC_BLUE_RGB_E.png"
},
"partnerProfileURL": "https://www.airmiles.ca/en/offers/partners/air-miles-reward-program-bonus-offers.html",
"categoryId": "121fa2dd-1fab-4492-8c5d-fb34624f4dda",
"categoryLabel": "Travel",
"awardShort": "You could win a Walt Disney World vacation from AIR MILES®",
"qualifierShort": "Enter with your Collector info. Plus, earn 4 extra entries when you book any trip with AIR MILES® Travel.*",
"image": {
"url": "https://s3.amazonaws.com/prod-l1-amrpwl-post-images/processed-images/4008e08c-cd46-4429-bdc6-ce763cf4731a"
},
"displayDate": "2024-05-07T00:00:00",
"startDate": "2024-05-07T00:00:00",
"endDate": "2024-05-26T23:59:59",
"description": "Contest ends May 26, 2024. Must be 18 years or older to enter. No purchase necessary. Contest Rules apply. ",
"programType": "traditionalcore",
"massOffer": true,
"eventBasedOffer": false,
"displayPriority": 1000,
"tiers": [
{
"awardLong": "You could win a Walt Disney World vacation from AIR MILES®",
"qualifierLong": "Enter with your Collector info. Plus, earn 4 extra entries when you book any trip with AIR MILES® Travel.*"
}
],
"mechanisms": [
{
"mechanismType": "button",
"mechanismLabel": "Enter now",
"mechanismValue": "https://www.airmiles.ca/arrow/Splash?splashId=26100080&changeLocale=en_CA"
}
],
"states": [
{
"name": "OPT_IN",
"value": "OPTED_IN",
"updatedAt": "2024-04-29T13:56:09.083363Z"
},
{
"name": "SAVE",
"value": "SAVED",
"updatedAt": "2024-04-29T13:56:09.082147Z"
}
],
"legalText": "The Contest runs from May 6, 2024 to May 26, 2024 and is open to Canadian resident AIR MILES® collectors who have reached the age of 18. *NO PURCHASE NECESSARY Collectors can visit https://airmiles.ca/magicalmemories\nto complete and submit the form and get 1x entry. To get 4 additional entries collectors must book any trip on AIR MILES Travel during the contest period and complete their trip by July 31, 2024 (or complete the alternative bonus entry method outlined in the full contest rules). Limit one (1) base entry and four (4) bonus entries per collector number. One (1) prize is available to be won consisting of a vacation for four (4) to the Walt Disney World Resort in Florida. Approximate Prize value is $10,219.00 USD ($13,285.00 CDN). Correctly answered math skill-testing question required upon selection as a potential winner. Odds of winning depend on the number of eligible entries received. For full contest rules and details, visit https://airmiles.ca/magicalmemories\n\n®™ Trademarks of AM Royalties Limited Partnership used under license by AIR MILES Loyalty Inc.\n"
},
"warning": null
}
|
|
X-Correlation-Id |
a7b3b6a8-f033-4e78-804e-f1990f317515 |
For support its best to keep track of the X-Correlation-Id
value, as that can be used to track down logs for this request.
2.3 - PUT /offers/{id}/states
Used to update single offer state for a collector.
PUT /offers/{id}/states
API to update the state of an offer for a given collector. This API can only be used with a Authorization
token, as thats how the API knows which collector should be associated with the action.
Path Parameter
Name |
Rquired |
Type |
Discription |
id |
✔️ |
UUID (single value) |
Identify the offer to updated its state |
Request Body
required
{
"states": [
{
"name": "name1",
"value": "value1"
}
]
}
The request body contains a states: []
list which can contain multiple state objects.
Name |
Rquired |
Type |
Discription |
name |
✔️ |
String |
This specifies the type of state to update, as of now we support SAVE and OPT_IN |
value |
✔️ |
String |
The values associated with the state to update. For name equals SAVE valid value is SAVED OR UNSAVED , for name equals OPT_IN valid value is OPTED_IN |
Name |
Rquired |
Type |
Discription |
X-Correlation-Id |
|
UUID |
This is used to track the request through the logs, if not provided it will be auto generated by API and returned in the header response |
X-Origin-Client |
✔️ |
String |
This field is to let us know where the request is coming from. ie: internal:amrp:postman , external:web:bmo |
Authorization |
✔️ |
Bearer {token} |
Specifies a collector when making call to this api. |
Response
As this is a PUT
request there is no response body. Check for status code 204 No Content
for successful request.
Sample
Request
PUT /offers/e6528c38-6642-497d-85ca-f71cc5a74583/states HTTP/1.1
Host: cdn.airmilesapis.ca
Authorization: Bearer {JWT_TOKEN}
x-origin-client: internal:amrp:postman
Content-Type: application/json
Content-Length: 102
{
"states": [
{
"name": "SAVE",
"value": "SAVED"
}
]
}
Response
Body
Status Code
Status-Code: 204 No Content
|
|
X-Correlation-Id |
a7b3b6a8-f033-4e78-804e-f1990f317515 |
For support its best to keep track of the X-Correlation-Id
value, as that can be used to track down logs for this request.