LogoLogo
System Status
  • Digital River API
  • Getting started
  • Using our services
    • Local pricing
    • Item classification
    • Subscriptions
    • e-Invoicing
  • Integration options
    • Low-code checkouts
      • Implementing a Prebuilt Checkout
      • Implementing a Components checkout
      • Offering local pricing
      • Using a shipping endpoint
      • Processing subscription acquisitions
      • Adding custom fields
      • Offering store credit
      • Displaying policies and getting consent
      • Collecting e-invoice information
      • Handling completed checkout-sessions
    • Direct integrations
      • Standard flow
      • Building checkouts
        • Checking out guest and registered customers
        • Describing line items
          • Setting the price of an item
          • Managing items with shared SKU identifiers
        • Providing address information
        • Handling shipping choice
        • Tax identifiers
        • Applying a discount
        • Setting the customer type
        • Providing the IP address
        • Selecting a currency
        • Initiating a charge
        • Setting the purchase location
        • Configuring taxes
        • Accessing regulatory fee information
        • Localizing invoices and credit memos
        • Providing an upstream identifier
        • Applying store credit
        • Handling e-invoicing requirements
        • Landed cost
        • Tax calculation inputs
        • Selling entities
        • Payment sessions
        • Applying store credit (legacy)
        • Country specs
      • Building payment workflows
        • Handling redirect payment methods
        • Handling delayed payment methods
      • Subscription acquisitions
        • Handling subscription acquisitions
        • Handling external subscription acquisitions
        • Subscription information
      • Digital River coordinated fulfillments
        • Checking inventory levels
        • Using shipping quotes
        • Reserving inventory items
        • Managing a fulfillment order
        • Cancelling a fulfillment order
    • Connectors
  • Order management
    • Processing orders
    • Handling a rejected order
    • Accessing invoices and credit memos
    • Fulfilling goods and services
    • Capturing and cancelling charges
    • Payment reauthorizations
    • Handling reversals
      • Return basics
        • Digital River coordinated returns
        • Third party coordinated returns
      • Refund basics
        • Issuing refunds
        • Refunding asynchronous payment methods
      • Disputes and chargebacks
    • Customer notifications
    • Responding to events
      • Events
        • Key event types
        • All event types
      • Webhooks
        • Creating a webhook
        • Digital River API safelist
        • Digital River signature
      • Expanding events
      • Preventing webhooks from getting disabled
    • Distributor model
  • Subscription Management
    • Managing a subscription
    • Managing an external subscription
  • Payments
    • Payment solutions
      • Drop-in payments
        • How Drop-in payments work
        • Drop-in payments integration guide
      • DigitalRiver.js with Elements
        • Elements integration guide
        • Configuring payment methods
          • Configuring Afterpay
          • Configuring Alipay+ (cross-border)
          • Configuring Alipay (domestic)
          • Configuring Amazon Pay
          • Configuring Apple Pay
          • Configuring Bancontact
          • Configuring BNP Paribas
          • Configuring BLIK
          • Configuring CCAvenue
          • Configuring Clearpay
          • Configuring Credit Cards
          • Configuring FPX Online Banking
          • Configuring Google Pay
          • Configuring iDEAL
          • Configuring Klarna
          • Configuring Konbini
          • Configuring Online Banking (IBP)
          • Configuring Online Banking (Korea Bank Transfer)
          • Configuring PayCo
          • Configuring PayPal
          • Configuring SEPA Direct Debit
          • Configuring Trustly
          • Configuring Wire Transfer
          • Common payment sources
          • Common payment objects
    • Supported payment methods
      • Afterpay
      • Alipay (domestic)
      • Alipay+ (cross-border)
      • Amazon Pay
      • Apple Pay
      • Bancontact
      • BNP Paribas
      • BLIK
      • CCAvenue
      • Clearpay
      • Credit Cards
      • FPX Online Banking
      • Google Pay
      • iDEAL
      • Klarna
      • Konbini
      • Korea Bank Transfer (Online Banking)
      • Online Banking (IBP)
      • Pay with Installments France
      • PayCo
      • PayPal
      • PayPal Billing Agreement
      • PayPal Credit
      • PayPal Pay in 3
      • PayPal Pay in 4
      • PayPal RatenZahlung (Installment Payment)
      • SEPA Direct Debit
      • Trustly
      • Wire Transfer
    • Source basics
      • Managing sources
      • Handling credit card sources
      • Retrieving sources
    • Authorization declines
    • PSD2 and SCA
      • How to ensure SCA compliance
    • Payment testing scenarios
  • Product management
    • Product basics
    • Managing SKUs
    • Using product details
    • Grouping SKUs
    • SKU-inventory item pairs
    • Managing inventory items
    • Regulatory fees
      • What are regulatory fees?
        • Fees terminology
        • Regulatory fee management
        • European regulatory fees
        • Compliance obligations
        • WEEE directive requirements
        • Copyright directive requirements
        • Compliance challenges
      • Managing regulatory fees
  • Customer management
    • Customer basics
    • Creating and updating customers
    • Setting up tax exemptions
    • Recording a customer's request to be forgotten
  • Financial reporting
    • Financials basics
    • Sales transactions
      • Returning a list of sales transactions
      • Getting a sales transaction by ID
    • Sales summaries
      • Returning a list of sales summaries
      • Getting a sales summary by ID
    • Payouts
      • Returning a list of payouts
      • Getting a payout by ID
      • Get a list of transactions included in payout by ID
  • Developer resources
    • Digital River API reference
    • DigitalRiver.js reference
      • Including DigitalRiver.js
      • Initializing DigitalRiver.js
      • DigitalRiver object
      • Elements
        • Amazon Pay element
        • Apple Pay elements
        • Google Pay elements
        • IBAN element
        • iDEAL element
        • Konbini elements
        • Compliance element
        • Offline Refund elements
        • Online Banking elements
        • Tax Identifier element
        • Invoice attribute element
        • Delayed Payment Instructions element
        • PayPal elements
      • Guidelines for capturing payment details
      • Security
      • Digital River payment objects
      • Error types, codes, and objects
    • DigitalRiverCheckout.js reference
      • Including DigitalRiverCheckout.js
      • Initializing DigitalRiverCheckout.js
        • DigitalRiverCheckout configuration object
      • DigitalRiverCheckout object
        • Configuring Prebuilt Checkout
          • Performing actions
          • Defining experience
        • Components
          • Configuring components
          • Address component
          • Shipping component
          • Tax identifier component
          • Invoice component
          • Wallet component
          • Payment component
          • Compliance component
          • Order summary component
          • Thank you component
        • Rendering a checkout button
          • Performing actions on the checkout button
        • Determining the checkout's status
      • Accessing country and currency
    • DynamicPricing.js reference
    • Postman collection
  • administration
    • Sign in
    • Digital River Dashboard
      • Digital River Dashboard quick start guide
      • Key features
      • Reset your password
      • Test and production environments
      • Account
        • Adding an account
        • Switching accounts
        • Account access
      • Profile settings
        • Viewing your personal information
        • Changing your password
        • Updating your phone number
        • Enabling multi-factor authentication
      • Finance
        • Payouts
          • Viewing your payout details
          • Filtering your payouts
          • Exporting your payouts
        • Sales summaries
          • Viewing your sales summaries details
          • Filtering your sales summaries
          • Exporting your sales summaries
          • Exporting your sales summary details
        • Transactions
          • Viewing your transaction details
          • Filtering your transactions
          • Exporting your transactions
      • Order management
        • Orders
          • Searching for orders
          • Filtering your orders
          • Viewing the order details
          • Cancelling items
          • Fulfilling items
          • Downloading an invoice
          • Downloading a credit memo
          • Creating shipping labels
          • Recording a customer's request to be forgotten
          • Viewing returns and refunds
          • Creating a return
          • Accepting a return
          • Creating a refund
          • Viewing the order's timeline
        • Checkouts
          • Searching for checkouts
          • Filtering your checkouts
          • Viewing the checkout details
        • Prebuilt Checkout links
          • Generate Prebuilt Checkout links
          • View and work with Prebuilt Checkout link details
          • Add a customer during Prebuilt Checkout
          • Add a product during Prebuilt Checkout
      • Customers
        • Viewing customer details
        • Searching for customers
        • Filtering your customers
        • Editing account information
        • Adding a customer
        • Tax IDs and certificates
          • Adding a tax certificate
          • Adding a tax ID
          • Deleting a tax ID
        • Metadata
          • Adding metadata
          • Editing metadata
        • Manage subscriptions from the Customer Details page
        • Disabling a customer
        • Recording a customer's request to be forgotten
        • Deleting a customer
      • Catalog
        • SKUs
          • Viewing the SKU details
          • Searching for SKUs
          • Filtering your SKUs
          • Adding a SKU
          • Editing a SKU
          • Deleting a SKU
          • Adding a fee to a SKU
          • Editing a fee
          • Deleting a fee
          • Viewing product tariff codes
        • Managing customer subscriptions from Digital River Dashboard
      • Developers
        • API keys
          • Updating your API version
          • Getting your API keys
          • Changing the API version for your key
          • Creating a restricted key
          • Editing a restricted key
          • Deleting a restricted key
          • Rotating keys
        • Webhooks
          • Creating a webhook
          • Editing a webhook
          • Deleting a webhook
          • Rotating a webhook's secret
        • API logs
          • Filtering the API log
          • Viewing the API log details
        • Event logs
          • Filtering the events log
          • Viewing the event details
      • Settings
        • Users and roles
          • Roles
          • Searching for a user by name or email
          • Filtering your users and roles
          • Adding a user
          • Editing a user
          • Deleting a user
        • Prebuilt Checkout
        • Payment methods
          • Viewing your payment methods
          • Viewing payment method details
            • Enabling currencies
            • Managing countries
          • Enabling or disabling a payment method
  • General Resources
    • eCompass
    • eCompass documentation
    • Release notes
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
    • Standards and certifications
      • Certification process
      • Compliance requirements
      • Documentation requirements
      • Integration checklists
        • Admin portal
        • Products and SKUs
        • Customers and tax exemptions
        • Checkouts, payment sources, and orders
        • Disclosures, compliance statements, and emails
        • Fulfillments and cancellations
        • Customer portal
        • Order refund synchronization
        • Reversals
        • Error handling
      • Test and use cases
    • Commerce infrastructure
    • Versioning
    • Glossary
Powered by GitBook
On this page
  • Creating the checkout-session
  • Restricting available ship to countries
  • Using the endpoint with an external logistics provider
  • The shipping quotes request
  • Processing and responding to our request
  • How Digital River processes your response
  • Defining the ship request
  • Displaying errors
  • Prebuilt Checkout
  • Components
  1. Integration options
  2. Low-code checkouts

Using a shipping endpoint

Gain a better understanding of how you can use a shipping endpoint to present dynamic shipping options in low-code checkouts

PreviousOffering local pricingNextProcessing subscription acquisitions

Last updated 2 months ago

With , you can save a . Digital River calls it during physical product checkouts and uses the response to present customers with their shipping options.

If you are using an external logistics provider, the service you set up to handle our call can either filter and adjust the shipping options we send or use the request's data to make yet another request to your external provider to get their available options.

In both cases, you must respond with the options you want us to present to customers in the shipping choice selection stage.

On this page, you’ll find details on:

Creating the checkout-session

In your , include the weight and weightUnit of each in the cart in either the referenced by items[].skuId or directly in .

A product's weight should be exclusive of its packaging but inclusive of its . In other words, don't include the weight of the product's box, but include the weight of the protective and supporting materials inside it.

Goods eligible for inclusion in should also be assigned a name, description, image, and url. They must also contain a product taxonomy to identify the correct tariff codes. For details, refer to .

For each physical items[], if you want the carrier to provide one or more logisticsOptions, and you decided not to save these options to the product's , then make sure you enumerate them in deliveryOptions[] and/or dangerousGoods[]. This ensures that the cost of each service gets added to the shipping quotes customers select from.

Restricting available ship to countries

You'll need to restrict the countries customers can select from during the shipping address collection stage to those you support.

Using the endpoint with an external logistics provider

The shipping quotes request

Request
{
    "sessionId": "8e8f8a1b-4049-4e4f-a8b6-d5c6a90b713b",
    "currency": "USD",
    "shipTo": {
        "address": {
            "line1": "1234 Rocky Mountain Highway",
            "city": "Estes Park",
            "state": "CO",
            "postalCode": "80517",
            "country": "US"
        },
        "name": "John D.",
        "phone": "5555555555",
        "email": "jdenver@digitalriver.com"
    },
    "items": [
        {
            "sku": {
                "id": "sku_e628c0d0-33b7-4dea-aa40-9eadc43e1583",
                "name": "Blue shirt",
                "eccn": "8A992",
                "taxCode": "55101504.100",
                "image": "https://mdbootstrap.com/img/Photos/Horizontal/E-commerce/Vertical/12.jpg",
                "url": "https://digitalriver.com/blue-shirt",
                "physical": true,
                "skuGroupId": "physical-product",
                "weight": 20.5,
                "weightUnit": "oz"
            },
            "amount": 11.95,
            "quantity": 1,
            "id": "714eb8ef-5a11-4faa-b6e5-35992d01d628"
        },
        {
            "sku": {
                "id": "sku_32ee813a-e7a8-46dc-97f4-fca07b47eca6",
                "name": "Red shirt",
                "eccn": "8A992",
                "taxCode": "55101504.100",
                "image": "https://mdbootstrap.com/img/Photos/Horizontal/E-commerce/Vertical/12.jpg",
                "url": "https://digitalriver.com/red-shirt",
                "physical": true,
                "skuGroupId": "physical-product",
                "weight": 20.5,
                "weightUnit": "oz"
            },
            "amount": 11.95,
            "quantity": 1,
            "id": "945gh8ed-3g21-6ffg-mj6e6-45113e11d628"
        }
    ]
}

Since we don't yet know what shipping options are available, the request contains no shippingMethods[].

For each items[], we also give you an id that uniquely identifies that line item in our system.

Processing and responding to our request

After you accept our request and determine that it contains no shippingMethods[], you can use its currency, items[], and shipTo to call your logistics provider and get the transaction’s available shipping options.

In that request, you'll most likely want to pass the weight and weightUnit of each items[]. Your logistics provider can typically use that data for more precise shipping rates.

In addition, depending on the sophistication of the integration you have with your provider, they might be able to give you the location of the warehouse(s) from which each items[] will be shipped.

After your logistics provider returns the available shipping options, your service could add a markup, discount them, and/or filter them by terms.

Your response must contain shippingMethods[], which lists the options you want Digital River to present in the shipping choice selection stage. Each element in this array must have an amount, description, and serviceLevel and can optionally include an id, deliveryInformation, shippingTerms, and a shipFrom location.

If your logistic provider informed you where each line item is shipping from, your response can also contain shipments[], each of which should have a single shipFrom and an array of itemIds[], each mapped to an items[].id we sent in the request.

Response
{
    "shipments": [
        {
            "itemIds": [
                "714eb8ef-5a11-4faa-b6e5-35992d01d628"
            ],
            "shipFrom": {
                "address": {
                    "line1": "10380 Bren Rd W",
                    "city": "Minnetonka",
                    "postalCode": "55343",
                    "state": "MN",
                    "country": "US"
                }
            }
        },
        {
            "itemIds": [
                "945gh8ed-3g21-6ffg-mj6e6-45113e11d628"
            ],
            "shipFrom": {
                "address": {
                    "line1": "1234 5th Ave",
                    "city": "New York",
                    "postalCode": "10005",
                    "state": "NY",
                    "country": "US"
                }
            }
        }
    ],
    "shippingMethods": [
        {
            "description": "Standard Shipping",
            "serviceLevel": "Standard",
            "amount": 2.99
        },
        {
            "description": "Expedited Shipping",
            "serviceLevel": "Expedited",
            "amount": 10.98
        }
    ]
}

How Digital River processes your response

For each shippingMethods[], Digital River displays its amount, description, and shippingTerms to customers in the shipping choice selection stage. If businessDaysInTransit, estimatedArrival.date, and/or estimatedArrival.dayOfWeek exist in deliveryInformation, then their values are also displayed.

Defining the ship request

Event
{
    "id": "a443e1ee-61ec-4f9c-8c27-97b144c8f8f5",
    "type": "order.accepted",
    "data": {
        "object": {
            "id": "255896870336",
            ...
            "items": [
                {
                    "id": "185466030336",
                    "productDetails": {
                        "id": "physical-product-1",
                        "skuGroupId": "physical-product",
                        "name": "Blue shirt",
                        "url": "https://digitalriver.com/blue-shirt",
                        "countryOfOrigin": "US",
                        "image": "https://mdbootstrap.com/img/Photos/Horizontal/E-commerce/Vertical/12.jpg",
                        "weight": 20.5,
                        "weightUnit": "oz",
                        "partNumber": "Part123"
                    },
                    ...
                    "shipFrom": {
                        "address": {
                            "line1": "10380 Bren Rd W",
                            "city": "Minnetonka",
                            "postalCode": "55343",
                            "state": "MN",
                            "country": "US"
                        }
                    },
                    ...
                },
                {
                    "id": "185466050336",
                    "productDetails": {
                        "id": "physical-product-2",
                        "skuGroupId": "physical-product",
                        "name": "Red shirt",
                        "url": "https://digitalriver.com/red-shirt",
                        "countryOfOrigin": "US",
                        "image": "https://mdbootstrap.com/img/Photos/Horizontal/E-commerce/Vertical/12.jpg",
                        "weight": 20.5,
                        "weightUnit": "oz",
                        "partNumber": "Part123"
                    },
                    ...
                    "shipFrom": {
                        "address": {
                            "line1": "1234 5th Ave",
                            "city": "New York",
                            "postalCode": "10005",
                            "state": "NY",
                            "country": "US"
                        }
                    },
                    ...
                }
            ],
            "shippingChoice": {
                "amount": 10.98,
                "description": "Expedited Shipping",
                "serviceLevel": "Expedited",
                "taxAmount": 0.0
            },
            ...
        }
    },
    ...
}

Displaying errors

If your service checks this data and determines that it's invalid, perhaps because line1 or line2 indicate that the customer is trying to ship the goods to a PO Box, and you don't support that or additionalAddressInfo.neighborhood isn't serviced by your carriers, then it can return an error.

We'll then display that error's message in the checkout experience.

Prebuilt Checkout

  • To get the message displayed, your server needs to respond with a status code of 400 or 409 and the error's type must be bad_request or conflict.

  • Digital River blocks customers from advancing to the shipping choice selection stage until they correct the issue.

Stock errors

The following lists the stock and preformatted errors that are available. For illustration purposes, we also show how each is rendered:

{
    "type": "bad_request",
    "errors": [
        {
            "code": "shipping_address_invalid",
            "parameter": "string",
            "message": "The shipping address provided is not valid."
        }
    ]
}
{
    "type": "bad_request",
    "errors": [
        {
            "code": "shipping_address_POBox_invalid",
            "parameter": "string",
            "message": "Shipping to a PO Box is not allowed."
        }
    ]
}
{
    "type": "bad_request",
    "errors": [
        {
            "code": "shipping_address_location_invalid",
            "parameter": "string",
            "message": "Shipping is not supported for the provided location."
        }
    ]
}
{
    "type": "bad_request",
    "errors": [
        {
            "code": "shipping_address_subdivision_invalid",
            "parameter": "string",
            "message": "Shipping is not supported for the provided subdivision."
        }
    ]
}

Components

  • The error returned by your service must have a message, but doesn't need a code.

  • The value you assign to message is customizable.

400 Bad Request
{
    "errors": [
        {
            "message": "An error message that you define"
        }
    ]
}

For details on how to do this, refer to on the page.

In , you can also use its to .

If you (1) select either a solution, (2) and (3) engage an external logistics service, you can use this section to understand better:

Once customers input a shipping address and Digital River determines that an external logistics provider is facilitating the transaction, we send a request to .

It does, however, contain the currency, shipTo, items[], and unique identifier (sessionId).

For each shipments[] in your response, we iterate through its itemsIds[], looking up that resource in our system, and then using the shipments[].shipFrom to set the appropriate items[].shipFrom value(s) in the .

In , Digital River renders so that its meaning is clearer to customers.

Each time customers make a selection, we use its data to update the shippingChoice and, if that selection contains a shipFrom , we also use it to set that resource's .

After Digital River converts the to an and sends you the with a of , you can pass its data to your fulfillment service, which can then read the line-item level and/or order-level ship from values and route ship requests to the appropriate warehouses.

The body of the Digital River sends to your server always has (1) shipTo, which contains the customer's designated address and, depending on their selected country, might also have additionalAddressInfo as well as (2) the details of each items[] the customer is purchasing.

What you need to do to get this message displayed depends on whether you're using or .

When implementing this feature in , here are some things to keep in mind:

Your server must return one of our .

Don't modify the code. If you do, then its message won't display in the checkout experience. Instead, users will be told that an unknown error occurred.

Altering your error's message does not affect what's shown to users. If its code matches one of our supported values, then that message is displayed, unmodified, in the checkout experience.

The error's message isn't translated into the . Rather, it's always rendered in English.

If you're implementing this feature in :

Any in the 4xx or 5xx range is accepted, but we recommend that you send back a 400 Bad Request.

Digital River displays your error's message in the . Before doing that, we don't translate it into the or perform any other operations.

In addition, if your response contains an error, that component's function will return false, which, if your application is set up correctly, should block customers from proceeding to the .

For details, refer to .

Prebuilt Checkout
Components
valid HTTP status code
The shipping quotes request we send to your endpoint
How to process and respond to our request
How Digital River processes your response
How the ship request can be defined
Prebuilt Checkout
Components
stock errors
stock error's
stock error's
low-code checkouts
SKU
items[].productDetails
dunnage
Item Classification
SKU Group
Creating the checkout-session
Restricting available ship to countries
How to use the endpoint with an external logistics provider
How to display error messages
Prebuilt Checkout
configuration object
low-code checkout
Prebuilt Checkout
address component
shipping choice selection stage
type
save a shipping endpoint in the Digital River Dashboard
shipping endpoint in the Digital River Dashboard
restrict shipping and billing countries
Controlling the checkout flow
order.accepted
done()
Shipping country
Checkout-sessions basics
your shipping endpoint
checkout-session’s
checkout-session
checkout-session’s
shipFrom
checkout-session
order
event
request
checkout-session's
language
checkout-session's
language
shippingTerms
create checkout-session request
cross-border shipments
physical product