Dynamic shipping
Overview
When a customer checks out using Roqqett Checkout, you can offer them dynamic shipping rates instead of fixed, hardcoded rates. This allows you to offer your customers the precise rates you've arranged and enables them to select the most appropriate shipping option for their order. When using the dynamic shipping rates, the total cart cost is re-calculated in real-time.
How does it work?
Roqqett's dynamic shipping works by retrieving the appropriate shipping rates from the service your business uses to manage and calculate shipping rates. Once a customer has selected their shipping address in Roqqett Checkout, Roqqett will send the contents of the basket and the shipping address to the service you use via API. Roqqett then expects your service to determine the rates and send them back to Roqqett, which then provides them to your customer for selection.
The checkout instance will make a POST
callback to the endpoint you've defined, which contains the current content of the basket along with the shipping address. Your endpoint must then return a list of shipping rates and options that are then presented to the customer on the checkout screen for selection.
info
The callback response timeout is 5 seconds, at which point the user interface will prompt the customer to retry loading the shipping options. If clicked, this will trigger a secondary callback attempt.
Example request
{
"rate": {
"destinationAddress": {
"addressLine1": "8th Floor",
"addressLine2": "100 Bishopsgate",
"city": "London",
"postcode": "EC2N 4AG",
"countryCode": "GB"
},
"basket": {
"subTotal": 0,
"items": [
{
"lineId": "1",
"quantity": 2,
"productId": "2389472398",
"productName": "A £20 note",
"total": 4000,
"unitPrice": 2000,
"taxRate": 0,
"taxTotal": 0
}
]
},
"merchantCartId": "QY9CvCU5Ru45Btv7iF",
"cartId": "3a4b419a-c617-11ec-9d64-0242ac120002"
}
}
Example response
[
{
"currency": "GBP",
"totalPrice": 2,
"description": "3 business days",
"preSelected": true,
"serviceCode": "SD5",
"serviceName": "Standard delivery",
"maxDeliveryDate": "2022-02-13T17:12:34+0100",
"minDeliveryDate": "2022-02-13T09:12:34+0100"
},
{
"currency": "GBP",
"totalPrice": 4,
"description": "2 business days",
"serviceCode": "ED2",
"serviceName": "Express delivery",
"maxDeliveryDate": "2022-02-12T17:12:34+0100",
"minDeliveryDate": "2022-02-12T09:12:34+0100"
},
{
"currency": "GBP",
"totalPrice": 8,
"description": "24 hours",
"serviceCode": "NDD1",
"serviceName": "Next day delivery",
"maxDeliveryDate": "2022-02-11T17:12:34+0100",
"minDeliveryDate": "2022-02-11T09:12:34+0100"
},
{
"currency": "GBP",
"totalPrice": 0,
"description": "Free",
"serviceCode": "Free5D",
"serviceName": "Free delivery",
"maxDeliveryDate": "2022-02-15T17:12:34+0100",
"minDeliveryDate": "2022-02-15T09:12:34+0100"
}
]
Default shipping rate
Roqqett's dynamic shipping also allows you to define a default shipping rate. To do this, set the preSelected
parameter to true
in the rate
object. This option will become pre-selected and the customer won't be shown the other options unless they choose to view them.
Setup instructions
info
Dynamic shipping is only compatible with Roqqett Checkout.
- In the Roqqett portal , go to the Checkouts area.
- Tick the box next to the checkout instance you'd like to update, then click Update Checkout .
- Tick the Dynamic shipping box. This is only clickable if Collect shipping address is pre-selected.
- Add your Dynamic shipping callback url .
- Click Save .