Using webhooks
Create a subscription response
To create a subscription response, you will receive a webhook with a 201 Created
status, which includes a unique identifier and details about the newly created subscription. Use this data to build email notifications and integrate with Commerce APIs for additional information. Here is a sample of the response structure you can expect:
Ensure to handle the id
and data
fields appropriately to extract the subscription details required for your application. This response can confirm the creation of a subscription and relay necessary information to the subscriber or internal systems for further processing.
In the example below, the initial id
represents the subscription identifier. The subscription identifier appears as subId
in the Subscription resource. For example, use subId
to list all orders associated with a subscription in https://www.digitalriver.com/v1/subscriptions/{subId}/orders
. It also provides additional subscription details.
Retrieve an anonymous shopper's orders and production information
To retrieve an anonymous shopper's orders and product information, follow these steps:
Obtain a token for the anonymous shopper Begin by obtaining an access token using the anonymous shopper's ID by sending a POST request to Digital River's OAuth token endpoint:
Replace
{anonymousShopperId}
with the actual shopper ID provided in the subscription details undershopper.id
.Use the token to access orders and product Information Once you have received a session token, you can access the shopper's order and product information.
Get product information: Retrieve product details by making a GET request to:
Ensure to replace
{productId}
with the specific product ID you wish to view.Get order information: Fetch order details by making a GET request to:
This allows you to list all orders associated with the anonymous shopper.
Last updated