Populate shipping methods in Checkout

Learn how to populate shipping methods in Checkout.

Shipping methods can be populated with the default methods set in the Digital River Dashboard. This can also occur by listening to and responding to a shipping callout once a user adds a shipping address within the checkout experience.

Set default methods

You can set default shipping methods in the Digital River Dashboard by creating them in the Logistics section of the Prebuilt Checkout settings page.

  1. On the Digital River Dashboard, under Settings, click Prebuilt Checkout. The Prebuilt Checkout page appears.

  2. Find the Logistics section of the page.

  3. In the Default shipping methods subsection of Logistics, add your default shipping methods.

  4. Click Save.

Use the shipping callout function

Use the shipping callout function by completing the following tasks:

  1. Configure the shipping callout URL.

  2. Configure the ability to listen to and respond to a shipping callout.

Configure the shipping callout URL

To configure the shipping callout URL:

  1. On the Digital River Dashboard, under Settings, click Prebuilt Checkout. The Prebuilt Checkout page appears.

  2. Find the Shipping webhook URL subsection of the Webhooks section of the page.

  3. Click Save.

Configure the ability to listen to and respond to a shipping callout

When the customer enters an address, your endpoint receives a POST request with the checkout details and the entered shipping address. The sessionId is the Digital River Checkout Session ID. The sessionUpstreamId is the BigCommerce Cart Identifier.

The following shows an example:

{
    "sessionId": "e77a19a2-0e5a-4b41-b340-4451f1b3023e",
    "sessionUpstreamId": "b304d277-3398-4507-8834-6026b642106c",
    "currency": "USD",
    "shipTo": {
        "address": {
            "line1": "10380 Bren Road W",
            "city": "Minnetonka",
            "postalCode": "55446",
            "state": "MN",
            "country": "US"
        },
        "name": "John Doe",
        "phone": "6519881234",
        "email": "test@test.com"
    },
    "items": [
        {
            "sku": {
                "id": "sku_e102c701-e1fc-4de6-94c7-91f6f58871d4",
                "name": "Blue Jeans",
                "eccn": "8A992",
                "taxCode": "55101504.100",
                "image": "https://cdn11.bigcommerce.com/s-kxzhuipxqw/products/112/images/378/jeans_blue_classic__66844.1668100978.220.290.png?c=1",
                "url": "https://christeststore-d1.mybigcommerce.com/blue-jeans/",
                "physical": true,
                "skuGroupId": "physical-product"
            },
            "amount": 34.95,
            "quantity": 1,
            "id": "60cd34b0-1413-4e52-b8cf-0391f57ae450"
        }
    ]
}

Your system should respond with the shipment details and the shipping methods to be displayed within the experience.

The following shows an example:

{
  "shipments": [
    {
      "itemIds": [
        "60cd34b0-1413-4e52-b8cf-0391f57ae450"
      ],
      "shipFrom": {
        "address": {
          "city": "Minnetonka",
          "line1": "10380 Bren Rd W",
          "line2": "string",
          "state": "MN",
          "country": "US",
          "postalCode": "55446"
        }
      }
    }
  ],
  "shippingMethods": [
    {
      "amount": 2.99,
      "description": "Standard Shipping",
      "serviceLevel": "Standard"
    },
    {
      "amount": 10.99,
      "description": "Expedited Shipping",
      "serviceLevel": "Expedited"
    }
  ]
}

Suppose you are using the Global Logistics capability. In that case, the request will include any retrieved methods from that service, assuming you have set up and configured the appropriate trading patterns and enabled a logistics partner.

The following shows an example:

{
  "items": [
    {
      "id": "582bd604-842d-40e1-ae60-f1ccfb2225db",
      "sku": {
        "id": "sku_e628c0d0-33b7-4dea-aa40-9eadc43e1583",
        "url": "https://digitalriver.com/physical-product",
        "eccn": "8A992",
        "name": "Physical Product",
        "image",: "https://mdbootstrap.com/img/Photos/Horizontal/E-commerce/Vertical/12.jpg",
        "weight": 20.5,
        "taxCode": "55101504.100",
        "physical": true,
        "skuGroupId": "physical-product",
        "weightUnit": "oz"
      },
      "amount": 11.95,
      "quantity": 1
    }
  ],
  "shipTo": {
    "name": "John Doe",
    "email": "test@test.com",
    "phone": "6519995326",
    "address": {
      "city": "Hesse",
      "line1": "Zur Ederau 1",
      "country": "DE",
      "postalCode": "34587"
    }
  },
  "currency": "EUR",
  "sessionId": "74e32b2f-85cb-4e69-ac0a-c240af6b38ba",
  "shippingMethods": [
    {
      "amount": 15.06,
      "shipFrom": {
        "address": {
          "city": "Los Angeles",
          "state": "California",
          "country": "US",
          "postalCode": "90245"
        }
      },
      "description": "Economy",
      "serviceLevel": "XLTUS-DEFAULT",
      "shippingTerms": "DDP"
    },
    {
      "amount": 15.06,
      "shipFrom": {
        "address": {
          "city": "Los Angeles",
          "state": "California",
          "country": "US",
          "postalCode": "90245"
        }
      },
      "description": "Economy",
      "serviceLevel": "XLTUS-DEFAULT",
      "shippingTerms": "DAP"
    },
    {
      "amount": 17.17,
      "shipFrom": {
        "address": {
          "city": "Los Angeles",
          "state": "California",
          "country": "US",
          "postalCode": "90245"
        }
      },
      "description": "Express",
      "serviceLevel": "XLTUS-DEFAULT",
      "shippingTerms": "DDP"
    },
    {
      "amount": 17.17,
      "shipFrom": {
        "address": {
          "city": "Los Angeles",
          "state": "California",
          "country": "US",
          "postalCode": "90245"
        }
      },
      "description": "Express",
      "serviceLevel": "XLTUS-DEFAULT",
      "shippingTerms": "DAP"
    },
    {
      "amount": 18.1,
      "shipFrom": {
        "address": {
          "city": "London",
          "state": "London",
          "country": "UK",
          "postalCode": "11545"
        }
      },
      "description": "Economy",
      "serviceLevel": "XLTUK-DEFAULT",
      "shippingTerms": "DDP"
    },
    {
      "amount": 18.1,
      "shipFrom": {
        "address": {
          "city": "London",
          "state": "London",
          "country": "UK",
          "postalCode": "11545"
        }
      },
      "description": "Economy",
      "serviceLevel": "XLTUK-DEFAULT",
      "shippingTerms": "DAP"
    },
    {
      "amount": 24.84,
      "shipFrom": {
        "address": {
          "city": "London",
          "state": "London",
          "country": "UK",
          "postalCode": "11545"
        }
      },
      "description": "Express",
      "serviceLevel": "XLTUK-DEFAULT",
      "shippingTerms": "DDP"
    },
    {
      "amount": 24.84,
      "shipFrom": {
        "address": {
          "city": "London",
          "state": "London",
          "country": "UK",
          "postalCode": "11545"
        }
      },
      "description": "Express",
      "serviceLevel": "XLTUK-DEFAULT",
      "shippingTerms": "DAP"
    },
    {
      "amount": 15.58,
      "shipFrom": {
        "address": {
          "city": "Tokyo",
          "state": "Tokyo",
          "country": "JP",
          "postalCode": "010010"
        }
      },
      "description": "Economy",
      "serviceLevel": "XLTJP-DEFAULT",
      "shippingTerms": "DDP"
    },
    {
      "amount": 15.58,
      "shipFrom": {
        "address": {
          "city": "Tokyo",
          "state": "Tokyo",
          "country": "JP",
          "postalCode": "010010"
        }
      },
      "description": "Economy",
      "serviceLevel": "XLTJP-DEFAULT",
      "shippingTerms": "DAP"
    },
    {
      "amount": 28.96,
      "shipFrom": {
        "address": {
          "city": "Tokyo",
          "state": "Tokyo",
          "country": "JP",
          "postalCode": "010010"
        }
      },
      "description": "Express",
      "serviceLevel": "XLTJP-DEFAULT",
      "shippingTerms": "DDP"
    },
    {
      "amount": 28.96,
      "shipFrom": {
        "address": {
          "city": "Tokyo",
          "state": "Tokyo",
          "country": "JP",
          "postalCode": "010010"
        }
      },
      "description": "Express",
      "serviceLevel": "XLTJP-DEFAULT",
      "shippingTerms": "DAP"
    }
  ]
}

After responding to the shipping callout, the methods will be reflected in the user interface.

Last updated