Create Booking
Books an existing Open Shipment with a carrier and provisions the shipping label(s). On success you receive the carrier-generated tracking number, the booking status, the label document(s), and — for PUDO bookings — the confirmed location details.
Create the Open Shipment first with the carrier-required information (addresses, weight, line items as the carrier demands), then book it here. The Booking feature requires account enablement — contact your account team.
A booking can succeed before the carrier finishes generating the
label: the response is then HTTP 299 and download_url /
base64_content inside documents may be null. Fetch the label
later with Retrieve a Document (URL + Base64) or List Labels (URL
only).
curl --request POST \
--url https://api.perform.ai/v5/booking/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipment_id": "SHP-2026-000115",
"carrier_reference": "dhl-ecommerce-de"
}
'import requests
url = "https://api.perform.ai/v5/booking/"
payload = {
"shipment_id": "SHP-2026-000115",
"carrier_reference": "dhl-ecommerce-de"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shipment_id: 'SHP-2026-000115', carrier_reference: 'dhl-ecommerce-de'})
};
fetch('https://api.perform.ai/v5/booking/', 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.perform.ai/v5/booking/",
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([
'shipment_id' => 'SHP-2026-000115',
'carrier_reference' => 'dhl-ecommerce-de'
]),
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.perform.ai/v5/booking/"
payload := strings.NewReader("{\n \"shipment_id\": \"SHP-2026-000115\",\n \"carrier_reference\": \"dhl-ecommerce-de\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.perform.ai/v5/booking/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipment_id\": \"SHP-2026-000115\",\n \"carrier_reference\": \"dhl-ecommerce-de\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perform.ai/v5/booking/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipment_id\": \"SHP-2026-000115\",\n \"carrier_reference\": \"dhl-ecommerce-de\"\n}"
response = http.request(request)
puts response.read_body{
"api_response": "<string>",
"data": {
"booking_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shipment_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shipment_id": "<string>",
"carrier_reference": "<string>",
"shipping_service": "<string>",
"carrier_shipment_identifier": "<string>",
"tracking_number": "<string>",
"type_of_shipment": "outbound",
"status": "booked",
"documents": [
{
"document_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_id": "<string>",
"name": "<string>",
"type": "<string>",
"file_format": "<string>",
"download_url": "<string>",
"base64_content": "<string>",
"created_date": "<string>",
"additional_info": {}
}
],
"pudo_location_uuid": "<string>",
"pudo_locations": [
{
"pudo_location_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"carrier_id": "<string>",
"pudo_location_id": "<string>",
"address": {
"location_types": [
"<string>"
],
"mapped_location_types": [
"<string>"
],
"location_type": "<string>",
"mapped_location_type": "<string>",
"entity_reference": "<string>",
"address_name": "<string>",
"full": "<string>",
"line1": "<string>",
"line2": "<string>",
"line3": "<string>",
"street_name": "<string>",
"house_number": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state_or_province": "<string>",
"region": "<string>",
"country": "<string>",
"country_code": "<string>",
"phone": "<string>"
},
"lat": 123,
"lng": 123,
"distance_meters": 123,
"operating_hours_calc": [
{
"service_name": "<string>",
"operating_day": "<string>",
"time_zone": "<string>",
"first_open_hours": "<string>",
"second_open_hours": "<string>",
"first_cutoff": "<string>",
"second_cutoff": "<string>"
}
],
"opening_hours": [
{
"day_of_week": "<string>",
"open_hour": "<string>",
"close_hour": "<string>"
}
],
"cutoff_hours": [
{
"service": "<string>",
"day_of_week": "<string>",
"cutoff_at": "<string>"
}
],
"closing_periods": [
{
"from_date": "<string>",
"to_date": "<string>",
"reason": "<string>"
}
],
"validity_period": {
"from_date": "<string>",
"to_date": "<string>"
},
"services": [
"<string>"
],
"additional_info": {},
"updated_date": "<string>"
}
],
"carrier_additional_info": {},
"created_date": "<string>",
"updated_date": "<string>"
}
}{
"api_response": "<string>",
"warnings": {},
"data": {}
}{
"api_response": "4030",
"message": "Validation error",
"data": {
"errors": {
"carrier_reference": [
{
"api_response": "4030",
"standard_error_message": "Value provided is not defined for outbound or return. Please provide the correct carrier_reference or reach out to Perform.AI Customer Success team for assistance."
}
]
},
"shipment_id": "SHP-2026-000115",
"shipment_uuid": "026c09d3-4243-4056-b412-c62411827878"
}
}{
"api_response": 403,
"message": "Key not authorized"
}{
"api_response": 429,
"message": "Throttled"
}{
"api_response": "<string>",
"message": "<string>"
}Authorizations
Used by every functional endpoint. Generate the token with POST /auth/oauth/token/ and send it as Authorization: Bearer {token}.
Body
The Open Shipment's Perform.AI identifier. Provide this or shipment_id.
The Open Shipment's identifier in your system. Provide this or shipment_uuid.
50The carrier configuration to book with, from Settings > Carriers; it must be enabled for booking (outbound or return). Optional when the Shipment already has a carrier_reference — the booking then uses the Shipment's carrier. When provided, the request's value is used for the carrier booking. Avoid sending a value that conflicts with the Shipment's own carrier reference — omit the field or keep them consistent. Do not send it as null or an empty string.
50Route the booking to a specific PUDO location, from the PUDO locations endpoint.
Carrier-specific booking metadata.
curl --request POST \
--url https://api.perform.ai/v5/booking/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipment_id": "SHP-2026-000115",
"carrier_reference": "dhl-ecommerce-de"
}
'import requests
url = "https://api.perform.ai/v5/booking/"
payload = {
"shipment_id": "SHP-2026-000115",
"carrier_reference": "dhl-ecommerce-de"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shipment_id: 'SHP-2026-000115', carrier_reference: 'dhl-ecommerce-de'})
};
fetch('https://api.perform.ai/v5/booking/', 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.perform.ai/v5/booking/",
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([
'shipment_id' => 'SHP-2026-000115',
'carrier_reference' => 'dhl-ecommerce-de'
]),
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.perform.ai/v5/booking/"
payload := strings.NewReader("{\n \"shipment_id\": \"SHP-2026-000115\",\n \"carrier_reference\": \"dhl-ecommerce-de\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.perform.ai/v5/booking/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipment_id\": \"SHP-2026-000115\",\n \"carrier_reference\": \"dhl-ecommerce-de\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perform.ai/v5/booking/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipment_id\": \"SHP-2026-000115\",\n \"carrier_reference\": \"dhl-ecommerce-de\"\n}"
response = http.request(request)
puts response.read_body{
"api_response": "<string>",
"data": {
"booking_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shipment_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shipment_id": "<string>",
"carrier_reference": "<string>",
"shipping_service": "<string>",
"carrier_shipment_identifier": "<string>",
"tracking_number": "<string>",
"type_of_shipment": "outbound",
"status": "booked",
"documents": [
{
"document_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_id": "<string>",
"name": "<string>",
"type": "<string>",
"file_format": "<string>",
"download_url": "<string>",
"base64_content": "<string>",
"created_date": "<string>",
"additional_info": {}
}
],
"pudo_location_uuid": "<string>",
"pudo_locations": [
{
"pudo_location_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"carrier_id": "<string>",
"pudo_location_id": "<string>",
"address": {
"location_types": [
"<string>"
],
"mapped_location_types": [
"<string>"
],
"location_type": "<string>",
"mapped_location_type": "<string>",
"entity_reference": "<string>",
"address_name": "<string>",
"full": "<string>",
"line1": "<string>",
"line2": "<string>",
"line3": "<string>",
"street_name": "<string>",
"house_number": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state_or_province": "<string>",
"region": "<string>",
"country": "<string>",
"country_code": "<string>",
"phone": "<string>"
},
"lat": 123,
"lng": 123,
"distance_meters": 123,
"operating_hours_calc": [
{
"service_name": "<string>",
"operating_day": "<string>",
"time_zone": "<string>",
"first_open_hours": "<string>",
"second_open_hours": "<string>",
"first_cutoff": "<string>",
"second_cutoff": "<string>"
}
],
"opening_hours": [
{
"day_of_week": "<string>",
"open_hour": "<string>",
"close_hour": "<string>"
}
],
"cutoff_hours": [
{
"service": "<string>",
"day_of_week": "<string>",
"cutoff_at": "<string>"
}
],
"closing_periods": [
{
"from_date": "<string>",
"to_date": "<string>",
"reason": "<string>"
}
],
"validity_period": {
"from_date": "<string>",
"to_date": "<string>"
},
"services": [
"<string>"
],
"additional_info": {},
"updated_date": "<string>"
}
],
"carrier_additional_info": {},
"created_date": "<string>",
"updated_date": "<string>"
}
}{
"api_response": "<string>",
"warnings": {},
"data": {}
}{
"api_response": "4030",
"message": "Validation error",
"data": {
"errors": {
"carrier_reference": [
{
"api_response": "4030",
"standard_error_message": "Value provided is not defined for outbound or return. Please provide the correct carrier_reference or reach out to Perform.AI Customer Success team for assistance."
}
]
},
"shipment_id": "SHP-2026-000115",
"shipment_uuid": "026c09d3-4243-4056-b412-c62411827878"
}
}{
"api_response": 403,
"message": "Key not authorized"
}{
"api_response": 429,
"message": "Throttled"
}{
"api_response": "<string>",
"message": "<string>"
}