Private Store workflow

Understand the Private Store workflow.

This topic describes the private store workflow. This scenario assumes:

  • The site uses a public API key.

  • The site has multiple private stores to choose from, and the private store ID and its corresponding target market ID are unknown. The search step is optional if you know the private store ID and target market ID information.

  • Only one access rule is configured for authorizing the customer by email domain.

  • Customer authentication is required to browse within a purchase plan. Authentication is a prerequisite if isAuthenticationRequiredToBrowse is set to true.

How to associate a customer with a private store

Step 1. Search for a private store

Send a GET /v1/purchase-plan/search request with the emailDomain query parameter to find the available private stores that match the email domain. The search matches criteria based on OR logic. If you configure multiple access rules for a private store, the search can locate private stores based on one valid configured access rule. For instance, if a private store restricts access by email domain and IP address, you can find the private store by searching for the email domain. See Private store query parameters for more information.

curl --location -g --request GET ' https://api.digitalriver.com/v1/shoppers/me/purchase-plan/search? emailDomain=university.edu&apiKey=apiKey' \--header 'Authorization: bearer {{access_token}}' \ 
...

Step 2. Get an access token

Send a GET /v1/token request to the Shoppers Token resource with your public API key and specify the JSON format.

curl --location -g --request GET ' https://api.digitalriver.com/v1/oauth20/token? apiKey=yourAPIkey&format=json' \--header 'Authorization: bearer {{access_token}}' \ 
...

Step 3. Authorize a customer into the private store

Send a POST /v1/shoppers/me/purchase-plan/authorize request with the access rule criteria in the payload. The response returns an empty document with a 204 No content response. When the request is successful, the customer can browse and purchase products from the private store. If the private store provides an overall product discount, the Products resource reflects discounted prices and any associated offers. The Cart resource also reflects discount prices. When the request is unsuccessful, an error message indicates the issue.

curl --location -g --request POST ' https://api.digitalriver.com/v1/shoppers/me/purchase-plan/authorize' \
--header 'Authorization: bearer {{access_token}}' \ 
...
--data-raw '{
   "purchasePlanAuthorize": {
      "id": "11858700",
      "targetMarketId": "35100",
      "emailDomain": "university.edu"
   }
 }
 {
    "purchasePlanAuthorize": {
      "id": "11858700",
      "targetMarketId": "35100",
      "emailDomain": "university.edu"
    }
 }'

Subsequent calls in the workflow could include:

Last updated