Search…
Single-click checkout
Learn how to use a single-click checkout.
Use a single-click checkout to purchase a product on behalf of a customer during an authenticated customer session. This resource bypasses calling the Apply Shopper and Submit Cart resources separately and instantly purchases a single product. A typical example of a product purchased via this API is an auto-renewal, such as a subscription.
The product-direct purchase API performs the following actions with one Shopper API call:

Prerequisite

The request requires a valid authenticated customer token.
  1. 1.
    Adds a product to the cart.
  2. 2.
    Applies the default customer address to the cart.
  3. 3.
    Applies the default payment option to the cart.
  4. 4.
    Submits the cart.
  5. 5.
    Creates an order.
Send a Product request with the specific product ID for the product that the customer wants to purchase. The following request sample purchases a product with a product ID of 291233200.
The response header contains a Location header, as shown on line 4, to the order created for the transaction. The ID of the order is 1234567890. The request and response bodies are empty.
Request sample
Response sample
1
POST https://api.digitalriver.com/v1/shoppers/me/products/291233200/purchase
Copied!
1
HTTP/1.1 201 Created
2
Server: Apache
3
X-Server-Name: server.xyz.digitalriverws.net
4
Location: https://api.digitalriver.com/shoppers/me/orders/1234567890
5
Content-Length: 0
6
Accept-Ranges: bytes
7
Date: Fri, 17 Jan 2014 16:46:30 GMT
8
Age: 0
9
Access-Control-Allow-Origin: *
10
HTTP/1.1 201 Created
11
Server: Apache
12
X-Server-Name: server.xyz.digitalriverws.net
13
Location: https://api.digitalriver.com/shoppers/me/orders/1234567890
14
Content-Length: 0
15
Accept-Ranges: bytes
16
Date: Fri, 17 Jan 2014 16:46:30 GMT
17
Age: 0
18
Access-Control-Allow-Origin: *
Copied!
No further calls are required. If applicable, you can make follow-up calls to get the order by its ID or the order history for the customer.
Copy link
Contents