Shoppers

Learn how to manage shoppers.

In eCommerce, "Shoppers" is pivotal in understanding and enhancing the consumer experience. Shoppers are individuals or entities browsing or purchasing products and services via online platforms. With the advent of sophisticated eCommerce solutions, maintaining and managing shopper records has become essential for businesses aiming to personalize shopping experiences and streamline transaction processes. This section delves into the fundamental aspects of creating and managing shopper records, specifically focusing on using the Commerce API to establish a comprehensive shopper profile. Understanding the nuances of shopper interactions not only aids in tailoring personalized content but also in optimizing the overall efficiency of eCommerce operations.

Creating a current shopper

Creating a shopper record is a great way to personalize the buyer's journey and simplify transaction processes. This guide will provide a detailed walkthrough on creating a new shopper record using the Commerce API. Following the instructions below, you can create a shopper record for your eCommerce platform, ensuring smooth and efficient operations.

Contact your Digital River team to facilitate this setup if required.

To create a shopper record, you must send a POST /v1/shoppers request to Digital River's API. Here's how you can do it using cURL:

curl --location --request POST 'https://api.digitalriver.com/v1/shoppers' \
--header 'authorization: bearer [Your_Authorization_Token]' \
--data-raw '{
  "shopper": {
    "username": "[Shopper_Email]",
    "firstName": "[Shopper_Email_FirstName]",
    "lastName": "[Shopper_Email_LastName]",
    "emailAddress": "[Shopper_Email_Email]",
    "password": "[Shopper_Email_Password]",
    "locale": "en_US",
    "currency": "USD",
    "sendMail": true,
    "sendEMail": true
  }
}

Make sure to replace [Shopper_Email_Authorization_Token], [Shopper_Email_Email], [Shopper_Email_FirstName], [Shopper_Email_LastName], and [Shopper_Email_Password] with your actual details. Also, ensure you have proper authorization and permissions set up.

See Shoppers query parameters for a description of the query parameters.

Updating a current shopper

Use POST /v1/shoppers/me request to update the current shopper's information via the Commerce API. It requires an authenticated shopper token. The payload must include the details you wish to update, such as the shopper's username, first name, last name, email address, password, locale, and currency. A successful update returns a 204 status code.

Here's an example cURL request to update shopper information:

curl --location --request POST 'https://api.digitalriver.com/v1/shoppers/me' \
--header 'authorization: bearer ***\
...
--data-raw '{
  "shopper": {
    "username": "jswanson@digitalriver.com",
    "firstName": "Automation",
    "lastName": "Tester",
    "emailAddress": "jswanson@digitalriver.com",
    "password": "qwerasdf",
    "locale": "en_US",
    "currency": "USD",
    "sendMail": true,
    "sendEMail": true
  }
}'

Replace [Your_Authorization_Token], [New_Username], [New_FirstName], [New_LastName], [New_Email], and [New_Password] with the updated information of the shopper. Ensure you have proper authorization before attempting to update shopper data.

The information you can update depends on the type of access token you are currently using. If you have an anonymous shopper token and are updating an anonymous shopper, you can only update the IP address, locale, and currency. Updating shopper information beyond that requires an authenticated shopper token. You can update all shopper information, including username and password for an authenticated shopper.

See Shoppers query parameters for a description of the query parameters.

Getting a current shopper

You can use the GET /v1/shoppers/me request to retrieve shopper's data for both anonymous and authenticated shoppers. Here's how to do it using cURL:

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me' \
--header 'authorization: bearer [Your_Authorization_Token]'
...

Replace [Your_Authorization_Token] with your actual authorization token. Successful requests will return a 200 OK response, along with the shopper's details, such as username, first name, last name, email address, and links to their payment options, addresses, orders, and subscriptions.

Last updated