# Creating a delivery

Create a delivery request that sends an order to your service.

***

## Create delivery <a href="#h_f152b1af50" id="h_f152b1af50"></a>

When an order is completed, our app will process it. As a part of our order processing, we send the order to you. The processing is usually instantaneous, though if the webhook fails we will send the order in up to 10 minutes from order creation. To format the Create delivery request:

1. Go to the App Setup page.

   [![](https://downloads.intercomcdn.com/i/o/688861450/4d912114e109b1a55d2f8d27/image.png?expires=1725953400\&signature=ba505f2b3ce93c68917e848871e8596ed2ca722fd4a393c0b9423c01103abcd9\&req=cigvHs9%2FmYRfFb4f3HP0gGMVG4p6BnLCHeTFO%2F3riTGfIXCcSeTy8IWUX%2BiW%0AmII%3D%0A)](https://downloads.intercomcdn.com/i/o/688861450/4d912114e109b1a55d2f8d27/image.png?expires=1725953400\&signature=ba505f2b3ce93c68917e848871e8596ed2ca722fd4a393c0b9423c01103abcd9\&req=cigvHs9%2FmYRfFb4f3HP0gGMVG4p6BnLCHeTFO%2F3riTGfIXCcSeTy8IWUX%2BiW%0AmII%3D%0A)
2. Click Create delivery.

   [![](https://downloads.intercomcdn.com/i/o/688868426/88e808243966946c159e2473/image.png?expires=1725953400\&signature=bde98eee6a5d7e17e2e747cabe599377f983d1bbd808cceb17ca59b4da757531\&req=cigvHs92mYNZFb4f3HP0gOi7j9oN%2FpXXSBkRoSU5ndbeUMDm03E9oBQTnjtA%0AwzQ%3D%0A)](https://downloads.intercomcdn.com/i/o/688868426/88e808243966946c159e2473/image.png?expires=1725953400\&signature=bde98eee6a5d7e17e2e747cabe599377f983d1bbd808cceb17ca59b4da757531\&req=cigvHs92mYNZFb4f3HP0gOi7j9oN%2FpXXSBkRoSU5ndbeUMDm03E9oBQTnjtA%0AwzQ%3D%0A)

***

## Format the create delivery API endpoint <a href="#h_682337e0be" id="h_682337e0be"></a>

Create delivery request is a POST to an endpoint of your choice. We will use your Staging/Production endpoint as the base, so you only need to add the missing path to your Create delivery endpoint.

[![](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543639/7e1d667c76e6ab495fdfc010/C_0ohWEkGBtcGJWmKKJCBwrYleO96HaFCw.png-1620050168?expires=1725953400\&signature=a729a0bdb2793d92ff0ab876b9826b89a2c500783d3303665486f0cef56eec52\&req=cSIiE819m4JWFb4f3HP0gFZSYaG2XK35eogZJ%2FZQsLQLxv4QiE3B%2BhAfHT4e%0AWAIw9g%2Bl2y5NYxkoSg%3D%3D%0A)](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543639/7e1d667c76e6ab495fdfc010/C_0ohWEkGBtcGJWmKKJCBwrYleO96HaFCw.png-1620050168?expires=1725953400\&signature=a729a0bdb2793d92ff0ab876b9826b89a2c500783d3303665486f0cef56eec52\&req=cSIiE819m4JWFb4f3HP0gFZSYaG2XK35eogZJ%2FZQsLQLxv4QiE3B%2BhAfHT4e%0AWAIw9g%2Bl2y5NYxkoSg%3D%3D%0A)

If your Create delivery endpoint is completely different from the general endpoint, ensure you include https\:// in the URL.

[![](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543640/69b9ebd6c43bdb61b0c6b571/KU4wehk5JTV7bnXW083nC2sm-1gqhEhCBg.png-1620050262?expires=1725953400\&signature=a66d3c62185ee6f9360f38de8d23fb5b2a3ef3540268f72f98730898cab06c66\&req=cSIiE819m4VfFb4f3HP0gPDWH9tMdge9cVJzW99IcUoUcX0hdmtxnh5pl9g%2B%0A2YRq6uX6dsEO%2BYkzKQ%3D%3D%0A)](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543640/69b9ebd6c43bdb61b0c6b571/KU4wehk5JTV7bnXW083nC2sm-1gqhEhCBg.png-1620050262?expires=1725953400\&signature=a66d3c62185ee6f9360f38de8d23fb5b2a3ef3540268f72f98730898cab06c66\&req=cSIiE819m4VfFb4f3HP0gPDWH9tMdge9cVJzW99IcUoUcX0hdmtxnh5pl9g%2B%0A2YRq6uX6dsEO%2BYkzKQ%3D%3D%0A)

***

## Format the create delivery request <a href="#h_fd7bd96cad" id="h_fd7bd96cad"></a>

The format of the request body needs to be valid JSON. We support liquid variables that are on our create delivery list, and you can use any [liquid filter](https://shopify.dev/docs/themes/liquid/reference/filters). Here’s an example request that will be prefilled automatically for you:

[![](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543642/3763821b46d86c3496fdfa64/ioRF3QFiy8POxeSyPZ6YYCiFbwcdPfcvIw.png-1620051317?expires=1725953400\&signature=ccdb1abe83fac1b1f6338ab4ac0ea633da52dc45c1ee20fade55af9269e00315\&req=cSIiE819m4VdFb4f3HP0gLsYZ5NiYbUYleJ9Vn1%2FY5Knnv6OB3Ls6Prvptmr%0AZgNsbgCCZsQ0JmNsRA%3D%3D%0A)](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543642/3763821b46d86c3496fdfa64/ioRF3QFiy8POxeSyPZ6YYCiFbwcdPfcvIw.png-1620051317?expires=1725953400\&signature=ccdb1abe83fac1b1f6338ab4ac0ea633da52dc45c1ee20fade55af9269e00315\&req=cSIiE819m4VdFb4f3HP0gLsYZ5NiYbUYleJ9Vn1%2FY5Knnv6OB3Ls6Prvptmr%0AZgNsbgCCZsQ0JmNsRA%3D%3D%0A)

### Line item schema <a href="#h_194485606d" id="h_194485606d"></a>

If you need line items in your request, create the JSON for one line item in the Line item schema section. You can then pass the array of line items in the request body by using the ##{{ line\_items }} liquid variable.

***

## Create a delivery response <a href="#h_206ba464b5" id="h_206ba464b5"></a>

### Delivery ID <a href="#h_ce9c4e5970" id="h_ce9c4e5970"></a>

Your Create delivery response should have a "key" : "value" pair containing a unique identifier for a delivery order. Please enter the key from that key-value pair in the Delivery ID field. We will use it when checking order status updates or cancelling an order, and you can access it through the ##{{ courier.delivery.id }} variable.

[![](https://downloads.intercomcdn.com/i/o/688871813/12cd8d42aeb341a75117f483/image.png?expires=1725953400\&signature=e1bae738f0fafa2c21e12a169c5030808a2861888cf37cb5ec4a1a4ad8d7d422\&req=cigvHs5%2FlYBcFb4f3HP0gNQasOij%2BIXFMN05Oz3xBzKHGHnRv4%2BMFhEO5hzQ%0AoNItfR17tSk3ao28qg%3D%3D%0A)](https://downloads.intercomcdn.com/i/o/688871813/12cd8d42aeb341a75117f483/image.png?expires=1725953400\&signature=e1bae738f0fafa2c21e12a169c5030808a2861888cf37cb5ec4a1a4ad8d7d422\&req=cigvHs5%2FlYBcFb4f3HP0gNQasOij%2BIXFMN05Oz3xBzKHGHnRv4%2BMFhEO5hzQ%0AoNItfR17tSk3ao28qg%3D%3D%0A)

### Tracking details <a href="#h_5797d233e9" id="h_5797d233e9"></a>

In the Tracking number field, please enter the key from the response that contains your tracking number. In the Tracking URL field, please enter the key that contains your tracking URL. We will attach the tracking number and the URL when we process the order, if the merchant has enabled tracking details.

[![](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543646/76cc79443ee49de4ab11aacd/im0oUu2Ly7y14OO3m_hF-5D0QTGdq2hUSw.png-1620053637?expires=1725953400\&signature=96f91239f4c984ecb422270071b720ac3c86598e42f8c32b7f924377c3e55a70\&req=cSIiE819m4VZFb4f3HP0gKsSG712JMPjBAzOqg8aV2x61x8uPu7MrRZS3HJn%0A6sdf%2BCj7yFxDQp47IQ%3D%3D%0A)](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543646/76cc79443ee49de4ab11aacd/im0oUu2Ly7y14OO3m_hF-5D0QTGdq2hUSw.png-1620053637?expires=1725953400\&signature=96f91239f4c984ecb422270071b720ac3c86598e42f8c32b7f924377c3e55a70\&req=cSIiE819m4VZFb4f3HP0gKsSG712JMPjBAzOqg8aV2x61x8uPu7MrRZS3HJn%0A6sdf%2BCj7yFxDQp47IQ%3D%3D%0A)

If you don’t want to offer tracking details, leave both fields blank.

***

## Merchant perspective <a href="#h_a01d24500b" id="h_a01d24500b"></a>

When merchants connect to your service, they can choose:

* Which locations in Zapiet - Pickup + Delivery will use your service
* Whether they want to use tracking details

### Selecting a location <a href="#h_b79aa7f286" id="h_b79aa7f286"></a>

Merchants can have only one LMD provider per Zapiet - Pickup + Delivery location, and they can choose which locations each provider should serve.

[![](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543652/40c60801d89f8ca85729f666/MebWPYIL2MRneIxkdF6b7mmkkt-O_WfieQ.png-1620054098?expires=1725953400\&signature=c625495ac6e48d41963e0ed32a340816051f2368ffe4239a691db1b88483d8bf\&req=cSIiE819m4RdFb4f3HP0gPK4lpdVmABySIKfKE6JtDMum1nMaiT1YaVuVRgq%0AlWNRIfgCoajF7d%2FIVA%3D%3D%0A)](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543652/40c60801d89f8ca85729f666/MebWPYIL2MRneIxkdF6b7mmkkt-O_WfieQ.png-1620054098?expires=1725953400\&signature=c625495ac6e48d41963e0ed32a340816051f2368ffe4239a691db1b88483d8bf\&req=cSIiE819m4RdFb4f3HP0gPK4lpdVmABySIKfKE6JtDMum1nMaiT1YaVuVRgq%0AlWNRIfgCoajF7d%2FIVA%3D%3D%0A)

If the merchant is already using an LMD provider for a location, the location will be greyed out.

### Selecting tracking details <a href="#h_e3c99c2eac" id="h_e3c99c2eac"></a>

If you left tracking details in your Create delivery request blank, this section will not show. Merchant can select whether they want to

* Add tracking details
* Send tracking details to the customer

[![](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543653/907aebe5d74760422e6a58dc/hWxPHfpoIYbhTNqRxU2jqmY-03kHcKch-Q.png-1620054310?expires=1725953400\&signature=b88f3e9e8568d8a6632547c11f67c1e5715c736280fcd5a63cd5c434e3677161\&req=cSIiE819m4RcFb4f3HP0gFS2ftj4jobMG275S8MMEnQZbKXF9%2Fa5bKl5K16x%0Av%2BcLzzeepOvMiXoliw%3D%3D%0A)](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543653/907aebe5d74760422e6a58dc/hWxPHfpoIYbhTNqRxU2jqmY-03kHcKch-Q.png-1620054310?expires=1725953400\&signature=b88f3e9e8568d8a6632547c11f67c1e5715c736280fcd5a63cd5c434e3677161\&req=cSIiE819m4RcFb4f3HP0gFS2ftj4jobMG275S8MMEnQZbKXF9%2Fa5bKl5K16x%0Av%2BcLzzeepOvMiXoliw%3D%3D%0A)

If Add \[LMD provider name] tracking details to Shopify order is enabled, we will automatically fulfil the order when processing it. This allows us to add the tracking number to the order and then poll your service for the order status. If Send tracking details to customer is enabled, we will send a Shipping confirmation email to the customer when fulfilling the order. That way the customer can get the tracking number and the tracking URL.

***

## Testing create delivery <a href="#h_36e1fdf367" id="h_36e1fdf367"></a>

If you have only one key in the authentication header, you can test the Create delivery request from the comfort of Zapiet Partners.

1. Go to App setup.
2. Click Create delivery.
3. Click Test request.

   [![](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543655/eca988e79b51a2430b231509/64kANVqhuMegvm-4Q8t8dQCkUvlbaAHtKw.png-1620054921?expires=1725953400\&signature=5b0c1f6fb272b78d216ea68f5c1e10fde4df1ad1cd3954cf361dc3a4c8ca0ad1\&req=cSIiE819m4RaFb4f3HP0gAR0%2FAYJC35JCRPLHA4CCavXmGZaNFW8Kmoksf9h%0Aj9w%3D%0A)](https://zapiet-ltd-2e9268abd76f.intercom-attachments-7.com/i/o/525543655/eca988e79b51a2430b231509/64kANVqhuMegvm-4Q8t8dQCkUvlbaAHtKw.png-1620054921?expires=1725953400\&signature=5b0c1f6fb272b78d216ea68f5c1e10fde4df1ad1cd3954cf361dc3a4c8ca0ad1\&req=cSIiE819m4RaFb4f3HP0gAR0%2FAYJC35JCRPLHA4CCavXmGZaNFW8Kmoksf9h%0Aj9w%3D%0A)
4. Enter your API key in the API key field.

   [![](https://downloads.intercomcdn.com/i/o/688868988/de71b2e6a7b79b5a5435a65e/image.png?expires=1725953400\&signature=a847f62d480c4c5ab76f8dcb36d7a4d3aa8c240e53d41881a4511e5581f91544\&req=cigvHs92lIlXFb4f3HP0gNQ%2BzevOWBngwhgzLvD82efxKF8lC9ti%2FTB5NkBu%0AkG0%3D%0A)](https://downloads.intercomcdn.com/i/o/688868988/de71b2e6a7b79b5a5435a65e/image.png?expires=1725953400\&signature=a847f62d480c4c5ab76f8dcb36d7a4d3aa8c240e53d41881a4511e5581f91544\&req=cigvHs92lIlXFb4f3HP0gNQ%2BzevOWBngwhgzLvD82efxKF8lC9ti%2FTB5NkBu%0AkG0%3D%0A)
5. Click Preview request.

You should now see the preview request you formatted earlier, with sample data instead of liquid variables. Click Send request and you’ll see the response from your service.

***

Let’s see how the delivery status works next.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zapiet.com/last-mile-api/creating-a-delivery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
