Create Delivery
This endpoint creates an order for a delivery.
Wix calls this endpoint when a customer requests a delivery on the merchant's Wix site.
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.
Authorization
This endpoint requires an authorization header - pass the access token from the OAuth installation flow.
https://www.wixapis.com/local-delivery/v2/create-delivery
Body Params
NAME
TYPE
DESCRIPTION
Account ID.
Info for creating a pickup delivery. Can also be specified for drop-off orders, so that the deliverer knows where to pick up the order before dropping it off.
Info for creating a drop-off delivery. Can also be specified for pickup orders, so that the deliverer knows where to drop off the order after picking it up.
The requested time at which the order should be picked up.
The requested time at which the order should be delivered.
Estimate ID, if needed.
Wix order details.
If true
, the delivery is a contactless delivery. This means that the order is placed outside the customer's door.
Response Object
NAME
TYPE
DESCRIPTION
The delivery ID supplied by the local delivery service provider.
When a delivery is ready to be picked up. This is the start time of the pickup window.
When a delivery must be picked up by. This is the end time of the pickup window.
When a delivery is ready to be dropped off. This is the start time of the drop-off window.
When a delivery must be dropped off by. This is the end time of the drop-off window.
Amount to charge for this delivery.
Status/Error Codes
The response will include an HTTP status code.
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/create-delivery \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": "2023-01-01T00:00:00Z",9 "pickupInfo": {10 "configurationId": "fc169827-2d06-4277-baeb-958694c5435f",11 "storeName": "My Restaurant (Basel Street)",12 "address": {13 "country": "US",14 "city": "New York City",15 "streetAddress": {16 "number": "11234",17 "name": "122 Border St. Bronx",18 "apt": ""19 },20 "geocode": {21 "latitude": 32.0811222,22 "longitude": 34.832912323 }24 },25 "phone": "+18005551111"26 },27 "dropOffInfo": {28 "address": {29 "city": "New York City",30 "streetAddress": {31 "number": "10456",32 "name": "944 Border St. Bronx",33 "apt": "1"34 },35 "country": "US",36 "postalCode": "123456",37 "geocode": {38 "latitude": 23,39 "longitude": 2140 },41 "subdivision": "NY"42 },43 "instructions": "Drop off counter is on the side of the building"44 },45 "accountId": "287e7e9c-b802-43b4-b9ef-b876d2831bfe",46 "estimateId": "0ebcd08d-231c-4823-8ace-56903fffa3cf",47 "order": {48 "id": "a3cac1a3-7626-4b5a-b5c5-c3be230096d6",49 "customer": {50 "firstName": "John",51 "lastName": "Doe",52 "phone": "+12345678",53 "email": "johndoe@mycompany.com"54 },55 "subtotal": {56 "value": "42",57 "currency": "USD",58 "formattedValue": "42.0$"59 },60 "lineItems": [61 {62 "quantity": 1,63 "catalogReference": {64 "catalogItemName": "Onion soup"65 }66 }67 ]68 }69 },70 "metadata": {71 "requestId": "1655811823.1928374758182939182",72 "instanceId": "010a82dc-facd-4945-afa9-bb83c2a2c66e"73 }74 },75 "aud": "a6e68bdf-b2a6-4f44-b08c-8a77b37149f5",76 "iss": "wix.com",77 "iat": 1655818582,78 "exp": 165941858279 }'
Response
json
1{2 "deliveryId": "384122d3-fad3-4227-afe9-f9f65225e5e1",3 "pickupWindowStartTime": "2023-06-21T12:50:02.943Z",4 "pickupWindowEndTime": "2023-06-21T12:50:02.943Z",5 "dropOffWindowStartTime": "2023-06-21T13:33:01.123Z",6 "dropOffWindowEndTime": "2023-06-21T13:35:05.183Z",7 "deliveryFee": {8 "value": "7",9 "currency": "USD"10 }11}