Search.../
  1. REST
Generate a test token to explore our APIs

Create Delivery

Developer Preview

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.

POST

https://www.wixapis.com/local-delivery/v2/create-delivery

Body Params

NAME
TYPE
DESCRIPTION
accountId
Required
string

Account ID.

pickupInfo
object

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.

dropOffInfo
object

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.

ONE OF:Required
pickupTime
string

The requested time at which the order should be picked up.

dropOffTime
string

The requested time at which the order should be delivered.

estimateId
string

Estimate ID, if needed.

order
object

Wix order details.

contactlessDelivery
boolean

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
deliveryId
string

The delivery ID supplied by the local delivery service provider.

pickupWindowStartTime
string

When a delivery is ready to be picked up. This is the start time of the pickup window.

pickupWindowEndTime
string

When a delivery must be picked up by. This is the end time of the pickup window.

dropOffWindowStartTime
string

When a delivery is ready to be dropped off. This is the start time of the drop-off window.

dropOffWindowEndTime
string

When a delivery must be dropped off by. This is the end time of the drop-off window.

deliveryFee
object

Amount to charge for this delivery.

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Create delivery with a pickup time - decoded JWT

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

Copy Code
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.8329123
23 }
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": 21
40 },
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": 1659418582
79 }'

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}
Create delivery with a dropoff time - decoded JWT