Calculate Shipping Rates

The Calculate Shipping Rates webhook provides a mechanism to implement custom logic on top of ShopGo's shipping rates processor. It's a store setting and can be configured under "Dashboard / Settings / Webhook".

Usage

The webhook is activated when a valid URL is enterted, and will deliver a payload everytime shipping rates are calculated.

The delivered payload contains available shipping rates, plus information about the current checkout process (currently only the source and destination addresses for order fulfillment). The webhook expects an updated list of shipping rates to be sent as a response body, and will use these at checkout. You may return the same list unchanged, perform some modifications or return a completely different list.

Objects

The following object definitions are relevant to this webhook:

ShippingRate

{
    "id": "rate-123",
    "price": <Money>,
    "duration": {
        "value": 1,  // integer
        "unit": "days"  // "days", "minutes" or "hours"
    },
    "name": <BinlingualString>,  // display name
    "description": BinlingualString,  // relevant instructions or extra details
    "provider": "dhl"  // machine-friendly name of shipping provider
},

Request Format

{
    "rates": [<ShippingRate>],
    "checkout": {
        "shipping": <Address>,
        "destination": <Address>
    }
}

Response Format

[<ShippingRate>]

Last updated

Was this helpful?