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

# 1.1 Update shipment details

PUT https://v1/shipment/123-00000000
Content-Type: application/json

Possibility to update existing shipment by document number including document number itself. Expected values for input defined in shipment table above.

Reference: https://api.leanmile.com/otp-cc-flow/1-shipments/1-1-update-shipment-details

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: OTP CC Flow
  version: 1.0.0
paths:
  /v1/shipment/123-00000000:
    put:
      operationId: 1-1-update-shipment-details
      summary: 1.1 Update shipment details
      description: >-
        Possibility to update existing shipment by document number including
        document number itself. Expected values for input defined in shipment
        table above.
      tags:
        - subpackage_1Shipments
      parameters:
        - name: Authorization
          in: header
          description: Basic authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/1. Shipments_1.1 Update shipment
                  details_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PutV1Shipment123-00000000RequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PutV1Shipment123-00000000RequestUnauthorizedError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PutV1Shipment123-00000000RequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                airport:
                  type: string
                charter:
                  type: boolean
                arriveDate:
                  type: string
                  format: date-time
                flightNumber:
                  type: string
                documentNumber:
                  type: string
                shipmentPieces:
                  type: integer
                shipmentWeight:
                  type: number
                  format: double
                operatorSiteCode:
                  type: string
              required:
                - airport
                - charter
                - arriveDate
                - flightNumber
                - documentNumber
                - shipmentPieces
                - shipmentWeight
                - operatorSiteCode
servers:
  - url: https:/
    description: https://{baseurl}
components:
  schemas:
    V1Shipment12300000000PutResponsesContentApplicationJsonSchemaData:
      type: object
      properties: {}
      title: V1Shipment12300000000PutResponsesContentApplicationJsonSchemaData
    1. Shipments_1.1 Update shipment details_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/V1Shipment12300000000PutResponsesContentApplicationJsonSchemaData
        status:
          type: string
        message:
          type: string
        statusCode:
          type: integer
      required:
        - data
        - status
        - message
        - statusCode
      title: 1. Shipments_1.1 Update shipment details_Response_200
    PutV1Shipment123-00000000RequestBadRequestError:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/V1Shipment12300000000PutResponsesContentApplicationJsonSchemaData
        status:
          type: string
        message:
          type: string
        statusCode:
          type: integer
      required:
        - data
        - status
        - message
        - statusCode
      title: PutV1Shipment123-00000000RequestBadRequestError
    PutV1Shipment123-00000000RequestUnauthorizedError:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/V1Shipment12300000000PutResponsesContentApplicationJsonSchemaData
        status:
          type: string
        message:
          type: string
        statusCode:
          type: integer
      required:
        - data
        - status
        - message
        - statusCode
      title: PutV1Shipment123-00000000RequestUnauthorizedError
    PutV1Shipment123-00000000RequestInternalServerError:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/V1Shipment12300000000PutResponsesContentApplicationJsonSchemaData
        status:
          type: string
        message:
          type: string
        statusCode:
          type: integer
      required:
        - data
        - status
        - message
        - statusCode
      title: PutV1Shipment123-00000000RequestInternalServerError
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

```

## Examples



**Request**

```json
{
  "airport": "RIX",
  "charter": false,
  "arriveDate": "2025-11-26T15:00:00Z",
  "flightNumber": "AY1234/24NOV25",
  "documentNumber": "123-00000000",
  "shipmentPieces": 9,
  "shipmentWeight": 20.5,
  "operatorSiteCode": "RIX"
}
```

**Response**

```json
{
  "data": {
    "id": 12332,
    "hub": "OTP",
    "ref": "shipment/12332",
    "airport": "OTP",
    "charter": false,
    "arriveDate": "2025-11-26T15:00:00Z",
    "documentType": "MAWB",
    "flightNumber": "AY1234/24NOV26",
    "documentNumber": "123-00000000",
    "shipmentPieces": 9,
    "shipmentWeight": 20.5
  },
  "status": "OK",
  "message": "Shipment updated successfully",
  "statusCode": 200
}
```

**SDK Code**

```python 1. Shipments_1.1 Update shipment details_example
import requests

url = "https://https/v1/shipment/123-00000000"

payload = {
    "airport": "RIX",
    "charter": False,
    "arriveDate": "2025-11-26T15:00:00Z",
    "flightNumber": "AY1234/24NOV25",
    "documentNumber": "123-00000000",
    "shipmentPieces": 9,
    "shipmentWeight": 20.5,
    "operatorSiteCode": "RIX"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript 1. Shipments_1.1 Update shipment details_example
const url = 'https://https/v1/shipment/123-00000000';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'PUT',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"airport":"RIX","charter":false,"arriveDate":"2025-11-26T15:00:00Z","flightNumber":"AY1234/24NOV25","documentNumber":"123-00000000","shipmentPieces":9,"shipmentWeight":20.5,"operatorSiteCode":"RIX"}'
};

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

```go 1. Shipments_1.1 Update shipment details_example
package main

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

func main() {

	url := "https://https/v1/shipment/123-00000000"

	payload := strings.NewReader("{\n  \"airport\": \"RIX\",\n  \"charter\": false,\n  \"arriveDate\": \"2025-11-26T15:00:00Z\",\n  \"flightNumber\": \"AY1234/24NOV25\",\n  \"documentNumber\": \"123-00000000\",\n  \"shipmentPieces\": 9,\n  \"shipmentWeight\": 20.5,\n  \"operatorSiteCode\": \"RIX\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	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 1. Shipments_1.1 Update shipment details_example
require 'uri'
require 'net/http'

url = URI("https://https/v1/shipment/123-00000000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"airport\": \"RIX\",\n  \"charter\": false,\n  \"arriveDate\": \"2025-11-26T15:00:00Z\",\n  \"flightNumber\": \"AY1234/24NOV25\",\n  \"documentNumber\": \"123-00000000\",\n  \"shipmentPieces\": 9,\n  \"shipmentWeight\": 20.5,\n  \"operatorSiteCode\": \"RIX\"\n}"

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

```java 1. Shipments_1.1 Update shipment details_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://https/v1/shipment/123-00000000")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"airport\": \"RIX\",\n  \"charter\": false,\n  \"arriveDate\": \"2025-11-26T15:00:00Z\",\n  \"flightNumber\": \"AY1234/24NOV25\",\n  \"documentNumber\": \"123-00000000\",\n  \"shipmentPieces\": 9,\n  \"shipmentWeight\": 20.5,\n  \"operatorSiteCode\": \"RIX\"\n}")
  .asString();
```

```php 1. Shipments_1.1 Update shipment details_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://https/v1/shipment/123-00000000', [
  'body' => '{
  "airport": "RIX",
  "charter": false,
  "arriveDate": "2025-11-26T15:00:00Z",
  "flightNumber": "AY1234/24NOV25",
  "documentNumber": "123-00000000",
  "shipmentPieces": 9,
  "shipmentWeight": 20.5,
  "operatorSiteCode": "RIX"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

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

```csharp 1. Shipments_1.1 Update shipment details_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://https/v1/shipment/123-00000000");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.PUT);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"airport\": \"RIX\",\n  \"charter\": false,\n  \"arriveDate\": \"2025-11-26T15:00:00Z\",\n  \"flightNumber\": \"AY1234/24NOV25\",\n  \"documentNumber\": \"123-00000000\",\n  \"shipmentPieces\": 9,\n  \"shipmentWeight\": 20.5,\n  \"operatorSiteCode\": \"RIX\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1. Shipments_1.1 Update shipment details_example
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "airport": "RIX",
  "charter": false,
  "arriveDate": "2025-11-26T15:00:00Z",
  "flightNumber": "AY1234/24NOV25",
  "documentNumber": "123-00000000",
  "shipmentPieces": 9,
  "shipmentWeight": 20.5,
  "operatorSiteCode": "RIX"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/v1/shipment/123-00000000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```