Configure shipping methods

Learn how to configure shipping methods.

The Digital River Drop-in Checkout feature uses a callback mechanism to retrieve available shipping methods once the shipping address is known. The callback re-fires if the shipping address is updated.

Understand the default implementation

The integration provides a default implementation that updates the shipping address on the cart and then queries the available commercetools shipping methods. If this does not meet your integration requirements, the callback URL can be customized to point to your own implementation.

The default implementation is activated by setting the value of the digital.river.shipping.callout.endpoint property to point to the integration. See Understand integration environment variables for more details.

Configuring shipping methods

Shipping methods need to be enhanced with a custom property defining the Digital River service level. As this is not currently possible via the Merchant Center you need to create shipping methods via the commercetools API with a payload similar to the following example:

{
"name": "Sample shipping",
"description": "",
"taxCategory": {
  "typeId": "tax-category",
  "key": "standard"
},
"custom": {
  "type": {
    "key": "drShippingMethodFields"
  },
  "fields": {
    "drServiceLevel": "Digital River service level"
  }
},
"zoneRates": [],
"isDefault": false,
"key": "sample"
}

After creating the preferred shipping method via the API, it can then be updated in the Merchant Center or you can do it again via the API.

Use custom implementation

You can use your own implementation of the callback simply by setting digital.river.shipping.callout.endpoint to point to it.

Your endpoint receives requests conforming to this definition and should return data conforming to the response definition.

Last updated