Products

Learn how to retrieve product information.

In the world of eCommerce, products are the foundation of your inventory. Each product represents an item available for purchase and includes a comprehensive set of attributes that define its characteristics, pricing, and availability. This section will cover various aspects of product management within the Commerce API, including how to effectively retrieve, list, and handle products to streamline your eCommerce operations.

Getting a product by identifier

When integrating with the Commerce API, retrieving product information efficiently is essential. One of the fundamental tasks is obtaining a product by its unique identifier. This section will guide you through fetching detailed product data. By following these instructions, you can ensure access to all necessary product attributes, enabling seamless eCommerce operations.

To get a product by its identifier, send a GET /v1/shoppers/me/products/{productId} request. This request retrieves detailed information about the specified product. Replace {Your_Access_Token} and {productId} with your actual values.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products/{productId}' \
--header 'authorization: bearer {Your_Access_token}\
...

A 200 OK response indicates that the request was successful, and the server returned the requested data. Your GET request to fetch the product information was processed correctly, and you received the relevant product details in the response body.

Getting volume pricing for a specific product

Understanding volume pricing is crucial for optimizing sales and offering customers attractive discounts when managing eCommerce pricing. The Commerce API allows you to retrieve tailored volume pricing for specific products. This section will guide you through fetching volume pricing details. By following these instructions, you can efficiently access and display volume-based pricing information, enhancing your product offerings and promotional strategies.

To get volume pricing for a specific product, send a GET /v1/shoppers/me/products/{productId}/pricing/volume-pricing request. Replace {Your_Access_Token} and {productId} with your actual values.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products/{productId}/pricing/volume-pricing' \
--header 'authorization: bearer {Your_Access_token}'

A 200 OK response means the request was successful, and the server returned the requested data. Your GET request to retrieve the volume pricing information for a specific product was processed correctly, and you received the relevant volume pricing details in the response body.

Getting all products from the product catalog

Retrieving the complete product catalog lets you offer your customers a comprehensive view of all available products. This can enhance the shopping experience by ensuring shoppers can access your store's products. The following instructions will guide you through fetching all products from your product catalog using the Commerce API.

To retrieve all products from the product catalog, send a GET /v1/shoppers/me/products request. Replace {Your_Access_token} with your actual access token.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products' \
--header 'authorization: bearer {Your_Access_token}'

A 200 OK response indicates that the request was successful and returns the product catalog information in the response body.

Getting all products for a specified category

You may often need to retrieve all products within a specific category to enhance user experience and streamline product searches. The following instructions will guide you through fetching all products for a specified category using the Commerce API. This ensures that customers can easily discover and explore products that meet their needs.

Send a GET /v1/shoppers/me/categories/{categoryId}/products request, replacing {categoryId} with the actual category ID to get all products for a specified category. Replace {Your_Access_token} with your actual access token.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/categories/{categoryId}/products' \
--header 'authorization: bearer {Your_Access_token}\
...

A 200 OK response indicates that the request was successful and returns the product category information in the response body.

Getting a base product, individual product, or product combination

Use the GET /v1/products/{productId or ERID} request to get data for a base product, individual product, or product combinations. Replace the {productId or ERID} placeholder with the appropriate product identifier to retrieve detailed product information. Replace {your_API_key} with your actual access token. If multiple products are associated with the ERID, the response will include all of them.

Duplicate ERIDs are not allowed. To prevent duplicate ERIDs, enable the Enforce Unique Value when configuring company settings in Global Commerce. This ensures that you won't accidentally provide an ERID that would result in duplicate products in the response if you searched for a product by ERID.

The following example gets a specific base or individual product with a productId.

curl --location --request GET 'https://api.digitalriver.com/v1/products/{productId}' \
--header 'Authorization: Basic {your_API_key}' \
...

An ERID request requires the x-erid-as-pid=true header.

curl --location --request GET 'https://api.digitalriver.com/v1/products/{ERID}' \
--header 'Authorization: Basic {your_API_key}' \
--header 'header x-erid-as-pid=true' \
...

Getting the deployed or retired versions of a product

The Digital River API provides convenient query parameters to retrieve specific product versions, such as the deployed or retired versions. By specifying version=RETIRED or version=DEPLOYED you can access detailed information about these product states in your request URL. This functionality helps you effectively manage and review different product lifecycle stages. For ERID requests, ensure you include the x-erid-as-pid=true header for accurate retrieval.

To get a retired product version, specify the version=RETIRED query parameter in the GET /v1/products/{productId} request URL. Replace the {productId or ERID} placeholder with the appropriate product identifier to retrieve detailed product information. Replace {your_API_key} with your actual access token. For ERID requests, include the x-erid-as-pid=true header.

The following example gets retired versions of a specific product with a productId.

curl --location --request GET 'https://api.digitalriver.com/v1/products/{productId}?version=RETIRED' \
--header 'Authorization: Basic {your_API_key}' \
...

An ERID request requires the x-erid-as-pid=true header.

curl --location --request GET 'https://api.digitalriver.com/v1/products/{ERID}?version=RETIRED' \
--header 'Authorization: Basic <{your_API_key}' \
--header 'header x-erid-as-pid=true' \
...

Include the version=DEPLOYED query parameter in the GET /v1/products/{productId} request URL to get a deployed product version. Replace {productId or ERID} with the appropriate product identifier and {your_API_key} with your actual access token. For ERID requests, include the x-erid-as-pid=true header.

The following example gets deployed versions of a specified product with a productId.

curl --location --request GET 'https://api.digitalriver.com/v1/products/[productId}?version=DEPLOYED' \
--header 'Authorization: Basic {your_API_key}' \
...

An ERID request requires the x-erid-as-pid=true header.

curl --location --request POST 'https://api.digitalriver.com/v1/products/{ERID}?version=DEPLOYED' \
--header 'Authorization: Basic {your_API_key}' \
--header 'header x-erid-as-pid=true' \
...

See the version query parameter for more information.

Last updated