Submitting an order for a private store

Learn how to submit an order for a Private Store.

Prerequisite: A user with the role of a Private Store Manager in Global Commerce must enable Private Stores in Site Settings. See Private Stores under Configuring site settings in the Global Commerce Help for more information.

The following information describes how to submit an order to a Public Store, Private Store, or Friends and Family.

To submit an order for a Private Store:

Step 1: Get a limited access token

curl --location --request POST 'https://api.digitalriver.com/oauth20/token?grant_type=password&sessionToken={{session_token}}' \
--header 'authorization: bearer {{apikey_secret_authr}}\
...

Step 2: Enable the private store

You can apply a Private Store to either a limited access token or a full access token.

An access method determines how a shopper can access the pricing for a purchase plan. The following list describes the available access methods from most restrictive to least restrictive:

  • Email Address—The shopper must use their email address to access the Private Store.

  • Email Domain—The shopper’s email address must use one of the domains you specified entered for the Private Store. A domain is the end of the email address, such as the "digitalriver.com" in "jane.doe@digitalriver.com."

  • Email Invitation—The shopper can join the Private Store through an email forwarded to them from someone they know. The person who sent the invitation has to approve the invitation if the shopper places an order. A Private Store that uses this access method is also called a "friends and family" plan.

  • Generic Identifier—The shopper must enter a name and a PIN created for the Private Store. Private Stores can have multiple names and PIN combinations used to access the plan.

  • IP Address—The shopper must be on a network using a specific IP address or an IP address within a defined range.

  • Referral URL—The shopper must click a link to access the Private Store.

  • Bypass Access Method—Use this option when you don't want to specify the access method parameter. The bypassAccessRuleType can be any within EmailAddress, EmailDomain, EmailInvitation, or IpAddress.

You can use one of the following options as the authorization method in the request body for a Private Store:

{
    "purchasePlanAuthorize": {
        "id": "126668174",
        "targetMarketId": "126690174",
        "emailAddress": "chiliu@digitalriver.com"
    }
}

If you view the session, you will see the extended attributes for marketID and purchasePlanID.

Step 3: Buy a product

Once you've added a product to a cart, notice the discounts under pricing and the PURCHASEPLAN_INCENTIVE_TOTAL value under extended attributes.

curl --location --request POST 'https://api.digitalriver.com/shoppers/me/carts/active?productId=107845474&quantity=2' \
--header 'authorization: bearer {{apikey_secret_authr}}\
...

Step 4: Update the billing and shipping address

curl --location --request POST 'https://api.digitalriver.com/shoppers/me/carts/active.json' \
--header 'authorization: bearer {{apikey_secret_authr}}\
...
--data-raw '{
    "cart": {
        "billingAddress": {
            "firstName": "Anita",
            "lastName": "Liu",
            "emailAddress":"chiliu@digitalriver.com",
            "companyName": null,
            "line1": "10380 Bren Rd",
            "line2": null,
            "line3": null,
            "city": "Taipei",
            "countrySubdivision": "MN",
            "postalCode": "10682",
            "country": "US"
        },
        "shippingAddress": {
            "firstName": "Anita",
            "lastName": "Liu",
            "emailAddress":"chiliu@digitalriver.com",
            "companyName": null,
            "line1": "10380 Bren Rd",
            "line2": null,
            "line3": null,
            "city": "Taipei",
            "countrySubdivision": "MN",
            "postalCode": "10682",
            "country": "US"
        }
    }
}'

Step 5: Submit the cart

curl --location --request POST 'https://api.digitalriver.com/shoppers/me/carts/active/submit-cart.json' \
--header 'authorization: bearer {{apikey_secret_authr}}\
...

Last updated