API Version: 
Version 1.0 - 8/8/2016

Introduction:

The Digital Offers API enables third party applications to search and clip digital coupons directly to Walgreens customers Balance Rewards Cards.

Once a coupon is clipped to a customers card the offer will be auto-magically applied the next time they checkout with that item on Walgreens.com or in any one of our 8200+ Walgreens Stores!


Technical Information:


Request Loyalty Member Lookup:

Description: This service is used to fetch the "LoyaltyMemberId" which is the unique user identification number used for all the Digital Offers API requests. Request Content-type is application/json. The Loyalty Member Lookup request should be a POST method.

Valid Member Warning:

The "programId" value must be a valid balance rewards user number. This should be manually entered from the user. It can be found on their Balance Rewards card under the barcode or on www.walgreens.com.

 

POST LOYALTY_MEMBER_LOOKUP_URL
Content-Type: application/json
{
"affId":"YOUR_AFFILIATE_ID",
"apiKey":"YOUR_API_KEY",
"programId":"USER_BR_ID",
"act":"lytLookUp",
"devinf":"iPhone,9.0 (SEE EXAMPLES BELOW)",
"appver":"1.0"
}
 

Response Loyalty Member Lookup:

Description: This is the response which should contain the "LoyaltyMemberId" which is the unique user identification number used for all the Digital Offers API requests. Response Content-type is application/json.

Content-Type: application/json
Success Response
{
"LoyaltyMemberId":"USER_LOYALTY_MEMBER_ID",
"err":"",
"errDesc":""
}

Error Response
{
"LoyaltyMemberId":"",
"err":"3208",
"errDesc":"No valid user found"
}

Error Response
{
"LoyaltyMemberId":"",
"err":"3209",
"errDesc":"Exception in Loyalty lookUp service"
}

Error Response
{
"LoyaltyMemberId":"",
"err":"851",
"errDesc":"Mandatory field is empty"
}
 

 


Request Get Recommended Offers:

Description: This service is used to fetch dynamically ranked sets of recommended offers for a given user. This can be used for both Anonymous and Registered users. Request Content-type is application/json. The Get Recommended Offers request should be a POST method.

Is Redeemable Note:

The "isRedeemable" parameter is defaulted to Both. The parameter can be one of the following:

  1. Yes, and would return only Redeemable Coupons.
  2. No, and would return only Sneak Peek Coupons.
  3. Both, and would return both Redeemable Coupons and Sneak Peek Coupons

Timezone Note:

The "timeZone" parameter is defaulted to America/Chicago. The parameter can be one of the following:

  1. America/New_York
  2. America/Chicago
  3. America/Denver
  4. America/Los_Angeles
  5. America/Anchorage
  6. America/Adak

 

POST GET_RECCOMENDED_OFFERS_URL
Content-Type: application/json
{
"affId":"YOUR_AFFILIATE_ID",
"apiKey":"YOUR_API_KEY",
"loyaltyMemberId":"USER_LOYALTY_MEMBER_ID",
"category":"CATEGORY_SELECTED",
"index":"COUPON_RESULTS_INDEX",
"zipcode":"USER_ZIPCODE",
"sortBy":"OT or OV, if empty goes with recommended order",
"sortOrder":"asc or desc, Defaults to asc",
"numOfRecords":"Number of Results, defaults to 20",
"isRedeemable":"Yes or No or Both, see explanation above!",
"timeZone":"See explanation above",
"act":"getRecommendOffer",
"view":"getRecommendOfferJSON",
"devinf":"iPhone,9.0 (SEE EXAMPLES BELOW)",
"appver":"1.0"
}
 

Response Get Recommended Offers:

Description: This is the response which should contain the list of "offers" which each contains the attributes for a single offer. Response Content-type is application/json.

Content-Type: application/json
Success Response
{
"paginationInfo":{
"totalRecordsPerPage":"Number of actual records per page",
"expectedRecordsPerPage":"Number of expected records per page",
"startRecord":"Starting index number of results",
"totalRecords":"Total number of results"
},
"totalOfferValue":"Total value of offers",
"isCouponRegion":"True of False, defaults to false. True only in PR if offer not valid there.",
"offers":[{
"offerId":"OFFER_ID",
"offerCode":"OFFER_CODE",
"brandName":"OFFER_BRAND_NAME",
"offerActivateDate":"OFFER_ACTIVATED_DATE",
"offerExpiryDate":"OFFER_EXPIRY_DATE",
"redeemableOffer":"OFFER_REDEEMABLE_YET",
"nationalManuFlag":"Indicates National Manufacturer Coupon",
"offerDescription":"OFFER_DESCRIPTION",
"offerSummary":"OFFER_SUMMARY",
"offerRedemptionStartDate":"Date at which a 'SneakPeak' coupon can be used",
"offerSource":"OFFER_SOURCE_ORIGIN",
"offerImage":{
"OfferImage1":"OFFER_IMAGE_1",
...
},
"offerRewards":{
"offerValue":"OFFER_VALUE",
"categoryName":"OFFER_CATEGORY",
"rewardQuantity":"OFFER_QUANTITY"
}
},
...
],
"err":"",
"errDesc":""
}
 

 


Request Activate Offer:

Description: This service is used to activate/de-activate a particular offer for a given user. This can only be used with Registered users. Request Content-type is application/json. The Activate Offer request should be a POST method.

 

POST ACTIVATE_OFFER_URL
Content-Type: application/json
{
"affId":"YOUR_AFFILIATE_ID",
"apiKey":"YOUR_API_KEY",
"loyaltyMemberId":"USER_LOYALTY_MEMBER_ID",
"offerId":"SELECTED_OFFER_ID",
"visible":"yes",
"act":"activateOffer",
"view":"activateOfferJSON",
"devinf":"iPhone,9.0 (SEE EXAMPLES BELOW)",
"appver":"1.0"
}
 

Response Activate Offer:

Description: This is the response which should contain the an errors of activating an offer. Response Content-type is application/json.

Content-Type: application/json
Success Response
{
"err":"",
"errDesc":""
}

Error Response
{
SEE ERROR CODES BELOW
}
 

 


Request Get Activated Offers:

Description: Get Activated Offer Service will return all the offers associated with the user based on the filters. By default, this service will return all user activated offers that are live in the system, have not expired, and have not been redeemed. Request Content-type is application/json. The Get Activated Offers request should be a POST method.

Is Redeemable Note:

The "isRedeemable" parameter is defaulted to Both. The parameter can be one of the following:

  1. Yes, and would return only Redeemable Coupons.
  2. No, and would return only Sneak Peek Coupons.
  3. Both, and would return both Redeemable Coupons and Sneak Peek Coupons

Timezone Note:

The "timeZone" parameter is defaulted to America/Chicago. The parameter can be one of the following:

  1. America/New_York
  2. America/Chicago
  3. America/Denver
  4. America/Los_Angeles
  5. America/Anchorage
  6. America/Adak

 

POST GET_RECCOMENDED_OFFERS_URL
Content-Type: application/json
{
"affId":"YOUR_AFFILIATE_ID",
"apiKey":"YOUR_API_KEY",
"loyaltyMemberId":"USER_LOYALTY_MEMBER_ID",
"category":"CATEGORY_SELECTED",
"index":"COUPON_RESULTS_INDEX",
"visible":"yes",
"zipcode":"USER_ZIPCODE",
"sortBy":"CA (Catagory), ON (OrderName), EX (ExpiryDate), RA (RecentlyAdded)",
"sortOrder":"asc or desc, Defaults to asc",
"numOfRecords":"Number of Results, defaults to 20",
"isRedeemable":"Yes or No or Both, see explanation above!",
"timeZone":"See explanation above",
"act":"getActivatedOffer",
"view":"getActivatedOfferJSON",
"devinf":"iPhone,9.0 (SEE EXAMPLES BELOW)",
"appver":"1.0"
}
 

Response Get Activated Offers:

Description: This is the response which should contain the list of activated "offers" which each contains the attributes for a single offer. Response Content-type is application/json.

Content-Type: application/json
Success Response
{
"paginationInfo":{
"totalRecordsPerPage":"Number of actual records per page",
"expectedRecordsPerPage":"Number of expected records per page",
"startRecord":"Starting index number of results",
"totalRecords":"Total number of results"
},
"totalOfferValue":"Total value of offers",
"isCouponRegion":"True of False, defaults to false. True only in PR if offer not valid there.",
"offers":[{
"offerId":"OFFER_ID",
"offerCode":"OFFER_CODE",
"brandName":"OFFER_BRAND_NAME",
"offerActivateDate":"OFFER_ACTIVATED_DATE",
"offerExpiryDate":"OFFER_EXPIRY_DATE",
"redeemableOffer":"OFFER_REDEEMABLE_YET",
"nationalManuFlag":"Indicates National Manufacturer Coupon",
"offerDescription":"OFFER_DESCRIPTION",
"offerSummary":"OFFER_SUMMARY",
"offerRedemptionStartDate":"Date at which a 'SneakPeak' coupon can be used",
"offerSource":"OFFER_SOURCE_ORIGIN",
"offerImage":{
"OfferImage1":"OFFER_IMAGE_1",
...
},
"offerRewards":{
"offerValue":"OFFER_VALUE",
"categoryName":"OFFER_CATEGORY",
"rewardQuantity":"OFFER_QUANTITY"
}
},
...
],
"err":"",
"errDesc":""
}
 

 


Other Endpoints:

  • /search - Search for coupons based on a single keyword! coming soon
  • /login - Login users via a simple oAuth flow coming soon
  • /register - Register users via a simple oAuth flow coming soon

API Error Codes:

Error Code Endpoint(s) Error Type
851 /lookup Mandatory field in empty
1006 /recommended and /activated and /activate Invalid JSON request parameters
2201 /recommended Exception in service
2202 /activated Internal framework call failure
2203 /activated Exception in service
2205 /activate Exception in service
2207 /activate Maximum number of coupons have been clipped
2212 Coupon offer has already been clipped
2213 /activate Coupon offer is not activated
2215 /activate Invalid input parameters
2217 /activate Coupon offer is not deactivated
2218 /recommended and /activated and /activate Invalid Balance Rewards ID
2219 /activated Mandatory field is empty
2220 /recommended and /activated and /activate Invalid clip/unclip type for offers
2221 /recommended and /activated and /activate Coupon authentication failure
3208 /lookup Not a valid user
3209 /lookup Exception in service

Device Info Example Values:

Platform Version devinf Value
iPhone 9.0 "iPhone,9.0"
iPad 9.0 "iPad,9.0"
Android 6.0 "Android,6.0"
Android Tablet 6.0 "AndroidTablet,6.0"
Blackberry 10.0 "Blackberry,10.0"
Windows 10.0 "Windows,10.0"
Chrome 46 "Chrome,46.0"
Internet Explorer 11 "IE,10"
Safari 9.0 "Safari,9.0"
Postman 1.0 "Postman,1.0"

Disclaimer:

Consistent with the Terms of Use, your ability to launch a production integration of an Application is subject to approval by Walgreens.