> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.chrt.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.chrt.com/_mcp/server.

# Create

POST https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1
Content-Type: application/json

Creates a booking for a flight task group's cargos: a draft to search and book through an integration, or a MANUAL booking placed outside CHRT, confirmed with its AWB and itinerary, which sets the task group's flights and the cargos' AWB. | authz_personas=[task_group_coordinator_operators] | (CargoOnFlightBookingClientCreate1) -> (CargoOnFlightBooking1)

Reference: https://docs.chrt.com/api-reference/api-reference/shipping/cargo-on-flight-bookings/create-v-1

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://localhost:5000` (Local, default)
- `https://internal.devtest.truefoundry.tech/api/ml` (Devtest)

## Request

### Body (application/json)

This endpoint expects an object.

- `cargo_dimensions` (list of CargoOnFlightBookingCargoDimension1, required)
- `cargo_ids` (list of string, required)
- `cargo_on_flight_integration` (enum, required)
  - Allowed values: `cargoai`, `manual`
- `schema_version` (integer, required)
- `task_group_id` (string, required)
- `awb_number` (string, optional) — IATA Air Waybill number: 3-digit airline prefix + 8-digit serial, e.g. '020-12345678'.
- `booked_itinerary` (CargoOnFlightBookingItinerary1, optional) — The itinerary of the search result a booking was placed on.
- `booked_rate` (CargoOnFlightBookingRate1, optional) — A price quoted for a shipment: one of a search result's rates, or the price a MANUAL booking was quoted.

## Response

### 200

Successful Response

- `_id` (string, required)
- `cargo_on_flight_integration` (enum, required)
  - Allowed values: `cargoai`, `manual`
- `created_by_org_id` (string, required) — Must be a string starting with `org_`
- `draft_started_at_timestamp` (datetime, required)
- `order_id` (string, required)
- `order_short_id` (string, required)
- `schema_version` (integer, required)
- `status` (enum, required)
  - Allowed values: `draft`, `requested`, `confirmed`, `rejected`, `failed`, `cancellation_requested`, `cancelled`
- `task_group_id` (string, required)
- `awb_number` (string, optional) — IATA Air Waybill number: 3-digit airline prefix + 8-digit serial, e.g. '020-12345678'.
- `booked_itinerary` (CargoOnFlightBookingItinerary1, optional) — The itinerary of the search result a booking was placed on.
- `booked_rate` (CargoOnFlightBookingRate1, optional) — A price quoted for a shipment: one of a search result's rates, or the price a MANUAL booking was quoted.
- `cancellation_requested_at_timestamp` (datetime, optional)
- `cancelled_at_timestamp` (datetime, optional)
- `cargo_dimensions` (list of CargoOnFlightBookingCargoDimension1, optional)
- `cargo_ids` (list of string, optional)
- `cargo_on_flight_booking_search_id` (string, optional)
- `confirmed_at_timestamp` (datetime, optional)
- `created_by_user_id` (string, optional) — Must be a string starting with `user_`
- `failed_at_timestamp` (datetime, optional)
- `flight_leg_ids` (list of string, optional)
- `iata_cass_office_id` (string, optional)
- `integration_status` (string, optional)
- `rejected_at_timestamp` (datetime, optional)
- `requested_at_timestamp` (datetime, optional)

## Errors

### 422 Cargo on Flight Bookings Create V1request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### CargoOnFlightBookingCargoDimension1

`quantity` identical pieces, each of these dimensions and weight.

- `height_inches` (double, required)
- `length_inches` (double, required)
- `quantity` (integer, required)
- `weight_per_piece_pounds` (double, required)
- `width_inches` (double, required)
- `stackable` (boolean, optional, default: true)
- `turnable` (boolean, optional, default: false)

### CargoOnFlightBookingItinerary1

The itinerary of the search result a booking was placed on.

- `carrier_iata` (string, required)
- `latest_acceptance_utc` (datetime, optional)
- `legs` (list of CargoOnFlightBookingItineraryLeg1, optional)
- `time_of_availability_utc` (datetime, optional)

### CargoOnFlightBookingRate1

A price quoted for a shipment: one of a search result's rates, or the price a MANUAL booking was quoted.

- `currency_code` (string, required)
- `total_amount` (double, required)
- `integration_rate_id` (string, optional)
- `rate_name` (string, optional)

### ValidationError

- `loc` (list of LocationItem, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (map from string to any, optional)
- `input` (any, optional)

### CargoOnFlightBookingItineraryLeg1

One leg of an itinerary: a flight, or a road feeder truck (`surface_transport`).

- `carrier_iata` (string, required)
- `destination_iata` (string, required)
- `flight_number` (string, required)
- `origin_iata` (string, required)
- `scheduled_arrival_utc` (datetime, required)
- `scheduled_departure_utc` (datetime, required)
- `surface_transport` (boolean, required)

### LocationItem

## Examples

**Request**

```json
{
  "cargo_dimensions": [
    {
      "height_inches": 1.1,
      "length_inches": 1.1,
      "quantity": 1,
      "weight_per_piece_pounds": 1.1,
      "width_inches": 1.1
    }
  ],
  "cargo_ids": [
    "cargo_ids"
  ],
  "cargo_on_flight_integration": "cargoai",
  "schema_version": 1,
  "task_group_id": "task_group_id"
}
```

**Response**

```json
{
  "_id": "_id",
  "cargo_on_flight_integration": "cargoai",
  "created_by_org_id": "created_by_org_id",
  "draft_started_at_timestamp": "2024-01-15T09:30:00Z",
  "order_id": "order_id",
  "order_short_id": "order_short_id",
  "schema_version": 1,
  "status": "draft",
  "task_group_id": "task_group_id",
  "awb_number": "awb_number",
  "booked_itinerary": {
    "carrier_iata": "carrier_iata",
    "latest_acceptance_utc": "2024-01-15T09:30:00Z",
    "legs": [
      {
        "carrier_iata": "carrier_iata",
        "destination_iata": "destination_iata",
        "flight_number": "flight_number",
        "origin_iata": "origin_iata",
        "scheduled_arrival_utc": "2024-01-15T09:30:00Z",
        "scheduled_departure_utc": "2024-01-15T09:30:00Z",
        "surface_transport": true
      }
    ],
    "time_of_availability_utc": "2024-01-15T09:30:00Z"
  },
  "booked_rate": {
    "currency_code": "currency_code",
    "total_amount": 1.1,
    "integration_rate_id": "integration_rate_id",
    "rate_name": "rate_name"
  },
  "cancellation_requested_at_timestamp": "2024-01-15T09:30:00Z",
  "cancelled_at_timestamp": "2024-01-15T09:30:00Z",
  "cargo_dimensions": [
    {
      "height_inches": 1.1,
      "length_inches": 1.1,
      "quantity": 1,
      "weight_per_piece_pounds": 1.1,
      "width_inches": 1.1,
      "stackable": true,
      "turnable": true
    }
  ],
  "cargo_ids": [
    "cargo_ids"
  ],
  "cargo_on_flight_booking_search_id": "cargo_on_flight_booking_search_id",
  "confirmed_at_timestamp": "2024-01-15T09:30:00Z",
  "created_by_user_id": "created_by_user_id",
  "failed_at_timestamp": "2024-01-15T09:30:00Z",
  "flight_leg_ids": [
    "flight_leg_ids"
  ],
  "iata_cass_office_id": "iata_cass_office_id",
  "integration_status": "integration_status",
  "rejected_at_timestamp": "2024-01-15T09:30:00Z",
  "requested_at_timestamp": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1"

payload = {
    "cargo_dimensions": [
        {
            "height_inches": 1.1,
            "length_inches": 1.1,
            "quantity": 1,
            "weight_per_piece_pounds": 1.1,
            "width_inches": 1.1
        }
    ],
    "cargo_ids": ["cargo_ids"],
    "cargo_on_flight_integration": "cargoai",
    "schema_version": 1,
    "task_group_id": "task_group_id"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"cargo_dimensions":[{"height_inches":1.1,"length_inches":1.1,"quantity":1,"weight_per_piece_pounds":1.1,"width_inches":1.1}],"cargo_ids":["cargo_ids"],"cargo_on_flight_integration":"cargoai","schema_version":1,"task_group_id":"task_group_id"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1"

	payload := strings.NewReader("{\n  \"cargo_dimensions\": [\n    {\n      \"height_inches\": 1.1,\n      \"length_inches\": 1.1,\n      \"quantity\": 1,\n      \"weight_per_piece_pounds\": 1.1,\n      \"width_inches\": 1.1\n    }\n  ],\n  \"cargo_ids\": [\n    \"cargo_ids\"\n  ],\n  \"cargo_on_flight_integration\": \"cargoai\",\n  \"schema_version\": 1,\n  \"task_group_id\": \"task_group_id\"\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(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1")

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  \"cargo_dimensions\": [\n    {\n      \"height_inches\": 1.1,\n      \"length_inches\": 1.1,\n      \"quantity\": 1,\n      \"weight_per_piece_pounds\": 1.1,\n      \"width_inches\": 1.1\n    }\n  ],\n  \"cargo_ids\": [\n    \"cargo_ids\"\n  ],\n  \"cargo_on_flight_integration\": \"cargoai\",\n  \"schema_version\": 1,\n  \"task_group_id\": \"task_group_id\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cargo_dimensions\": [\n    {\n      \"height_inches\": 1.1,\n      \"length_inches\": 1.1,\n      \"quantity\": 1,\n      \"weight_per_piece_pounds\": 1.1,\n      \"width_inches\": 1.1\n    }\n  ],\n  \"cargo_ids\": [\n    \"cargo_ids\"\n  ],\n  \"cargo_on_flight_integration\": \"cargoai\",\n  \"schema_version\": 1,\n  \"task_group_id\": \"task_group_id\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1', [
  'body' => '{
  "cargo_dimensions": [
    {
      "height_inches": 1.1,
      "length_inches": 1.1,
      "quantity": 1,
      "weight_per_piece_pounds": 1.1,
      "width_inches": 1.1
    }
  ],
  "cargo_ids": [
    "cargo_ids"
  ],
  "cargo_on_flight_integration": "cargoai",
  "schema_version": 1,
  "task_group_id": "task_group_id"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cargo_dimensions\": [\n    {\n      \"height_inches\": 1.1,\n      \"length_inches\": 1.1,\n      \"quantity\": 1,\n      \"weight_per_piece_pounds\": 1.1,\n      \"width_inches\": 1.1\n    }\n  ],\n  \"cargo_ids\": [\n    \"cargo_ids\"\n  ],\n  \"cargo_on_flight_integration\": \"cargoai\",\n  \"schema_version\": 1,\n  \"task_group_id\": \"task_group_id\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cargo_dimensions": [
    [
      "height_inches": 1.1,
      "length_inches": 1.1,
      "quantity": 1,
      "weight_per_piece_pounds": 1.1,
      "width_inches": 1.1
    ]
  ],
  "cargo_ids": ["cargo_ids"],
  "cargo_on_flight_integration": "cargoai",
  "schema_version": 1,
  "task_group_id": "task_group_id"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://localhost:5000/shipping/cargo_on_flight_bookings/create/v1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```