Get Delivery Estimate
This endpoint retrieves an estimate for a delivery from your app, including the delivery fee and when the local delivery service provider can dispatch the delivery.
Wix calls this endpoint when a customer enters their delivery address, and again when the order is accepted by the site owner.
You cannot try out this endpoint because it has to be implemented by an app and can have an arbitrary URL. So please ignore the Authorization and POST sections below as well as the Try It Out button.
Syntax
function GetDelivery Estimate(accountId: string, pickupAddress: _com_wixpress_localdelivery_upstream_wix_common_Address, dropOffAddress: _com_wixpress_localdelivery_upstream_wix_common_Address, dispatchTime: _com_wixpress_localdelivery_spi_v2_GetDeliveryEstimateRequest_DispatchTime, configurationId: string, order: _com_wixpress_localdelivery_spi_v2_EstimateOrder): GetDeliveryEstimate<_com_wixpress_localdelivery_spi_v2_GetDeliveryEstimateResponse>
Get Delivery Estimate Parameters
NAME
TYPE
DESCRIPTION
Account ID.
Delivery pickup address. Can also be specified for drop-off orders, so that the deliverer knows where to pick up the order before dropping it off.
Delivery drop-off address. Can also be specified for pickup orders, so that the deliverer knows where to drop off the order after picking it up.
Estimated pickup time.
Estimated drop-off time.
Unique identifier for the store, restaurant, or business where the order originated from.
Wix order details.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
The estimate, which includes the delivery fee and estimated pickup and drop-off times.
Was this helpful?
The data payload will include the following object as an encoded JWT. For the purposes of this example, we show the request and response objects decoded.
Request
curl
1curl -X POST https://provider.example.com/v2/get-delivery-estimate \2 -H 'user-agent: Wix' \3 -H 'accept-encoding: gzip, deflate' \4 -H 'content-type: text/plain; charset=utf-8' \5 -d '{6 "data": {7 "request": {8 "pickupTime": "1970-01-01T00:00:00Z",9 "configurationId": "8345ca38-207c-466c-a256-e4cd93064768",10 "accountId": "0c6f1e68-37bb-4869-aa02-27cd1f1b7d48",11 "dropOffAddress": {12 "city": "New York City",13 "streetAddress": {14 "number": "10456",15 "name": "944 Border St. Bronx",16 "apt": "1"17 },18 "country": "US",19 "postalCode": "123456",20 "geocode": {21 "latitude": 23,22 "longitude": 2123 },24 "subdivision": "NY"25 },26 "pickupAddress": {27 "country": "IL",28 "city": "Tel Aviv-Yafo",29 "streetAddress": {30 "number": "33",31 "name": "Basel Street",32 "apt": ""33 },34 "geocode": {35 "latitude": 32.0900999,36 "longitude": 34.779043137 }38 },39 "order": {40 "subtotal": {41 "value": "42",42 "currency": "USD",43 "formattedValue": "42.0$"44 }45 }46 },47 "metadata": {48 "requestId": "1655818237.1289317294874329875",49 "instanceId": "f14b64ae-1162-4d2f-bf5b-bdc564c0b6b3"50 }51 },52 "aud": "0f8551ba-0724-4c4a-b3b5-f62d54d8ba28",53 "iss": "wix.com",54 "iat": 1655819187,55 "exp": 165941918756 }'
Response
json
1{"estimate": {2 "deliveryId": "id",3 "deliveryFee": {4 "value": "42.00",5 "currency": "USD"6 },7 "pickupTime": "2024-04-02T22:00:00Z",8 "dropOffTime": "2024-04-02T22:42:00Z"9}}