Introduction:

The Walgreens Native PhotoPrints API gives the ability for customers of third party mobile photo applications to print photos from their mobile devices and pick them up at their local Walgreens store.

Documentation/Services Highlights:

  • Added detailed description tables for all the request json body parameters!
  • Support for Multi-Cart Checkout, aka multiple product types in one order!
  • Increased imageURL quantities to 200 images per order!
  • Overall more seamless and simpler API integration than past versions!

Business Information:

Technical Information:

  • Signup for Revenue Share commission on photo orders: https://www.wagapireports.com
  • Image Resolution Requirements
  • "QA" Observe the badge on the right, this also known as "Staging" or "Test" - use this for testing purposes
  • "PR" Observe the badge on the right, this also known as "Production" of "Prod" - only use this when the application is released publicly

Native Checkout Flow:

The external services listed below make up the complete list of services that are required in order to complete all phases of the PhotoPrints experience. Please note that all of the service endpoints documented below are brand new for this version of the PhotoPrints API.

 

In order to ensure your integration is both future and backwards compatible, please make sure that the integration is only reading the parameters which will display in the app UI and do not impose strict parsing or typecasting logic for any of the API response parameters. We may add new request and response parameters to our APIs in order to offer enhanced functionality and to support multiple products in a contiguous way.

Upload Images:

Uploading a set of images is a 4-step process:

You can use the Walgreens Storage Server or your own public server. This section is only applicable when utilizing the Walgreens Storage Server.

Sample Code:

Step 1) Storage Credentials Endpoint

Make a HTTPS POST to the appropriate Walgreens Web Service URL to request storage credentials:

 
 

Step 2) Generate PUT Authorization

Before an image can be uploaded, the value for the Authorization field in the Header must be generated first. The Authorization field's value can be generated by:

  • TIMESTAMP: is the GMT timestamp, example:
    SESSION_ID: is the "sessionId" obtained in the first step above.
    UPLOAD_URL: is the "uploadUrl" obtained in the first step above. Please remove the http:// from this url
    FILENAME: is the unique filename for your image. We recommend the below example (with timestamp): myImage_.jpg
    $data = "PUT\n\nimage/jpg\n" + TIMESTAMP + "\nx-amz-security-token:" + SESSION_ID + "\n/" + UPLOAD_URL + "/" + FILENAME
  • Use HMAC-SHA1 to sign the string with the value of SECRET_KEY which was in the Requesting Storage Credentials JSON response:
    $signature = hash_hmac('sha1', $data, SECRET_KEY, true);
  • Use Base64 to encode the signed string from above:
    $signedEncodedData = base64_encode($signature);
  • Use the following syntax to create the value of the Authorization field:
    $AuthValue = "AWS " + ACCESS_KEY_ID + ":" + $signedEncodedData;

Step 3) Upload Images

To upload an image, make a HTTP PUT to the appropriate "uploadUrl" with a custom HTTP header. Place the image to be uploaded in the HTTP body. If multiple images are to be printed, repeat this process.

Note:

Walgreens Storage Server credentials will be generated on a session basis with an expiration time of thirty-six (36) hours. Also an HTTP 200 response shall be sent after each successful upload.

 

Sample Response:

200

Step 4) Generate GET Authorization

The URL to access your uploaded image(s) will require a few additional parameters to be generated before the URL can be constructed, in order for it to be sent to print.

  • EXPIRATION_TIME: is epoch + 36 hours, example:
    SESSION_ID: is the "sessionId" obtained in the first step above.
    UPLOAD_URL: is the "uploadUrl" obtained in the first step above. Please remove the http:// from this url
    FILENAME: is the unique filename for your image. We recommend the below example (with timestamp): myImage_.jpg
    $data = "GET\n\nimage/jpg\n" + EXPIRATION_TIME + "\nx-amz-security-token:" + SESSION_ID + "\n/" + UPLOAD_URL + "/" + FILENAME
  • Use HMAC-SHA1 to sign the string with the value of SECRET_KEY which was in the Requesting Storage Credentials JSON response:
    $signature = hash_hmac('sha1', $data, SECRET_KEY, true);
  • Use Base64 to encode the signed string from above:
    $signedEncodedData = base64_encode($signature);
  • Use the following syntax to create the query string for the image URL:
    YOU MUST URL_ENCODE ALL OF THE QUERY_STRING VALUES
    FILE_URL + "?Expires=" + EXPIRATION_TIME + "&AWSAccessKeyID=" + ACCESS_KEY + "&x-amz-security-token=" + SESSION_ID + "&Signature=" + $signedEncodedData
     

Price List Endpoint:

Description: Used to get the list of photo products & price details that have been configured for your application.

 

Attribute Required/Optional Description
apiKey required The API Key that you have been approved for. Can be found here
affId required The AffiliateID that you was given in your application email.
productGroupId optional value Used to differentiate product groups, for example: Standard Prints (STDPR) vs Square Prints (SQR01)
act required The Action is a value that invokes our internal service. The value must be "getphotoprods"
devinf optional value See below section Explaining Device Info
appver optional value See below section Explaining App version
 
 

Coupon Validation Endpoint:

Description: To validate a coupon code & retrieve offer details

 

NOTE:

"orderDiscountPrice" is calculated off the order total.
With an "orderTotalPrice" of $40 with a coupon code for 20% off, you will get an "orderDiscountPrice" of $8.
"orderTotalPrice" - "orderDiscountPrice" = Subtotal.
Example: $40 - $8 = $32

Attribute Required/Optional Description
apiKey required The API Key that you have been approved for. Can be found here
affId required The AffiliateID that you was given in your application email.
couponCode required The actual coupon code being applied to the order. Example: QPSAVE or TESTFORALL
act required The action is a value that invokes our internal service. The value must be "getdiscount"
devinf optional value See below section Explaining Device Info
appver optional value See below section Explaining App version
productDetails required An array of JSON Product objects. These will contain the two below parameters.
productId required This is the productId of the product that the customer has selected. Retrieved from the PriceList request
qty required This is the quantity of the product that the customer has selected.
 
 

Store List Endpoint:

Description: To retrieve list of available & applicable photo stores near customer

 

No Promise Time:

Walgreens refers to select stores as being in a state called "No Promise Time" when the "promiseTime" for a store is returned as "01-01-3000 00:00 AM".This means that the store is temporarily unavailable (e.g. maintenance window/upgrades), but is expected to be operational within 48 hours. In such cases, the pickup time should be displayed as "Within 48 hours" in the customer facing user interface. When placing the order for such stores, the same time stamp string must be passed when placing an order aka the API call below. As long as stores in this state are back operational within 48 hours, the orders will be submitted and fulfilled. If not, the orders in question will be systematically cancelled and the end customer will receive an order cancellation email.

Attribute Required/Optional Description
apiKey required The API Key that you have been approved for. Can be found here
affId required The AffiliateID that you was given in your application email.
latitude required The actual latitude of the customer. Example: "41.880977"
longitude required The actual longitude of the customer. Example: "-87.626481"
act required The action is a value that invokes our internal service. The value must be "photoStores"
devinf optional value See below section Explaining Device Info
appver optional value See below section Explaining App version
productDetails required An array of JSON Product objects. These will contain the two below parameters.
productId required This is the productId of the product that the customer has selected. Retrieved from the PriceList request
qty required This is the quantity of the product that the customer has selected.
 
 

Submit Order Endpoint:

Description: To place the photo order to Walgreens

 

Order Limits:

Please ensure that the order has a post-coupon price that is less then $998, and you order has a maximum of 100 distinct images, with a print quantity of 10 prints per image.

Terms and Conditions:

Your application must contain a UI element that the customer must make an action on every order with the following copy (Example: Checkbox, Toggle Switch):

"I acknowledge that I have read, understand and agree to be bound by the Terms of Use and Online Privacy & Security Policy."
Attribute Required/Optional Description
apiKey required The API Key that you have been approved for. Can be found here
affId required The AffiliateID that you was given in your application email.
publisherId required The PublisherID you have been given. Can be obtained here: http://www.wagapireports.com/
firstName required The First Name of the customer. A required input from the user.
lastName required The Last Name of the customer. A required input from the user.
phone required The Phone Number of the customer. A required input from the user.
email required The Email of the customer. A required input from the user.
storeNum required The Store Number of the customer selected store. Retrieved from the StoresList request
promiseTime required The Promise Time is the time in which the store number above can finish the order. Retrieved from the StoresList request
affNotes optional value The Affiliate Notes is a field in which you can use to track orders on your side. Value is optional.
currencyType optional The Currency Type is used to submit an order where products are for a different currency. Retrieved from the PriceList request
act required The action is a value that invokes our internal service. The value must be "photoStores"
devinf optional value See below section Explaining Device Info
appver optional value See below section Explaining App version
productDetails required An array of JSON Product objects. These will contain the two below parameters.
productId required This is the productId of the product that the customer has selected. Retrieved from the PriceList request
imageDetails required An array of JSON Image Detail objects. These will contain the two below parameters.
qty required The quantity of the image url below. Think each image has a number of prints, this is that number. Maximum is "10".
url required An array of JSON Image Detail objects. There is a maximum of 200 unique images.
 
 

Errors:

Error Codes & Messages for Photo Prints Service:

Error Code Description
143 If there is any exception in web service.
500 If the Affiliate ID is invalid.
501 If the operation is not supported.
502 If there is an error in getting Affiliate Info.
503 If the request is not made in secure mode.
504 If the session is not secure.
505 If the view is not found.
506 If the service action is not found
507 If there is no mapping in droplet.
508 If the required parameter is missing.
509 If the view parameter is missing.
510 If there is an exception.
511 If there is no mapping in droplet.
512 If the required view parameter is missing.
513 If the Token is invalid.
524 If there is an exception in the findURLV2 service.
525 If Image URL list is invalid.
527 For affiliate notes exceeding more than 240 characters.
654 Missing Product ID.
659 If there is no match for the vendor.
691 If internal services are down while validating Single Use Coupons.
2003 When the credentials are invalid then it will give this Exception.
2009 Service Unavailable Exception.
2010 For any Exception in Service.
6002 Order already placed.
6003 Order Cancelled Error code.
6004 Repeated order cancelled.
6006 If multiimgqty attribute is empty for Creative Products.
6007 If Creative Product Indicator is empty for Creative Orders.
6008 MIQ and CPI are invalid.

Finding mweb5 URL:

Error Code Description
111 For any Exception with the service.
112 Your affiliateID is setup incorrectly.
632 If required parameters are missing.

Price List Errors:

Error Code Description
659 AffiliateID setup is invalid.
991 Product Details Not Found.
9111 Exception when fetching Price List.
9112 Exception in Price List Service.

Coupon Discount Errors:

Error Code Description
656 Coupon Code is empty.
661 Coupon code is invalid.
682 If coupon is already used.
683 If coupon or promotion is expired.
684 If coupon code is not found.
685 Web service System Error while coupon service validation.
686 If store Number is empty.
687 If Coupon redemption date is invalid.
688 If coupon RFN number is empty.
689 If invalid amount or null amount.
690 If Barcode is null or empty.
1006 If the input parameters are invalid.
9100 If the Product details are missing.
9102 If there is an internal exception occurred.
9103 If there is a JSON exception.
9107 If the quantity is missing.

Store List Errors:

Error Code Description
651 Invalid Search.
652 No Stores Available.
653 No Search Parameter Given.
851 One or many of the Mandatory fields are empty.
1601 If the ProductID is missing.
1602 If the Quantity is missing.
9100 If the Product details are missing.
9104 If there is an Internal Exception
9105 If there is a JSON exception.
9106 If there is an Internal Exception.

Submit Order Errors:

Error Code Description
527 If the Affiliate Notes at maximum length.
630 If the phone number is invalid.
631 If the promise time is invalid.
632 If any of the mandatory fields is null.
633 Exception in service.
634 If the order is not successful.
640 If the coupon code is invalid.
660 If the quantity is invalid.
664 If Number of Images is greater then 200.
665 If Number of Prints Per Image is > 10.
851 One or many of the Mandatory fields are empty.
1016 If Invalid Image URLs are passed.
9104 If the image quantity is not with the range.

App Version Parameter:

Description: Information about the version of your application the customer is using. Useful to us both for debugging product order issues/bugs.

Examples: "1.00" or "1.01" or "1.10" or "10.01"


Device Info Parameter:

Description: Information about the customers device

Examples:

Device OS Version devinf Value
iPhone 10.2 "iPhone,10.2"
iPad 10.2 "iPad,10.2"
iPod 10.2 "iPod,10.2"
Android 7.0 "Android,7.0"
Android Tablet 7.0 "AndroidTablet,7.0"
Chrome 43.0.1410.65 "Chrome,26.0"
Windows 8.1 "Windows,10.2"
Internet Explorer Browser "IE,11"
Safari Browser "Safari,6.0"
Opera Browser "Opera,12.15"

Disclaimer:

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