Orders
Edit an order
Edit an order while it is still pending_fulfilment (recipient, parcel,
delivery method, reference, and/or line items). Passing items[] REPLACES the
existing line items. Once fulfilled the shipment is the source of truth and edits
are rejected (409). Requires a secret (sk_) key.
PATCH
/
v1
/
orders
/
{orderId}
Edit an order
curl --request PATCH \
--url https://api.tybritelabs.com/logistics/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"recipient": {
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"lat": 123,
"lng": 123
},
"item": {
"description": "<string>",
"weight_kg": 123,
"declared_value": 123
},
"items": [
{
"name": "<string>",
"sku": "<string>",
"quantity": 1,
"unit_price": 123,
"metadata": {}
}
]
}
'import requests
url = "https://api.tybritelabs.com/logistics/v1/orders/{orderId}"
payload = {
"reference": "<string>",
"recipient": {
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"lat": 123,
"lng": 123
},
"item": {
"description": "<string>",
"weight_kg": 123,
"declared_value": 123
},
"items": [
{
"name": "<string>",
"sku": "<string>",
"quantity": 1,
"unit_price": 123,
"metadata": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: '<string>',
recipient: {
name: '<string>',
phone: '<string>',
email: '<string>',
address: '<string>',
city: '<string>',
lat: 123,
lng: 123
},
item: {description: '<string>', weight_kg: 123, declared_value: 123},
items: [
{name: '<string>', sku: '<string>', quantity: 1, unit_price: 123, metadata: {}}
]
})
};
fetch('https://api.tybritelabs.com/logistics/v1/orders/{orderId}', 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.tybritelabs.com/logistics/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reference' => '<string>',
'recipient' => [
'name' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'address' => '<string>',
'city' => '<string>',
'lat' => 123,
'lng' => 123
],
'item' => [
'description' => '<string>',
'weight_kg' => 123,
'declared_value' => 123
],
'items' => [
[
'name' => '<string>',
'sku' => '<string>',
'quantity' => 1,
'unit_price' => 123,
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/logistics/v1/orders/{orderId}"
payload := strings.NewReader("{\n \"reference\": \"<string>\",\n \"recipient\": {\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"item\": {\n \"description\": \"<string>\",\n \"weight_kg\": 123,\n \"declared_value\": 123\n },\n \"items\": [\n {\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tybritelabs.com/logistics/v1/orders/{orderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"<string>\",\n \"recipient\": {\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"item\": {\n \"description\": \"<string>\",\n \"weight_kg\": 123,\n \"declared_value\": 123\n },\n \"items\": [\n {\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/logistics/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference\": \"<string>\",\n \"recipient\": {\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"item\": {\n \"description\": \"<string>\",\n \"weight_kg\": 123,\n \"declared_value\": 123\n },\n \"items\": [\n {\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"order": {
"id": "1621951b-3e21-4330-a784-ed5965203098",
"merchant_company_id": "7d94c9e8-0000-0000-0000-000000000000",
"end_customer_id": null,
"source": "manual",
"status": "pending_fulfilment",
"reference": "SPEC-EX-1787561524230-C",
"item_description": "Running shoes",
"declared_value": 5000,
"weight_kg": 2,
"recipient_name": "Grace Njeri",
"recipient_phone": 254712000333,
"recipient_email": null,
"recipient_address": "Ngong Road, Nairobi",
"recipient_city": "Nairobi",
"recipient_lat": null,
"recipient_lng": null,
"origin_city": "Nairobi",
"origin_lat": null,
"origin_lng": null,
"chosen_courier_id": null,
"pickup_point_id": null,
"shipment_id": null,
"metadata": "{}",
"created_at": "2026-08-24T08:52:11.594335+00:00",
"updated_at": "2026-08-24T08:52:12.436755+00:00",
"delivery_method": "last_mile",
"delivery_station_id": null,
"last_mile_fee": 0,
"fulfilment_type": "courier",
"environment": "production",
"items": [
{
"id": "49ba3d69-638e-49cf-a0ce-b067167c8034",
"sku": "SKU-1",
"name": "Running shoes",
"quantity": 1,
"unit_price": 5000,
"total_price": 5000,
"metadata": "{}"
}
]
}
}Authorizations
Body
application/json
⌘I
Edit an order
curl --request PATCH \
--url https://api.tybritelabs.com/logistics/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"recipient": {
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"lat": 123,
"lng": 123
},
"item": {
"description": "<string>",
"weight_kg": 123,
"declared_value": 123
},
"items": [
{
"name": "<string>",
"sku": "<string>",
"quantity": 1,
"unit_price": 123,
"metadata": {}
}
]
}
'import requests
url = "https://api.tybritelabs.com/logistics/v1/orders/{orderId}"
payload = {
"reference": "<string>",
"recipient": {
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"lat": 123,
"lng": 123
},
"item": {
"description": "<string>",
"weight_kg": 123,
"declared_value": 123
},
"items": [
{
"name": "<string>",
"sku": "<string>",
"quantity": 1,
"unit_price": 123,
"metadata": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: '<string>',
recipient: {
name: '<string>',
phone: '<string>',
email: '<string>',
address: '<string>',
city: '<string>',
lat: 123,
lng: 123
},
item: {description: '<string>', weight_kg: 123, declared_value: 123},
items: [
{name: '<string>', sku: '<string>', quantity: 1, unit_price: 123, metadata: {}}
]
})
};
fetch('https://api.tybritelabs.com/logistics/v1/orders/{orderId}', 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.tybritelabs.com/logistics/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reference' => '<string>',
'recipient' => [
'name' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'address' => '<string>',
'city' => '<string>',
'lat' => 123,
'lng' => 123
],
'item' => [
'description' => '<string>',
'weight_kg' => 123,
'declared_value' => 123
],
'items' => [
[
'name' => '<string>',
'sku' => '<string>',
'quantity' => 1,
'unit_price' => 123,
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/logistics/v1/orders/{orderId}"
payload := strings.NewReader("{\n \"reference\": \"<string>\",\n \"recipient\": {\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"item\": {\n \"description\": \"<string>\",\n \"weight_kg\": 123,\n \"declared_value\": 123\n },\n \"items\": [\n {\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tybritelabs.com/logistics/v1/orders/{orderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"<string>\",\n \"recipient\": {\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"item\": {\n \"description\": \"<string>\",\n \"weight_kg\": 123,\n \"declared_value\": 123\n },\n \"items\": [\n {\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/logistics/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference\": \"<string>\",\n \"recipient\": {\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"item\": {\n \"description\": \"<string>\",\n \"weight_kg\": 123,\n \"declared_value\": 123\n },\n \"items\": [\n {\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"order": {
"id": "1621951b-3e21-4330-a784-ed5965203098",
"merchant_company_id": "7d94c9e8-0000-0000-0000-000000000000",
"end_customer_id": null,
"source": "manual",
"status": "pending_fulfilment",
"reference": "SPEC-EX-1787561524230-C",
"item_description": "Running shoes",
"declared_value": 5000,
"weight_kg": 2,
"recipient_name": "Grace Njeri",
"recipient_phone": 254712000333,
"recipient_email": null,
"recipient_address": "Ngong Road, Nairobi",
"recipient_city": "Nairobi",
"recipient_lat": null,
"recipient_lng": null,
"origin_city": "Nairobi",
"origin_lat": null,
"origin_lng": null,
"chosen_courier_id": null,
"pickup_point_id": null,
"shipment_id": null,
"metadata": "{}",
"created_at": "2026-08-24T08:52:11.594335+00:00",
"updated_at": "2026-08-24T08:52:12.436755+00:00",
"delivery_method": "last_mile",
"delivery_station_id": null,
"last_mile_fee": 0,
"fulfilment_type": "courier",
"environment": "production",
"items": [
{
"id": "49ba3d69-638e-49cf-a0ce-b067167c8034",
"sku": "SKU-1",
"name": "Running shoes",
"quantity": 1,
"unit_price": 5000,
"total_price": 5000,
"metadata": "{}"
}
]
}
}
