Managing 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 current shopper involves generating a new profile on your eCommerce platform using the Commerce API. Establishing a detailed shopper record offers shoppers a more personalized and efficient shopping experience. This process is essential for tracking shopper interactions, managing accounts, and optimizing transaction workflows. In the following sections, we'll guide you through setting up a shopper record, ensuring you can seamlessly integrate and maintain shopper data for enhanced eCommerce operations.

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

To create a current shopper, send a POST /v1/shoppers request to the Commerce API and include the bearer token. Use the shopper object to provide the shopper's information in the request body.

Replace the following parameters with your actual details. Also, ensure you have proper authorization and permissions set up.

  • [Your_Authorization_Token]: The bearer token for API authentication.

  • [Shopper_Email]: The username of the shopper.

  • [Shopper_Email_FirstName]: The first name of the shopper.

  • [Shopper_Email_LastName]: The last name of the shopper.

  • [Shopper_Email_Email]: The email address of the shopper.

  • [Shopper_Email_Password]: The password for the shopper's account.

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
  }
}

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

Updating a current shopper

Updating a shopper's information is essential for maintaining accurate and up-to-date customer records. This section provides detailed instructions and examples for updating a current shopper's information using the Commerce API.

To update a current shopper, send a POST /v1/shoppers/me request to the Commerce API with the authenticated shopper token. Replace the parameters in the shopper object with the updated information of the shopper. Ensure you have proper authorization before attempting to update shopper data. 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
  }
}'

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

To retrieve the details of the current shopper, whether they are anonymous or authenticated, you can send a GET /v1/shoppers/me request. This operation allows you to access various details about the shopper, such as their username, email address, payment options, addresses, orders, and subscriptions.

Replace [Your_Authorization_Token] with your actual authorization token. A successful request will return the shopper's details in a 200 OK response. See the example below:

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

Last updated