> This page is for version Dev.
> For other versions, use one of these documentation indexes:
> - Prod (default): https://docs.chrt.com/prod/llms.txt
> - Staging: https://docs.chrt.com/staging/llms.txt
> - Dev: https://docs.chrt.com/dev/llms.txt

> 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.

# Add

POST https://localhost:8000/orgs/air_waybill_stock_numbers/add/v1
Content-Type: application/json

Adds AWB numbers an airline gave the caller's organization to its AWB stock, skipping numbers already in it. | authz: min_org_role=operator | (AirWaybillStockNumbersAddReq) -> (AirWaybillStockNumbersAddRes)

Reference: https://docs.chrt.com/dev/api-reference/api-reference/orgs/air-waybill-stock-numbers/add-v-1

## Authentication

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

## Servers

- `https://localhost:8000` (Local, default)
- `https://api.dev.chrt.com` (Development)
- `https://api.staging.chrt.com` (Staging)
- `https://api.chrt.com` (Production)

## Request

### Body (application/json)

This endpoint expects an object.

- `awb_numbers` (list of string, required)

## Response

### 200

Successful Response

- `added` (list of AirWaybillStockNumber1, required)
- `already_in_stock_awb_numbers` (list of string, required)

## Errors

### 422 Air Waybill Stock Numbers Add V1request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### AirWaybillStockNumber1

- `_id` (string, required)
- `awb_number` (string, required) — IATA Air Waybill number: 3-digit airline prefix + 8-digit serial, e.g. '020-12345678'.
- `created_at_timestamp` (datetime, required)
- `created_by_user_id` (string, required) — Must be a string starting with `user_`
- `owned_by_org_id` (string, required) — Must be a string starting with `org_`
- `schema_version` (integer, required)
- `status` (enum, required)
  - Allowed values: `available`, `reserved`, `used`, `void`
- `status_changed_at_timestamp` (datetime, required)
- `cargo_on_flight_booking_id` (string, optional, nullable)
- `status_changed_by_user_id` (string, optional, nullable) — Must be a string starting with `user_`
- `status_note` (string, optional, nullable)

### ValidationError

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

### LocationItem

## Examples

**Request**

```json
{
  "awb_numbers": [
    "awb_numbers"
  ]
}
```

**Response**

```json
{
  "added": [
    {
      "_id": "_id",
      "awb_number": "awb_number",
      "created_at_timestamp": "2024-01-15T09:30:00Z",
      "created_by_user_id": "created_by_user_id",
      "owned_by_org_id": "owned_by_org_id",
      "schema_version": 1,
      "status": "available",
      "status_changed_at_timestamp": "2024-01-15T09:30:00Z",
      "cargo_on_flight_booking_id": "cargo_on_flight_booking_id",
      "status_changed_by_user_id": "status_changed_by_user_id",
      "status_note": "status_note"
    }
  ],
  "already_in_stock_awb_numbers": [
    "already_in_stock_awb_numbers"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://localhost:8000/orgs/air_waybill_stock_numbers/add/v1"

payload = { "awb_numbers": ["awb_numbers"] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://localhost:8000/orgs/air_waybill_stock_numbers/add/v1';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"awb_numbers":["awb_numbers"]}'
};

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:8000/orgs/air_waybill_stock_numbers/add/v1"

	payload := strings.NewReader("{\n  \"awb_numbers\": [\n    \"awb_numbers\"\n  ]\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:8000/orgs/air_waybill_stock_numbers/add/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  \"awb_numbers\": [\n    \"awb_numbers\"\n  ]\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:8000/orgs/air_waybill_stock_numbers/add/v1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"awb_numbers\": [\n    \"awb_numbers\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://localhost:8000/orgs/air_waybill_stock_numbers/add/v1', [
  'body' => '{
  "awb_numbers": [
    "awb_numbers"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://localhost:8000/orgs/air_waybill_stock_numbers/add/v1");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"awb_numbers\": [\n    \"awb_numbers\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["awb_numbers": ["awb_numbers"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://localhost:8000/orgs/air_waybill_stock_numbers/add/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()
```