curl --request POST \
--url https://api.exowpee.com/v1/order/orders/{order}/deliveries \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/order/orders/{order}/deliveries"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/order/orders/{order}/deliveries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/order/orders/{order}/deliveries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/order/orders/{order}/deliveries"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/order/orders/{order}/deliveries")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/order/orders/{order}/deliveries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"order_id": "<string>",
"customer_id": "<string>",
"customer_address_id": "<string>",
"address_snapshot": "<string>",
"status": "<string>",
"zone_id": "<string>",
"fee": 123,
"collect_on_delivery": true,
"amount_to_collect": 123,
"collected_amount": 123,
"driver_label": "<string>",
"trip_id": "<string>",
"trip_stop_id": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"outcome_reason": "<string>",
"received_by": "<string>",
"prepared_by_user_id": "<string>",
"prepared_at": "2023-11-07T05:31:56Z",
"delivered_by_user_id": "<string>",
"delivered_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"id": "<string>",
"order_delivery_id": "<string>",
"order_item_id": "<string>",
"quantity": 123,
"delivered_quantity": 123,
"undelivered_quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"order_item": {
"id": "<string>",
"stockable_id": "<string>",
"quantity": 123
}
}
]
}{
"message": "<string>",
"errors": {}
}Plan a delivery
Creates a draft delivery for items of a completed order, with address, fee or zone, driver, optional trip stop and optional cash collection on delivery.
curl --request POST \
--url https://api.exowpee.com/v1/order/orders/{order}/deliveries \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/order/orders/{order}/deliveries"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/order/orders/{order}/deliveries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/order/orders/{order}/deliveries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/order/orders/{order}/deliveries"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/order/orders/{order}/deliveries")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/order/orders/{order}/deliveries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"order_id": "<string>",
"customer_id": "<string>",
"customer_address_id": "<string>",
"address_snapshot": "<string>",
"status": "<string>",
"zone_id": "<string>",
"fee": 123,
"collect_on_delivery": true,
"amount_to_collect": 123,
"collected_amount": 123,
"driver_label": "<string>",
"trip_id": "<string>",
"trip_stop_id": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"outcome_reason": "<string>",
"received_by": "<string>",
"prepared_by_user_id": "<string>",
"prepared_at": "2023-11-07T05:31:56Z",
"delivered_by_user_id": "<string>",
"delivered_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"id": "<string>",
"order_delivery_id": "<string>",
"order_item_id": "<string>",
"quantity": 123,
"delivered_quantity": 123,
"undelivered_quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"order_item": {
"id": "<string>",
"stockable_id": "<string>",
"quantity": 123
}
}
]
}{
"message": "<string>",
"errors": {}
}order_deliveries.create
Conditions
- The order must be completed.
- items is required with at least one line; each order_item_id must exist on the order and appear once.
- For each item, quantity plus the quantities already planned in other deliveries of the order (failed deliveries excluded; a partially delivered one counts what was delivered) cannot exceed the quantity ordered.
- An address is required: customer_address_id of the order’s customer, or delivery_address, or the customer’s stored address. address_snapshot is not accepted.
- zone_id and fee cannot be sent together; the zone must be active. fee_minor is not accepted.
- A trip needs both trip_id and trip_stop_id; the trip must be active and the stop must point to the order’s customer or to the customer address chosen with customer_address_id.
- amount_to_collect is accepted only when collect_on_delivery is true.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the order.
Response
OrderDeliveryResource
Identifier of the delivery (27-character KSUID string).
Identifier of the order delivered.
Identifier of the order's customer, copied at creation. Null for an order without customer.
Identifier of the customer address chosen for the delivery. Null when a free-text address or the customer's stored address was used.
Delivery address as text, frozen at creation or at the last address change; later edits of the customer address do not change it. Set by the server.
draft (being prepared), ready (prepared, to ship), delivered, partially_delivered (reason required) or failed. Only draft can be edited; ready can go back to draft; delivered, partially_delivered and failed are final.
Identifier of the delivery zone whose fee was applied. Null when a free fee was given.
Delivery fee in major units of the company currency, copied from the zone at creation or the amount sent. 0 when none.
True when the driver collects money from the customer at delivery.
Amount the driver must collect, in major units. Null when not set or when collect_on_delivery is false.
Amount actually collected, in major units, recorded when the delivery is delivered or failed. Null until then.
Free-text name of the driver. Defaults to the trip's default driver label when a trip stop is given.
Identifier of the trip the delivery is attached to. Null when not on a trip.
Identifier of the stop of the trip for this delivery. Null when not on a trip.
Planned delivery date and time, ISO 8601. Null when not planned.
Reason given when the delivery is partial or failed. Null otherwise.
Name of the person who received the goods, as entered when recording the delivery. Null until then.
Identifier of the member who marked the delivery ready. Cleared when returned to draft.
Time the delivery was marked ready, ISO 8601. Cleared when returned to draft.
Identifier of the member who recorded the delivery outcome (delivered, partially delivered or failed).
Time the outcome was recorded, ISO 8601. Set for delivered, partially delivered and failed deliveries.
Creation time, ISO 8601.
Last update time, ISO 8601.
Order items carried by the delivery, with planned quantity, delivered quantity and undelivered quantity.
Show child attributes
Show child attributes