Quick Start

This guide will take you through the minimum required steps to begin making API requests.

By the end of this guide, you will be able to define your SKUs, create a checkout and an order.

Step 1. Define your SKUs

You can start by creating your SKUs programmatically:

cURL
cURL
curl https://api.digitalriver.com/skus \
-u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
-d id="5823594809" \
-d name="Athena Womens Running Shoes" \
-d eccn="9E003" \
-d taxCode="531029.2" \
-d weight="20.5" \
-d weightUnit="oz" \
-d partNumber="SWG1224J10L"

A successful request returns the SKU object:

Response example
Response example
{
"id": "5823594809",
"createdTime": "2018-04-25T20:36:00Z",
"eccn": "9E003",
"taxCode": "531029.2",
"name": "Athena Womens Running Shoes",
"weight": "20.5",
"weightUnit": "oz",
"partNumber": "SWG1224J10L"
}

Step 2. Create checkouts and orders

Option 1.

Once you create your SKUs, you can start creating checkouts. When using checkouts, your checkout flow will look something like this:

  1. Customer picks one or more SKUs they want to purchase.

  2. Create a checkout containing those items and the customer shipping choice to retrieve tax from Digital River.

  3. Customer provides payment details via DigitalRiver.js.

  4. Update the checkout with the payment source identifier returned by DigitalRiver.js.

  5. Create the order passing the checkout identifier as a parameter.

To create a checkout, specify the SKUs the customer wants to purchase, the customer's shipping address, and the shipping choice:

cURL
cURL
curl https://api.digitalriver.com/checkouts \
-u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
-d currency=usd \
-d email="jsmith@digitalriver.com" \
-d items[0][skuId]=sku_9234276173 \
-d items[0][price]=9.29 \
-d items[0][quantity]=2 \
-d shipping[name]="John Smith" \
-d shipping[phone]="952-111-1111" \
-d shipping[email]="jsmith@digitalriver.com" \
-d shipping[address][line1]="10380 Bren Rd W" \
-d shipping[address][city]="Minnetonka" \
-d shipping[address][postalCode]="55129" \
-d shipping[address][state]="MN" \
-d shipping[address][country]="US"
-d shippingChoice ??? Add details ???

A successful request returns the Checkout object:

Response example
Response example
{
"id": "co_5823594809",
"createdTime": "2019-04-25T20:36:00Z",
"currency": "usd",
"email": "jsmith@digitalriver.com",
"shipping": {
"address": {
"line1": "10380 Bren Rd W",
"line2": "string",
"city": "Minnetonka",
"postalCode": "55129",
"state": "MN",
"country": "US"
},
"name": "John Smith",
"phone": "952-111-1111",
"email": "jsmith@digitalriver.com"
},
"totalTax": 1.40,
"totalFees": 0,
"totalDuty": 0,
"totalDiscount": 5.95,
"totalShipping": 0,
"totalAmount": 19.98,
"items": [
{
"skuId": "sku_9234276173",
"price": 9.29,
"quantity": 2,
"amount": 19.98
}
],
"shippingChoice": {
"id": "9292981838",
"amount": 5.95,
"description": "USPS: Priority (1 day delivery)"
},
"paymentSessionId": "ps_8cecaa32-f692-44cc-b103-4cf24dc93913",
"updatedTime": "2018-04-25T20:37:00Z"
"livemode": false
}

You should store the id and present the checkout and tax totals to your customer. When your customer is ready to pay, you can collect their payment details and update the checkout with the source identifier returned by DigitalRiver.js. Finally, you can create an order like this:

cURL
cURL
curl https://api.digitalriver.com/orders \
-u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
-d checkoutId=:checkoutId

A successful request returns the Order object:

Response example
Response example
{
"id": "9986340012",
"createdTime": "2019-04-25T20:36:00Z",
"currency": "USD",
"email": "jsmith@digitalriver.com",
"shipping": {
"address": {
"line1": "10380 Bren Rd W",
"city": "Minnetonka",
"postalCode": "55129",
"state": "MN",
"country": "US"
},
"name": "John Smith",
"phone": "952-111-1111",
"email": "jsmith@digitalriver.com"
},
"totalTax": 1.40,
"totalFees": 0,
"totalDuty": 0,
"totalDiscount": 5.95,
"totalShipping": 0,
"totalAmount": 19.98,
"items": [
{
"skuId": "sku_9234276173",
"price": 9.29,
"quantity": 2,
"amount": 19.98
}
],
"shippingChoice": {
"id": "9292981838",
"amount": 5.95,
"description": "USPS: Priority (1 day delivery)"
},
"paymentSessionId": "ps_8cecaa32-f692-44cc-b103-4cf24dc93913",
"state": "submitted",
"stateTransitions" {
"submitted": "2019-04-25T20:42:43Z"
},
"fraudState": "passed",
"fraudstateTransitions" {
"passed": "2019-04-25T20:42:43Z"
},
"sourceId": "798734995",
"charges": [
{
"id": "a6809a63-e6a9-4016-abbc-f33d19fccb5b",
"createdTime": "2018-04-25T20:36:00Z",
"currency": "USD",
"amount": 19.98,
"state": "pending",
"sourceId": 798734995,
"paymentSessionId": "8cecaa32-f692-44cc-b103-4cf24dc93913",
"captured": false
}],
"livemode": false
"updatedTime": "2019-04-25T20:42:43Z"
}

Option 2.

For an existing customer with a saved payment method, you can create an order in a single step.

cURL
cURL
curl https://api.digitalriver.com/orders \
-u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
-d checkout[currency]=usd \
-d checkout[shipping][address][state]=MN
-d shipping[name]="John Smith" \
-d shipping[phone]="952-111-1111" \
-d shipping[email]="jsmith@digitalriver.com" \
-d shipping[address][line1]="10380 Bren Rd W" \
-d shipping[address][city]="Minnetonka" \
-d shipping[address][postalCode]="55129" \
-d shipping[address][state]="MN" \
-d shipping[address][country]="US"
-d shippingChoice[amount]="5.95"
-d shippingChoice[name]="USPS: Priority (1 day delivery)"