Create a shipment
curl --request POST \
--url https://portal.urbnbox.io/api/partner/v1/shipments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"external_reference": "ORDER-1001",
"recipient_name": "Jane Mwangi",
"recipient_phone": "+254712345678",
"origin_city": "Nairobi",
"destination_city": "Mombasa",
"weight_tier": "light",
"starts_at": "2026-07-05",
"ends_at": "2026-07-08"
}
'import requests
url = "https://portal.urbnbox.io/api/partner/v1/shipments"
payload = {
"external_reference": "ORDER-1001",
"recipient_name": "Jane Mwangi",
"recipient_phone": "+254712345678",
"origin_city": "Nairobi",
"destination_city": "Mombasa",
"weight_tier": "light",
"starts_at": "2026-07-05",
"ends_at": "2026-07-08"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_reference: 'ORDER-1001',
recipient_name: 'Jane Mwangi',
recipient_phone: '+254712345678',
origin_city: 'Nairobi',
destination_city: 'Mombasa',
weight_tier: 'light',
starts_at: '2026-07-05',
ends_at: '2026-07-08'
})
};
fetch('https://portal.urbnbox.io/api/partner/v1/shipments', 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://portal.urbnbox.io/api/partner/v1/shipments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_reference' => 'ORDER-1001',
'recipient_name' => 'Jane Mwangi',
'recipient_phone' => '+254712345678',
'origin_city' => 'Nairobi',
'destination_city' => 'Mombasa',
'weight_tier' => 'light',
'starts_at' => '2026-07-05',
'ends_at' => '2026-07-08'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://portal.urbnbox.io/api/partner/v1/shipments"
payload := strings.NewReader("{\n \"external_reference\": \"ORDER-1001\",\n \"recipient_name\": \"Jane Mwangi\",\n \"recipient_phone\": \"+254712345678\",\n \"origin_city\": \"Nairobi\",\n \"destination_city\": \"Mombasa\",\n \"weight_tier\": \"light\",\n \"starts_at\": \"2026-07-05\",\n \"ends_at\": \"2026-07-08\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://portal.urbnbox.io/api/partner/v1/shipments")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_reference\": \"ORDER-1001\",\n \"recipient_name\": \"Jane Mwangi\",\n \"recipient_phone\": \"+254712345678\",\n \"origin_city\": \"Nairobi\",\n \"destination_city\": \"Mombasa\",\n \"weight_tier\": \"light\",\n \"starts_at\": \"2026-07-05\",\n \"ends_at\": \"2026-07-08\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://portal.urbnbox.io/api/partner/v1/shipments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_reference\": \"ORDER-1001\",\n \"recipient_name\": \"Jane Mwangi\",\n \"recipient_phone\": \"+254712345678\",\n \"origin_city\": \"Nairobi\",\n \"destination_city\": \"Mombasa\",\n \"weight_tier\": \"light\",\n \"starts_at\": \"2026-07-05\",\n \"ends_at\": \"2026-07-08\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"tracking_token": "<string>",
"tracking_url": "<string>",
"status": "<string>",
"origin_locker": {
"name": "<string>",
"city": "<string>",
"address": "<string>"
},
"destination_locker": {
"name": "<string>",
"city": "<string>",
"address": "<string>"
},
"fee_breakdown": {
"origin_locker_fee_kes": 123,
"destination_locker_fee_kes": 123,
"transit_rider_fee_kes": 123,
"platform_fee_kes": 123,
"total_kes": 123
},
"deposit_pin": "<string>",
"deposit_whatsapp_link": "<string>",
"collection_whatsapp_link": "<string>"
}<string><string><string>{
"error": "<string>",
"message": "<string>"
}<string>Pickup-point shipments (Partner API)
Create a shipment
Creates a locker-to-locker shipment. This endpoint requires a secret partner key. The deposit PIN is returned only in this response.
POST
/
api
/
partner
/
v1
/
shipments
Create a shipment
curl --request POST \
--url https://portal.urbnbox.io/api/partner/v1/shipments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"external_reference": "ORDER-1001",
"recipient_name": "Jane Mwangi",
"recipient_phone": "+254712345678",
"origin_city": "Nairobi",
"destination_city": "Mombasa",
"weight_tier": "light",
"starts_at": "2026-07-05",
"ends_at": "2026-07-08"
}
'import requests
url = "https://portal.urbnbox.io/api/partner/v1/shipments"
payload = {
"external_reference": "ORDER-1001",
"recipient_name": "Jane Mwangi",
"recipient_phone": "+254712345678",
"origin_city": "Nairobi",
"destination_city": "Mombasa",
"weight_tier": "light",
"starts_at": "2026-07-05",
"ends_at": "2026-07-08"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_reference: 'ORDER-1001',
recipient_name: 'Jane Mwangi',
recipient_phone: '+254712345678',
origin_city: 'Nairobi',
destination_city: 'Mombasa',
weight_tier: 'light',
starts_at: '2026-07-05',
ends_at: '2026-07-08'
})
};
fetch('https://portal.urbnbox.io/api/partner/v1/shipments', 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://portal.urbnbox.io/api/partner/v1/shipments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_reference' => 'ORDER-1001',
'recipient_name' => 'Jane Mwangi',
'recipient_phone' => '+254712345678',
'origin_city' => 'Nairobi',
'destination_city' => 'Mombasa',
'weight_tier' => 'light',
'starts_at' => '2026-07-05',
'ends_at' => '2026-07-08'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://portal.urbnbox.io/api/partner/v1/shipments"
payload := strings.NewReader("{\n \"external_reference\": \"ORDER-1001\",\n \"recipient_name\": \"Jane Mwangi\",\n \"recipient_phone\": \"+254712345678\",\n \"origin_city\": \"Nairobi\",\n \"destination_city\": \"Mombasa\",\n \"weight_tier\": \"light\",\n \"starts_at\": \"2026-07-05\",\n \"ends_at\": \"2026-07-08\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://portal.urbnbox.io/api/partner/v1/shipments")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_reference\": \"ORDER-1001\",\n \"recipient_name\": \"Jane Mwangi\",\n \"recipient_phone\": \"+254712345678\",\n \"origin_city\": \"Nairobi\",\n \"destination_city\": \"Mombasa\",\n \"weight_tier\": \"light\",\n \"starts_at\": \"2026-07-05\",\n \"ends_at\": \"2026-07-08\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://portal.urbnbox.io/api/partner/v1/shipments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_reference\": \"ORDER-1001\",\n \"recipient_name\": \"Jane Mwangi\",\n \"recipient_phone\": \"+254712345678\",\n \"origin_city\": \"Nairobi\",\n \"destination_city\": \"Mombasa\",\n \"weight_tier\": \"light\",\n \"starts_at\": \"2026-07-05\",\n \"ends_at\": \"2026-07-08\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"tracking_token": "<string>",
"tracking_url": "<string>",
"status": "<string>",
"origin_locker": {
"name": "<string>",
"city": "<string>",
"address": "<string>"
},
"destination_locker": {
"name": "<string>",
"city": "<string>",
"address": "<string>"
},
"fee_breakdown": {
"origin_locker_fee_kes": 123,
"destination_locker_fee_kes": 123,
"transit_rider_fee_kes": 123,
"platform_fee_kes": 123,
"total_kes": 123
},
"deposit_pin": "<string>",
"deposit_whatsapp_link": "<string>",
"collection_whatsapp_link": "<string>"
}<string><string><string>{
"error": "<string>",
"message": "<string>"
}<string>Authorizations
Partner key. Shipment creation requires a secret key.
Body
application/json
Your order or fulfillment ID.
Example:
"+254712345678"
Example:
"Nairobi"
Example:
"Mombasa"
Available options:
light, medium, heavy Response
Shipment created.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
One-time deposit PIN. Store it when creating the shipment.
Pattern:
^[0-9]{6}$