Specifying a shipping choice

Learn how to configure your shipping choices when creating a Checkout

Overview

The shippingChoice object represents the shipping amount, description, taxes, and service level. When creating or updating a Checkout, you can pass in the amount, description, and serviceLevelparameters.

When you define your shippingChoice, you must provide the amount value. All other parameters are optional.

Parameter

Required/Optional

Description

amount

Required

Represents the shipping choice amount

description

Optional

A string that describes the shipping choice

serviceLevel

Optional

In the service level table, the Shipping Code column provides a list of enumerated values. While not required, it's important to specify this code for fraud screening and reporting purposes.

Service level values

In the following table, the Shipping Code column lists the enumerated values of theserviceLevel attribute:

Service Level Type

Name

Shipping Code

Delivery Type

accessPoint Express

Access Point Express

A1

AccessPoint

accessPointStandard

Access Point Standard

AG

AccessPoint

expressNextDay

Express Next Day

D1

Standard

expressSecondDay

Express Second Day

D2

Standard

inHome

In-Home

IH

Standard

internationalExpress

International Express

IC

Standard

internationalStandard

International Standard

IS

Standard

standard

Standard

SG

Standard

standardCOD

Standard COD

COD

CashOnDelivery

The following POST /checkouts request uses the "SG" shipping code to specify a standard service level:

Make sure you specify the shipTo parameters. Without them, Digital River can't calculate taxes on either the items or the shippingChoice.

cURL
cURL
curl https://api.digitalriver.com/checkouts \
-u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
-d currency=usd \
-d items[0][skuId]=9234276173 \
-d items[0][price]=10.00 \
-d items[0][quantity]=3 \
-d shipTo[address][line1]=10380 Bren Road West \
-d shipTo[address][city]=Minnetonka \
-d shipTo[address][postalCode]=55343 \
-d shipTo[address][state]=MN \
-d shipTo[address][country]=US \
-d shippingChoice[amount]="5.00" \
-d shippingChoice[description]="USPS: Priority (1 day delivery)" \
-d shippingChoice[serviceLevel]= "SG"

In this example, a successful request returns the calculated shipping tax.rate and tax.amount :

JSON
JSON
"shippingChoice": {
"amount": 5.0,
"description": "USPS: Priority (1 day delivery)",
"serviceLevel": "SG",
"tax": {
"rate": 0.076,
"amount": 0.38
}
},

Determining shipping taxes

Refer to Getting shipping taxes to learn how to use the taxInclusive parameter to return shipping taxes.