# TEAM: public_api
openapi: 3.1.0
x-explorer-enabled: false
x-samples-enabled: false
servers:
- description: Flexport API
  url: https://api.flexport.com
info:
  description: >
    The Flexport API enables you to programmatically interact with Flexport's
    freight data.


    The API follows modern RESTful conventions and speaks JSON in both
    directions. As the API uses JSON for both

    requests and responses, we will assume that requests with a payload are
    using properly formatted JSON, however

    we still recommend setting the Content-Type header to the value
    `application/json`
  version: v2
  title: Flexport API
  contact:
    email: hello@flexport.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
tags:
- name: Changelog
  x-traitTag: true
  description: |+
    ## v1 to v2

    ### New Endpoints

    ```
        - POST /booking_amendments
        - GET /booking_line_items
        - POST /booking_line_items
        - GET /booking_line_items/{id}
        - GET /bookings
        - POST /bookings
        - GET /bookings/{id}
        - GET /commercial_invoices
        - GET /commercial_invoices/{id}
        - GET /container_load_results/{id}
        - GET /customs_entries
        - GET /customs_entries/{id}
        - GET /documents
        - POST /documents
        - GET /documents/{id}
        - GET /documents/{id}/download
        - GET /events
        - GET /events/{id}
        - GET /invoices/{id}
        - GET /network/companies
        - POST /network/companies
        - GET /network/companies/{id}
        - PATCH /network/companies/{id}
        - GET /network/company_entities
        - POST /network/company_entities
        - GET /network/company_entities/{id}
        - PATCH /network/company_entities/{id}
        - GET /network/contacts
        - POST /network/contacts
        - GET /network/contacts/{id}
        - PATCH /network/contacts/{id}
        - GET /network/locations
        - POST /network/locations
        - GET /network/locations/{id}
        - PATCH /network/locations/{id}
        - GET /network/me/companies
        - GET /ocean/shipment_container_legs
        - GET /ocean/shipment_container_legs/{id}
        - GET /ocean/shipment_containers
        - GET /ocean/shipment_containers/{id}
        - PATCH /products/{id}
        - GET /purchase_order_line_items
        - GET /purchase_order_line_items/{id}
        - GET /shipment_legs
        - GET /shipment_legs/{id}
        - PATCH /shipments/{id}
        - POST /shipments_shareable
    ```


    ### Modified Endpoints

    ```
        - GET /invoices
          Parameters:
            - Added page
            - Added per
            - Added sort
            - Added direction
            - Added f.status
            - Added f.shipment.id
            - Added f.billed_directly_to_client
            - Added f.entity.id
            - Added f.entity.ref
            - Added f.name
            - Added f.issued_at.gt
            - Added f.issued_at.lt
            - Added f.last_updated_at.gt
            - Added f.last_updated_at.lt
            - Added f.client_id
            - Added f.shipment_id
            - Removed status
          Responses:
            - Modified 200
                - Added _object (string)
                - Added name (string)
                - Added issued_at (string) | format: date-time
                - Added quote_currency_code (string)
                - Added exchange_rate (number)
                - Added balance (object)
                - Added voided_at (string) | format: date-time
                - Added last_updated_at (string) | format: date-time
                - Added recipient (object)
                - Added issuer (object)
                - Added items (array)
                - Added notes (array)
                - Added credit_memos (array)
                - Added shipments (object)
                - Added service_level (['string', 'null'])
                - Added total.properties (unknown type)
                - Removed invoice_id (string)
                - Removed first_shared_at (string)
                - Removed amount_paid (string)
                - Removed currency (string)
                - Removed shipment_id (integer)
                - Removed shipment_name (string)
                - Removed lines (array)
        - GET /ports
          Parameters:
            - Added f.port_type
            - Added f.unlocode
            - Modified page
            - Modified per
            - Removed q
            - Removed port_type
          Responses:
            - Modified 200
                - Added _object (string)
                - Added address (object)
                - Added details (array)
                - Removed id (integer)
                - Removed iata_code (string)
                - Removed lat (['string', 'null'])
                - Removed lng (['string', 'null'])
                - Removed port_name (string)
                - Removed country_code (string)
        - GET /products
          Parameters:
            - Added f.sku
            - Added f.archived_at.exists
            - Added f.product_properties.TYPE
          Responses:
            - Modified 200
                - Added _object (string)
                - Added archived_at (['string', 'null']) | format: date-time
                - Added product_category (string)
                - Added client_verified (boolean)
                - Added classifications (array)
                - Added product_properties.items (object)
                - Added hs_codes.items.properties._object (string)
                - Removed category (string)
        - POST /products
          Responses:
            - Modified 200
                - Added _object (string)
                - Added archived_at (['string', 'null']) | format: date-time
                - Added product_category (string)
                - Added client_verified (boolean)
                - Added classifications (array)
                - Added product_properties.items (object)
                - Added hs_codes.items.properties._object (string)
                - Removed category (string)
        - GET /products/{id}
          Responses:
            - Modified 200
                - Added _object (string)
                - Added archived_at (['string', 'null']) | format: date-time
                - Added product_category (string)
                - Added client_verified (boolean)
                - Added classifications (array)
                - Added product_properties.items (object)
                - Added hs_codes.items.properties._object (string)
                - Removed category (string)
        - GET /purchase_orders
          Parameters:
            - Added page
            - Added per
            - Added sort
            - Added direction
            - Added f.archived_at.exists
            - Added f.status
            - Added f.buyer_ref
            - Added f.seller_ref
            - Added f.role
            - Added f.shipment.id
            - Added f.name
            - Added f.updated_at.lt
            - Added f.updated_at.gt
            - Added f.created_at.lt
            - Added f.created_at.gt
          Responses:
            - Modified 200
                - Added _object (string)
                - Added buyer (object)
                - Added seller (object)
                - Added origin_port (['object', 'null'])
                - Added origin_address (object)
                - Added destination_port (['object', 'null'])
                - Added destination_address (object)
                - Added archived_at (string) | format: date_time
                - Added created_at (string) | format: date_time
                - Added updated_at (string) | format: date_time
                - Added line_items (object)
                - Added metadata (object)
                - Removed role (string) | enums: buyer, seller
                - Removed other_party_ref (string)
                - Removed currency_code (string)
                - Removed origin_port_ref (string)
                - Removed destination_port_ref (string)
                - Removed origin_location_ref (string)
                - Removed destination_location_ref (string)
                - Removed archived (boolean)
                - Removed po_line_items (array)
        - GET /purchase_orders/{id}
          Parameters:
            - Added f.purchase_order_version.id
            - Modified id (type string -> integer)
          Responses:
            - Modified 200
                - Added _object (string)
                - Added buyer (object)
                - Added seller (object)
                - Added origin_port (['object', 'null'])
                - Added origin_address (object)
                - Added destination_port (['object', 'null'])
                - Added destination_address (object)
                - Added archived_at (string) | format: date_time
                - Added created_at (string) | format: date_time
                - Added updated_at (string) | format: date_time
                - Added line_items (object)
                - Added metadata (object)
                - Removed role (string) | enums: buyer, seller
                - Removed other_party_ref (string)
                - Removed currency_code (string)
                - Removed origin_port_ref (string)
                - Removed destination_port_ref (string)
                - Removed origin_location_ref (string)
                - Removed destination_location_ref (string)
                - Removed archived (boolean)
                - Removed po_line_items (array)
        - GET /shipments
          Parameters:
            - Added f.transportation_mode
            - Added f.status
            - Added f.statuses.any
            - Added f.container_number
            - Added f.purchase_order
            - Added f.sku
            - Added f.updated_at.gt
            - Added f.updated_at.lt
            - Added f.archived_at.gt
            - Added f.archived_at.lt
            - Added f.master_bill_number
            - Added f.house_bill_number
            - Added f.consignee_external_ref
            - Added f.origin_address_ref
            - Added f.destination_address_ref
            - Added f.metadata.YOUR_METADATA_KEY
            - Added f.wants_freight_management_bco
            - Added f.wants_flexport_freight
            - Added f.wants_import_customs_service
            - Added f.wants_export_customs_service
            - Added f.wants_commercial_invoice_transcription
            - Added f.wants_flexport_insurance
            - Added f.wants_pickup_service
            - Added f.wants_trade_declaration_service
            - Added f.visibility_only
            - Added f.wants_delivery_service
            - Added f.belongs_to_a_buyers_consol
            - Modified sort (enum ['id', 'updated_at'] -> ['id', 'transportation_mode', 'status', 'updated_at', 'archived_at'])
            - Modified direction
            - Modified page
            - Modified per (type string -> integer)
            - Removed master_bill_number
            - Removed house_bill_number
          Responses:
            - Modified 200
                - Added metadata (object)
                - Added _object (string)
                - Added booking (object)
                - Added it_number (string)
                - Added created_date (string) | format: date-time
                - Added updated_at (string) | format: date-time
                - Added estimated_departure_date (string) | format: date-time
                - Added actual_departure_date (string) | format: date-time
                - Added estimated_arrival_date (string) | format: date-time
                - Added actual_arrival_date (string) | format: date-time
                - Added wants_freight_management_bco (boolean)
                - Added wants_flexport_freight (boolean)
                - Added wants_commercial_invoice_transcription (boolean)
                - Added wants_flexport_insurance (boolean)
                - Added wants_pickup_service (boolean)
                - Added wants_trade_declaration_service (boolean)
                - Added visibility_only (boolean)
                - Added wants_delivery_service (boolean)
                - Added wants_214_filing (boolean)
                - Added wants_ftz_entry (boolean)
                - Added belongs_to_a_buyers_consol (boolean)
                - Added child_shipments (array)
                - Added parent_shipment (object)
                - Added estimated_picked_up_in_full_date (string) | format: date-time
                - Added actual_picked_up_in_full_date (string) | format: date-time
                - Added estimated_delivered_in_full_date (string) | format: date-time
                - Added actual_delivered_in_full_date (string) | format: date-time
                - Added wants_export_customs_service (boolean)
                - Added wants_import_customs_service (boolean)
                - Added ocean_shipment (['object', 'null'])
                - Added air_shipment (['object', 'null'])
                - Added truck_shipment (['object', 'null'])
                - Added dangerous_goods (object)
                - Added accepted_quote (object)
                - Added quoted_transit_time_days_min (number)
                - Added quoted_transit_time_days_max (number)
                - Added quoted_delivery_date_from (string) | format: date-time
                - Added quoted_delivery_date_to (string) | format: date-time
                - Added detention_free_days (integer)
                - Added shipping_order (object)
                - Added shippers (array)
                - Added consignees (array)
                - Added buyers (array)
                - Added sellers (array)
                - Added importers_of_record (array)
                - Added items (array)
                - Added legs (object)
                - Added customs_entries (object)
                - Added documents (object)
                - Added container_load_result (object)
                - Added picked_up_in_full_date (string) | format: date-time
                - Added delivered_in_full_date (string) | format: date-time
                - Added calculated_weight.properties (unknown type)
                - Added calculated_volume.properties (unknown type)
                - Added commercial_invoices.properties (unknown type)
                - Removed flex_id (string)
                - Removed master_bill_number (string)
                - Removed house_bill_number (string)
                - Removed metric_units (boolean)
                - Removed chargeable_weight (string)
                - Removed chargeable_volume (string)
                - Removed archived_at (['string', 'null']) | format: date-time
                - Removed total_weight (string)
                - Removed total_volume (string)
                - Removed origin_pickup_date (string) | format: date-time
                - Removed pickup_date (['string', 'null'])
                - Removed delivery_date (['string', 'null'])
                - Removed containers (array)
                - Removed graph (object)
                - Removed customs_cost (string)
                - Removed origin_address (string)
                - Removed destination_address (string)
                - Removed commercial_invoices.items (object)
        - GET /shipments/{id}
          Responses:
            - Modified 200
                - Added metadata (object)
                - Added _object (string)
                - Added booking (object)
                - Added it_number (string)
                - Added created_date (string) | format: date-time
                - Added updated_at (string) | format: date-time
                - Added estimated_departure_date (string) | format: date-time
                - Added actual_departure_date (string) | format: date-time
                - Added estimated_arrival_date (string) | format: date-time
                - Added actual_arrival_date (string) | format: date-time
                - Added wants_freight_management_bco (boolean)
                - Added wants_flexport_freight (boolean)
                - Added wants_commercial_invoice_transcription (boolean)
                - Added wants_flexport_insurance (boolean)
                - Added wants_pickup_service (boolean)
                - Added wants_trade_declaration_service (boolean)
                - Added visibility_only (boolean)
                - Added wants_delivery_service (boolean)
                - Added wants_214_filing (boolean)
                - Added wants_ftz_entry (boolean)
                - Added belongs_to_a_buyers_consol (boolean)
                - Added child_shipments (array)
                - Added parent_shipment (object)
                - Added estimated_picked_up_in_full_date (string) | format: date-time
                - Added actual_picked_up_in_full_date (string) | format: date-time
                - Added estimated_delivered_in_full_date (string) | format: date-time
                - Added actual_delivered_in_full_date (string) | format: date-time
                - Added wants_export_customs_service (boolean)
                - Added wants_import_customs_service (boolean)
                - Added ocean_shipment (['object', 'null'])
                - Added air_shipment (['object', 'null'])
                - Added truck_shipment (['object', 'null'])
                - Added dangerous_goods (object)
                - Added accepted_quote (object)
                - Added quoted_transit_time_days_min (number)
                - Added quoted_transit_time_days_max (number)
                - Added quoted_delivery_date_from (string) | format: date-time
                - Added quoted_delivery_date_to (string) | format: date-time
                - Added detention_free_days (integer)
                - Added shipping_order (object)
                - Added shippers (array)
                - Added consignees (array)
                - Added buyers (array)
                - Added sellers (array)
                - Added importers_of_record (array)
                - Added items (array)
                - Added legs (object)
                - Added customs_entries (object)
                - Added documents (object)
                - Added container_load_result (object)
                - Added picked_up_in_full_date (string) | format: date-time
                - Added delivered_in_full_date (string) | format: date-time
                - Added calculated_weight.properties (unknown type)
                - Added calculated_volume.properties (unknown type)
                - Added commercial_invoices.properties (unknown type)
                - Removed flex_id (string)
                - Removed master_bill_number (string)
                - Removed house_bill_number (string)
                - Removed metric_units (boolean)
                - Removed chargeable_weight (string)
                - Removed chargeable_volume (string)
                - Removed archived_at (['string', 'null']) | format: date-time
                - Removed total_weight (string)
                - Removed total_volume (string)
                - Removed origin_pickup_date (string) | format: date-time
                - Removed pickup_date (['string', 'null'])
                - Removed delivery_date (['string', 'null'])
                - Removed containers (array)
                - Removed graph (object)
                - Removed customs_cost (string)
                - Removed origin_address (string)
                - Removed destination_address (string)
                - Removed commercial_invoices.items (object)
    ```


    ### Removed Endpoints

    ```
        - GET /currency_codes
        - GET /network
        - POST /network
        - PATCH /network/{id}
        - POST /network/{id}/create_address
        - DELETE /products/{id}
        - POST /products/{id}
        - POST /purchase_orders
        - GET /quote_requests/{id}
    ```

- name: Authentication
  x-traitTag: true
  description: >
    Flexport provides secure access to our public API using OAuth 2.0. We also
    provide granular access controls for

    various resources. This allows the admins of a client account to create
    multiple credentials for different developers or environments.


    A detailed tutorial on how to create and generate credentials [can be
    found
    here.](https://developers.flexport.com/tutorials/using-api-credentials)
- name: Response Semantics
  x-traitTag: true
  description: >
    All responses to authenticated API requests follow the same structure,
    wrapping resource data within an

    `/api/response` object of the following form:


    | Attribute | Description |

    |--------------|-----------|

    | **_object** _string_ | String representing the object’s type. Always
    `/api/response` for this object |

    | **self** _string_ | The full path to the resource(s) requested |

    | **version** _integer_ | The version of the request (see the Versioning
    docs section) |

    | **data** _object_ | The resource data requested for a successful
    response. `null` on error |

    | **error** _object_ | The error object indicating what went wrong (see
    the Errors docs section) |

    | **errors** _list_ | List of legacy error object JSONs of structure
    {"code": _, "message": _} |
- name: Pagination
  x-traitTag: true
  description: >
    All list endpoints return paginated responses. The response object
    contains elements of the current page,

    and links to the previous and next pages.


    | Attribute | Description |

    |--------------|-----------|

    | **_object** _string_ | String representing the object’s type. Always
    `/api/collections/paginated` for this object |

    | **prev** _string_ | link to the previous page |

    | **next** _string_ | link to the next page |

    | **data** _list_ | list of elements in the current page |


    ## Pagination Parameters


    All list endpoint support the following query parameter to retrieve a
    specific page


    | Attribute | Description |

    |--------------|-----------|

    | **page** _integer_ | Page number of the page to retrieve. Defaults to
    page 1. |

    | **per** _integer_ | Count of items in each page. Defaults to 20. Maximum
    allowed value is 100. |
- name: Expansion
  x-traitTag: true
  description: >
    Many resources in the Flexport API contain attributes that are references
    to another resource or a collection of

    resources. For example, a shipment has a reference to a collection of
    legs. Expansion can be used to replace

    those references with the actual data that they represent. This is helpful
    in eliminating subsequent calls

    required to retrieve all data relevant to a resource.


    Expansion is controlled via the expand query parameter. Multiple
    references can be expanded by providing

    multiple items in the expansion array. Expansion may also be recursive,
    i.e. expanded references can be further

    expanded.


    Expansion is valid for both ObjectRef and CollectionRef attributes.


    ## Examples


    Here are some different ways that the expand query parameter can be used
    with the Container API. In the JSON

    examples, some attributes are removed for brevity and replaced with `...`


    ### Example response without expansion

    ```

    curl -X GET  \
      https://api.flexport.com/ocean/shipment_containers/123
    ```


    ```

    {
      "_object": "/api/response",
      "self": "https://api.flexport.com/ocean/shipment_containers/123",
      "version": 2,
      "data": {
          "_object": "/ocean/shipment_container",
          "id": 123,
          ...
          "shipment": {
            "_object": "/api/refs/object",
            "ref_type": "/shipment",
            "link": "https://api.flexport.com/shipments/222",
            "id": 222
          },
          "container_legs": {
            "_object": "/api/refs/collection",
            "ref_type": "/ocean/shipment_container_leg",
            "link": "https://api.flexport.com/ocean/shipment_container_legs?f.shipment_container.id=123"
          },
          ...
      }
    }

    ```


    ### `expand=container_legs`

    The `container_legs` attribute will be expanded into a JSON array of
    `ContainerLeg` objects, instead of the

    normal behavior of the `legs` attribute being a single
    `CollectionRef<ContainerLeg>`


    ```

    curl -X GET  \
      https://api.flexport.com/ocean/shipment_containers/123?expand=container_legs
    ```


    ```

    {
      "_object": "/api/response",
      "self": "https://api.flexport.com/ocean/shipment_containers/123",
      "version": 2,
      "data": {
          "_object": "/ocean/shipment_container",
          "id": 123,
          ...
          "shipment": {
            "_object": "/api/refs/object",
            "ref_type": "/shipment",
            "link": "https://api.flexport.com/shipments/222",
            "id": 222
          },
          "container_legs": {
              "_object": "/api/collections/paginated",
              "prev": null,
              "next": null,
              "total_count": 1,
              "data": [
                  {
                      "_object": "/ocean/shipment_container_leg",
                      "id": 11111,
                      "dates": {},
                      "shipment_container": {
                          "_object": "/api/refs/object",
                          "ref_type": "/ocean/shipment_container",
                          "link": "https://api.flexport.com/ocean/shipment_containers/289140",
                          "id": 289140
                      },
                      "leg": {
                          "_object": "/api/refs/object",
                          "ref_type": "/shipment_leg",
                          "link": "https://api.flexport.com/shipment_legs/4501396",
                          "id": 4501396
                      }
                  }
              ]
          },
          ...
      }
    }

    ```


    ### `expand=container_legs.leg`

    Each `ContainerLeg` object itself contains an `ObjectRef<ShipmentLeg>`,
    and the expand syntax can be chained to

    expand both the `countainer_legs` array, and each `leg` within each
    `ContainerLeg`


    ```

    curl -X GET  \
      https://api.flexport.com/ocean/shipment_containers/123?expand=container_legs.leg
    ```


    ```

    {
      "_object": "/api/response",
      "self": "https://api.flexport.com/ocean/shipment_containers/1234",
      "version": 2,
      "data": {
          "_object": "/ocean/shipment_container",
          "id": 1234,
          ...
          "shipment": {
            "_object": "/api/refs/object",
            "ref_type": "/shipment",
            "link": "https://api.flexport.com/shipments/123",
            "id": 123
          },
          "container_legs": {
              "_object": "/api/collections/paginated",
              "prev": null,
              "next": null,
              "total_count": 1,
              "data": [
                  {
                      "_object": "/ocean/shipment_container_leg",
                      "id": 11111,
                      "dates": {},
                      "shipment_container": {
                          "_object": "/api/refs/object",
                          "ref_type": "/ocean/shipment_container",
                          "link": "https://api.flexport.com/ocean/shipment_containers/289140",
                          "id": 289140
                      },
                      "leg": {
                          "_object": "/shipment_leg",
                          "id": 4501396,
                          "estimated_arrival_date": "2019-05-1T12:00:00.000+08:00",
                          "actual_arrival_date": "2019-05-1T21:52:00.000+08:00"
                          ...
                      }
                  }
              ]
          },
          ...
      }
    }

    ```


    ### `expand=shipment.ocean_shipment.containers`

    Expand out the `shipment` attribute to get a `Shipment` object instead of
    a `ObjectRef<Shipment>` object. Then, a

    `Shipment` object contains an `OceanShipmentDetail`. The
    `OceanShipmentDetail` is not stored as a ref within the

    `Shipment` object, so the full `OceanShipmentDetail` object will be
    returned and does not need to be expanded.

    However, each `OceanShipmentDetail` object contains a
    `CollectionRef<Container>`, and with this syntax that array

    of containers will be expanded out.


    You could use this expansion if you had the `id` of a container, and
    wanted to know all the other containers

    that are on the same shipment.


    ```

    curl -X GET  \
      https://api.flexport.com/ocean/shipment_containers/123?expand=shipment.ocean_shipment.containers
    ```


    ```

    {
      "_object": "/api/response",
      "self": "https://api.flexport.com/ocean/shipment_containers/123",
      "version": 2,
      "data": {
          "_object123 "/ocean/shipment_container",
          "id": 123,
          ...
          "shipment": {
            "_object": "/shipment",
            "id": 222,
            "transportation_mode": "ocean",
            ...
            "ocean_shipment": {
                "_object": "/ocean/shipment",
                ...
                "containers": {
                    "_object": "/api/collections/paginated",
                    "prev": null,
                    "next": null,
                    "total_count": 1,
                    "data": [
                        {
                            "_object": "/ocean/shipment_container",
                            "container_type": "dry",
                            ...
                        }
                    ]
                }
            }
          }
          "container_legs": {
            "_object": "/api/refs/collection",
            "ref_type": "/ocean/shipment_container_leg",
            "link": "https://api.flexport.com/ocean/shipment_container_legs?f.shipment_container.id=123"
          },
          ...
      }
    }

    ```


    ### `expand=container_legs.leg,shipment.ocean_shipment.containers`

    Multiple expansion paths can be passed to the `expand` query parameter.


    ```

    curl -X GET  \
      https://api.flexport.com/ocean/shipment_containers/123?expand=container_legs.leg,shipment.ocean_shipment.containers
    ```


    ```

    {
      "_object": "/api/response",
      "self": "https://api.flexport.com/ocean/shipment_containers/123",
      "version": 2,
      "data": {
          "_object123 "/ocean/shipment_container",
          "id": 123,
          ...
          "shipment": {
            "_object": "/shipment",
            "id": 222,
            "transportation_mode": "ocean",
            ...
            "ocean_shipment": {
                "_object": "/ocean/shipment",
                ...
                "containers": {
                    "_object": "/api/collections/paginated",
                    "prev": null,
                    "next": null,
                    "total_count": 1,
                    "data": [
                        {
                            "_object": "/ocean/shipment_container",
                            "container_type": "dry",
                            ...
                        }
                    ]
                }
            }
          }
          "container_legs": {
              "_object": "/api/collections/paginated",
              "prev": null,
              "next": null,
              "total_count": 1,
              "data": [
                  {
                      "_object": "/ocean/shipment_container_leg",
                      "id": 11111,
                      "dates": {},
                      "shipment_container": {
                          "_object": "/api/refs/object",
                          "ref_type": "/ocean/shipment_container",
                          "link": "https://api.flexport.com/ocean/shipment_containers/289140",
                          "id": 289140
                      },
                      "leg": {
                          "_object": "/shipment_leg",
                          "id": 4501396,
                          "estimated_arrival_date": "2019-05-1T12:00:00.000+08:00",
                          "actual_arrival_date": "2019-05-1T21:52:00.000+08:00"
                          ...
                      }
                  }
              ]
          },
          ...
      }
    }

    ```
- name: Versioning
  x-traitTag: true
  description: >
    Your API version has a large impact on your experience with Flexport's
    APIs. Currently, there are three

    versions available for consumption. You can see your account's current API
    version in your

    [API settings](https://app.flexport.com/account_settings/api) page.


    If you'd like to change your account's API version, please reach out to
    integration support

    (integration-support@flexport.com) for the operation.


    Your account's default API version can always be overridden by passing in
    the `Flexport-Version` header when

    making an API request.


    ## Backwards-compatible changes

    Flexport considers some changes to be non-breaking and will make those
    changes without updating the API version.

    Please follow defensive coding practices in order to ensure stability. We
    consider the following to be

    backwards-compatible changes:

    - Adding an attribute, resource, or optional parameter.

    - Adding a new possible value to an `enum` type attribute.

    - Adding new event types. (Webhook listeners will also receive new events)
- name: Errors
  x-traitTag: true
  description: >
    It may occur that we have issues in understanding or processing your
    request. Under these circumstances,

    the response will resolve with an error object (under the `error`
    attribute) providing insight on what went

    wrong.


    | Attribute | Description |

    |--------------|-----------|

    | **_object** _string_ | String representing the object’s type. Always
    `/api/error` for this object |

    | **status** _integer_ | The HTTP status code (client or server error)
    made available for consumption from the body of the response |

    | **code** _string_ | Specialized identifier for this type of error in our
    API |

    | **message** _string_ | Human readable error message |
- name: Metadata
  x-traitTag: true
  description: >
    Certain resource objects (like Shipments and Containers) have a `metadata`
    attribute in their response

    payloads. Metadata attributes are known as Tags on the user-facing side of
    the application. Metadata is useful

    for storing information on a resource that is not already captured in a
    Flexport-defined field.


    There are two types of metadata formats supported.


    The default metadata format is a key-value hash format where the keys are
    strings, and the values are an

    array of strings.


    ```

    metadata: {color: ["red", "blue"]}

    ```


    An alternate supported format is an array of key defined hashes where the
    keys are `"name"` and `"value"`.


    ```

    metadata: [{name: "color", value: ["red", "blue"]}

    ```


    The response payload for metadata will always display the default metadata
    hash format. To display the

    metadata array format, a URL parameter will need to provided called
    `use_name_value_metadata_format=true`.

    By default, this is false.
- name: Milestones
  x-traitTag: true
  description: >
    This page describes the different event types which will trigger a Event
    object to be sent to your registered Webhook Endpoints.

    Milestones designated with an asterisk are available upon request.


    Document Created and Updated Route require account-level activation by
    Flexport. Additional setup may also be needed for

    Updated Estimated Out for Delivery, Actual Out for Delivery, Loaded on
    Truck, Delivery Complete, and Flexport-generated

    Estimated Available for Pickup.


    To receive these events, contact your Flexport team to confirm
    availability and request setup, and select the relevant

    event category in your webhook settings.


    ## Estimated Transit Events

    For all Estimated Transit Events, the data field of the Event webook
    payload is a Shipment Event Data object.


    |Name|Type|Description|Resource|Location|

    |----|----|----|----|----|

    |Schedule Confirmed|`/shipment#schedule_confirmed`|Estimated departure and
    arrival dates set for each specified
    location.|[Shipment](/v2/tag/ShipmentLeg)|None|

    |Updated Estimated Time of Departure
    (ETD)*|`/shipment_leg#updated_estimated_time_of_departure`|Revised
    estimate of date when shipment will depart from specified
    location.|[ShipmentLeg](/v2/tag/ShipmentLeg)|departure location|

    |Updated Estimated Time of Arrival
    (ETA)*|`/shipment_leg#updated_estimated_time_of_arrival`|Revised estimate
    of date when shipment will arrive at specified
    location.|[ShipmentLeg](/v2/tag/ShipmentLeg)|arrival location|

    |Updated Estimated Out for
    Delivery*|`/shipment_leg#updated_estimated_out_for_delivery`|Revised
    estimate of date when shipment is out for
    delivery.|[ShipmentLeg](/v2/tag/ShipmentLeg)|departure location|

    |Updated Route (This milestone is still under
    development)*|`/shipment#updated_route`|Updated route to final
    destination, such as changes to intermediary locations or
    ports.|[Shipment](/v2/tag/Shipment)|None|

    |Updated Estimated Available for
    Pickup*|`/shipment_container_leg#updated_estimated_available_for_pickup`|Revised
    estimated of date when shipment will be ready for pickup at the port of
    delivery.|[ContainerLeg](/v2/tag/ContainerLeg)|departure location|


    ## Actual Transit Events

    For all Actual Transit Events, the data field of the Event webhook payload
    is a Shipment Event Data object.


    |Name|Type|Description|Resource|Location|

    |----|----|----|----|----|

    |Actual Time of Arrival (ATA)|`/shipment_leg#arrived`|Shipment arrived at
    specified location.|[ShipmentLeg](/v2/tag/ShipmentLeg)|arrival location|

    |Actual Time of Departure (ATD)|`/shipment_leg#departed`|Shipment departed
    from specified location.|[ShipmentLeg](/v2/tag/ShipmentLeg)|departure
    location|

    |Actual Out for Delivery*|`/shipment_leg#out_for_delivery`|Shipment
    departed and is out for
    delivery|[ShipmentLeg](/v2/tag/ShipmentLeg)|departure location|

    |Delivery Complete*|`/shipment_leg#delivery_completed`|Shipment delivery
    is complete|[ShipmentLeg](/v2/tag/ShipmentLeg)|destination location|

    |Loaded on Board*|`/ocean/shipment_container_leg#loaded_on_board`|Shipment
    container loaded on vessel or
    rail.|[ContainerLeg](/v2/tag/ContainerLeg)|where the container was loaded|

    |Loaded on Truck*|`/ocean/shipment_leg#loaded_on_truck`|Cargo has been
    transloaded from shipment container to
    truck.|[ShipmentLeg](/v2/tag/ShipmentLeg)|where the cargo was loaded on
    the truck|

    |Unloaded off
    Board*|`/ocean/shipment_container_leg#unloaded_off_board`|Shipment
    container discharged from vessel or
    rail.|[ContainerLeg](/v2/tag/ContainerLeg)|where the container was
    unloaded|

    |Arrived at Delivery Location|`/shipment_leg#delivered`|Part of a shipment
    delivered to final
    destination.|[ShipmentLeg](/v2/tag/ShipmentLeg)|delivery location|

    |Delivered in Full|`/shipment#delivered_in_full`|Entire shipment delivered
    to final destination, e.g. multi-container
    shipments.|[Shipment](/v2/tag/Shipment)|shipment final destination|


    ## Administrative Events

    For all Administrative Events, the data field of the Event webhook payload
    is a Shipment Event Data object.


    |Name|Type|Description|Resource|Location|

    |----|----|----|----|----|

    |Shipment Created|`/shipment#created`|User has confirmed Flexport quote
    and cargo is getting ready to ship.|[Shipment](/v2/tag/Shipment)|None|

    |Air Booking Confirmed*|`/shipment#booking_confirmed`|Shipment is booked
    with the air carrier.|[Shipment](/v2/tag/Shipment)|None|

    |Updated Cargo Ready Date|`/shipment#cargo_ready_date_changed`|Cargo ready
    date changed from the original cargo ready
    date.|[Shipment](/v2/tag/Shipment)|None|

    |Documents Sent to Nominated
    Broker|`/shipment#documents_sent_to_nominated_broker`|Arrival notice sent
    to client-nominated customs broker. Applicable to non-Flexport customs
    service shipments only.|[Shipment](/v2/tag/Shipment)|None|

    |Commercial Invoices
    Digitized|`/shipments#commercial_invoices_digitized`|All commercial
    invoices have been entered into the Flexport
    system|[Shipment](/v2/tag/Shipment)|None|

    |Container
    Available*|`/ocean/shipment_container_leg#available_for_pickup`|Container
    becomes available for pickup from
    port.|[ContainerLeg](/v2/tag/ContainerLeg)|location of the container|

    |Delivery Appointment
    Requested*|`/shipment_leg#delivery_appointment_requested`|Date the
    delivery appointment was
    requested.|[ShipmentLeg](/v2/tag/ShipmentLeg)|delivery location|

    |Delivery Appointment
    Scheduled|`/shipment_leg#delivery_appointment_scheduled`|Date of the
    scheduled delivery
    appointment.|[ShipmentLeg](/v2/tag/ShipmentLeg)|delivery location|

    |Filing Submitted for in Bond
    Transportation|`/shipment#filing_submitted_for_in_bond_transportation`|Date
    when the filing was submitted.|[Shipment](/v2/tag/Shipment)|None|

    |Free Time to Expire|`/ocean/shipment_container#free_time_to_expire`|Date
    when container [free
    time](https://www.flexport.com/glossary/last-free-day)
    expires.|[Container](/v2/tag/Container)|location of where the container
    will be when the container free time expires|

    |Free Time Expired|`/ocean/shipment_container#free_time_expired`|Date when
    container [free time](https://www.flexport.com/glossary/last-free-day)  expired.|[Container](/v2/tag/Container)|location
    of the container|

    |FTZ Admission|`/shipment#ftz_admission`|Date when carrier is informed
    that the posted bill has been placed on a FTZ
    admission.|[Shipment](/v2/tag/Shipment)|

    |Empty Equipment Returned|`/ocean/shipment_container#empty_returned`|Empty
    container returned to carrier.|[Container](/v2/tag/Container)|location of
    the container|

    |**[DEPRECATED] Delivery Appointment
    Scheduled**|`/shipment_container_leg#delivery_appointment_scheduled`|Date
    and time of the scheduled delivery
    appointment.|[ContainerLeg](/v2/tag/ContainerLeg)|delivery location|

    |Flight Delay: Mechanical Problem|`/shipment#flight_delay_mechanical
    `|Delay due to mechanical issue with the
    airplane.|[Shipment](/v2/tag/Shipment)|

    |Flight Delay: Schedule Updated By
    Carrier|`/shipment#flight_delay_schedule_updated_by_carrier `|Delay due to
    a flight schedule change made by the
    carrier.|[Shipment](/v2/tag/Shipment)|

    |Late Bill of Lading Release|`/shipment#late_bill_of_lading_release
    `|Delay due to late bill of lading release.|[Shipment](/v2/tag/Shipment)|

    |Missed Appointment|`/shipment#missed_appointment `|Delivery not completed
    due to missed appointment.|[Shipment](/v2/tag/Shipment)|

    |Ocean Port Dwell Delay|`/shipment#ocean_port_dwell_delay `|Delay due to
    dwell at ocean port.|[Shipment](/v2/tag/Shipment)|

    |Port Strike Delay|`/shipment#port_strike_delay `|Delay due to port
    strike.|[Shipment](/v2/tag/Shipment)|

    |Vessel Delay: Mechanical  Problem|`/shipment#vessel_delay_mechanical
    `|Delay due to mechanical issue with the
    vessel.|[Shipment](/v2/tag/Shipment)|

    |Warehouse Devan Delay|`/shipment#warehouse_devan_delay `|Delay due to
    warehouse devan.|[Shipment](/v2/tag/Shipment)|

    |(Deconsolidation WH) Schedule delay: Trucking - Pending Linehaul
    Consolidation|`/shipment#_deconsolidation_wh_schedule_delay_trucking_pending_linehaul_consolidation`|(Deconsolidation
    WH) Schedule delay: Trucking - Pending Linehaul
    Consolidation|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Client -  Pending Consignee
    Pickup|`/shipment#_destination_port_dwell_schedule_delay_client_pending_consignee_pickup`|(Destination
    Port Dwell) Schedule delay: Client -  Pending Consignee
    Pickup|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Customs - Customs
    Exam|`/shipment#_destination_port_dwell_schedule_delay_customs_customs_exam`|(Destination
    Port Dwell) Schedule delay: Customs - Customs
    Exam|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Force Majeure -  Weather
    Delay|`/shipment#_destination_port_dwell_schedule_delay_force_majeure_weather_delay`|(Destination
    Port Dwell) Schedule delay: Force Majeure -  Weather
    Delay|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Trucking - Mechanical
    Problem|`/shipment#_destination_port_dwell_schedule_delay_trucking_mechanical_problem`|(Destination
    Port Dwell) Schedule delay: Trucking - Mechanical
    Problem|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Trucking - Operational mistake
    by
    trucker|`/shipment#_destination_port_dwell_schedule_delay_trucking_operational_mistake_by_trucker`|(Destination
    Port Dwell) Schedule delay: Trucking - Operational mistake by
    trucker|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Unavailable  - Container
    Damaged|`/shipment#_destination_port_dwell_schedule_delay_unavailable_container_damaged`|(Destination
    Port Dwell) Schedule delay: Unavailable  - Container
    Damaged|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Unavailable  - Container
    physically inaccessible for
    pickup|`/shipment#_destination_port_dwell_schedule_delay_unavailable_container_physically_inaccessible_for_pickup`|(Destination
    Port Dwell) Schedule delay: Unavailable  - Container physically
    inaccessible for pickup|[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Unavailable  -  No Pickup
    Appointments Available
    |`/shipment#_destination_port_dwell_schedule_delay_unavailable_no_pickup_appointments_available`|(Destination
    Port Dwell) Schedule delay: Unavailable  -  No Pickup Appointments
    Available |[Shipment](/v2/tag/Shipment)|

    |(Destination Port Dwell) Schedule delay: Unavailable  - Unable to
    Locate|`/shipment#_destination_port_dwell_schedule_delay_unavailable_unable_to_locate`|(Destination
    Port Dwell) Schedule delay: Unavailable  - Unable to
    Locate|[Shipment](/v2/tag/Shipment)|

    |(LCL Consolidation) Schedule delay: Client - Unable to load on vessel due
    to shipper or client
    delay|`/shipment#_lcl_consolidation_schedule_delay_client_unable_to_load_on_vessel_due_to_shipper_or_client_delay`|(LCL
    Consolidation) Schedule delay: Client - Unable to load on vessel due to
    shipper or client delay|[Shipment](/v2/tag/Shipment)|

    |(Network Final Delivery) Schedule delay: Client - Warehouse
    Rescheduled|`/shipment#_network_final_delivery_schedule_delay_client_warehouse_rescheduled`|(Network
    Final Delivery) Schedule delay: Client - Warehouse
    Rescheduled|[Shipment](/v2/tag/Shipment)|

    |(Ocean Final Delivery) Schedule delay: Client - Delivery Location
    Changed|`/shipment#_ocean_final_delivery_schedule_delay_client_delivery_location_changed`|(Ocean
    Final Delivery) Schedule delay: Client - Delivery Location
    Changed|[Shipment](/v2/tag/Shipment)|

    |(Ocean Final Delivery) Schedule delay: Customs - Customs
    Exam|`/shipment#_ocean_final_delivery_schedule_delay_customs_customs_exam`|(Ocean
    Final Delivery) Schedule delay: Customs - Customs
    Exam|[Shipment](/v2/tag/Shipment)|

    |(Ocean Final Delivery) Schedule delay: Operator Mistake -
    flexGO|`/shipment#_ocean_final_delivery_schedule_delay_operator_mistake_flexgo`|(Ocean
    Final Delivery) Schedule delay: Operator Mistake -
    flexGO|[Shipment](/v2/tag/Shipment)|

    |(Ocean Final Delivery) Schedule delay: Trucking - Operational mistake by
    trucker|`/shipment#_ocean_final_delivery_schedule_delay_trucking_operational_mistake_by_trucker`|(Ocean
    Final Delivery) Schedule delay: Trucking - Operational mistake by
    trucker|[Shipment](/v2/tag/Shipment)|

    |(Ocean Origin Pickup) Schedule delay: Client - Early pickup/storage
    request  |`/shipment#_ocean_origin_pickup_schedule_delay_client_early_pickup_request`|(Ocean
    Origin Pickup) Schedule delay: Client - Early pickup/storage request  |[Shipment](/v2/tag/Shipment)|

    |(Ocean Origin Pickup) Schedule delay: Other - Please leave detailed
    reasons in
    notes|`/shipment#_ocean_origin_pickup_schedule_delay_other_please_leave_detailed_reasons_in_notes`|(Ocean
    Origin Pickup) Schedule delay: Other - Please leave detailed reasons in
    notes|[Shipment](/v2/tag/Shipment)|

    |(Ocean Origin Pickup) Schedule delay: Trucking - Operational mistake by
    trucker|`/shipment#_ocean_origin_pickup_schedule_delay_trucking_operational_mistake_by_trucker`|(Ocean
    Origin Pickup) Schedule delay: Trucking - Operational mistake by
    trucker|[Shipment](/v2/tag/Shipment)|

    |(Origin Port Dwell) Schedule delay: Carrier - Change of vessel due to
    Port
    Omit|`/shipment#_origin_port_dwell_schedule_delay_carrier_change_of_vessel_due_to_port_omit`|(Origin
    Port Dwell) Schedule delay: Carrier - Change of vessel due to Port
    Omit|[Shipment](/v2/tag/Shipment)|

    |(Origin Port Dwell) Schedule delay: Carrier - Delay in vessel
    departure|`/shipment#_origin_port_dwell_schedule_delay_carrier_delay_in_vessel_departure`|(Origin
    Port Dwell) Schedule delay: Carrier - Delay in vessel
    departure|[Shipment](/v2/tag/Shipment)|

    |(Origin Port Dwell) Schedule delay: Client - Request to hold shipment at
    origin|`/shipment#_origin_port_dwell_schedule_delay_client_request_to_hold_shipment_at_origin`|(Origin
    Port Dwell) Schedule delay: Client - Request to hold shipment at
    origin|[Shipment](/v2/tag/Shipment)|

    |(Origin Port Dwell) Schedule delay: Client - Unable to load on vessel due
    to shipper or client
    delay|`/shipment#_origin_port_dwell_schedule_delay_client_unable_to_load_on_vessel_due_to_shipper_or_client_delay`|(Origin
    Port Dwell) Schedule delay: Client - Unable to load on vessel due to
    shipper or client delay|[Shipment](/v2/tag/Shipment)|

    |(Origin Port Dwell) Schedule delay: Operator
    Mistake|`/shipment#_origin_port_dwell_schedule_delay_operator_mistake`|(Origin
    Port Dwell) Schedule delay: Operator Mistake|[Shipment](/v2/tag/Shipment)|

    |(Origin Port Dwell) Schedule delay: Trucking - Operational mistake by
    trucker|`/shipment#_origin_port_dwell_schedule_delay_trucking_operational_mistake_by_trucker`|(Origin
    Port Dwell) Schedule delay: Trucking - Operational mistake by
    trucker|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - All Documents Received from
    Shipper|`/shipment#all_documents_received_from_shipper`|FID 63495 - All
    Documents Received from Shipper|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Booking Request and Shipper Documents
    Mismatch|`/shipment#booking_request_and_shipper_documents_mismatch`|FID
    63495 - Booking Request and Shipper Documents
    Mismatch|[Shipment](/v2/tag/Shipment)|

    |Cargo Breakdown Delay|`/shipment#cargo_breakdown_delay`|Cargo Breakdown
    Delay|[Shipment](/v2/tag/Shipment)|

    |Cargo Bumped From Booked
    Flight|`/shipment#cargo_bumped_from_booked_flight`|Cargo Bumped From
    Booked Flight|[Shipment](/v2/tag/Shipment)|

    |Cargo Contamination Delay|`/shipment#cargo_contamination_delay`|Cargo
    Contamination Delay|[Shipment](/v2/tag/Shipment)|

    |Cargo Declaration Mismatch|`/shipment#cargo_declaration_mismatch`|Cargo
    Declaration Mismatch|[Shipment](/v2/tag/Shipment)|

    |Cargo Not Available|`/shipment#cargo_not_available`|Cargo Not
    Available|[Shipment](/v2/tag/Shipment)|

    |Cargo Ready Date
    Changed|`/shipment#cargo_ready_date_changed_exception`|Cargo Ready Date
    Changed|[Shipment](/v2/tag/Shipment)|

    |Cargo Ready Date Unknown|`/shipment#cargo_ready_date_unconfirmed`|Cargo
    Ready Date Unknown|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Cargo Received After
    Cutoff|`/shipment#cargo_received_after_cutoff`|FID 63495 - Cargo Received
    After Cutoff|[Shipment](/v2/tag/Shipment)|

    |Cargo Rolled from Booked
    Vessel|`/shipment#cargo_rolled_from_booked_vessel`|Cargo Rolled from
    Booked Vessel|[Shipment](/v2/tag/Shipment)|

    |Carrier Refused/Bumped DG
    Shipment|`/shipment#carrier_refused_bumped_dg_shipment`|Carrier
    Refused/Bumped DG Shipment|[Shipment](/v2/tag/Shipment)|

    |Flight Delay: Congestion at Transit
    Port|`/shipment#congestion_at_transit_port`|Flight Delay: Congestion at
    Transit Port|[Shipment](/v2/tag/Shipment)|

    |Consignee related House Bill of Lading release
    delay|`/shipment#consignee_related_house_bill_of_lading_release_delay`|Consignee
    related House Bill of Lading release delay|[Shipment](/v2/tag/Shipment)|

    |Carrier Freight Hold|`/shipment#container_carrier_hold`|Carrier Freight
    Hold|[Shipment](/v2/tag/Shipment)|

    |Container Hold: Customs|`/shipment#container_customs_hold`|Container
    Hold: Customs|[Shipment](/v2/tag/Shipment)|

    |Discharge Delay at Rail
    Yard|`/shipment#container_discharge_delay`|Discharge Delay at Rail
    Yard|[Shipment](/v2/tag/Shipment)|

    |Container Hold: Other|`/shipment#container_hold_other`|Container Hold:
    Other|[Shipment](/v2/tag/Shipment)|

    |Shipment Under Consumer Product Safety Commission (CPSC) Review - Hold
    Cargo Intact|`/shipment#cpsc_hold`|Shipment Under Consumer Product Safety
    Commission (CPSC) Review - Hold Cargo Intact|[Shipment](/v2/tag/Shipment)|

    |CPSC Hold Removed|`/shipment#cpsc_hold_removed`|CPSC Hold
    Removed|[Shipment](/v2/tag/Shipment)|

    |Shipment Under Customs Agricultural Hold - Hold Cargo
    Intact|`/shipment#customs_agriculture_hold`|Shipment Under Customs
    Agricultural Hold - Hold Cargo Intact|[Shipment](/v2/tag/Shipment)|

    |Shipment Under Customs Agricultural Exam - Hold Cargo
    Intact|`/shipment#customs_agriculture_hold_exam`|Shipment Under Customs
    Agricultural Exam - Hold Cargo Intact|[Shipment](/v2/tag/Shipment)|

    |Customs Agriculture Hold
    Removed|`/shipment#customs_agriculture_hold_removed`|Customs Agriculture
    Hold Removed|[Shipment](/v2/tag/Shipment)|

    |Release Status Change: Pending Intensive
    Exam|`/shipment#customs_entry_release_status_pending_intensive_exam`|Release
    Status Change: Pending Intensive Exam|[Shipment](/v2/tag/Shipment)|

    |Customs entry
    released|`/shipment#customs_entry_release_status_released`|Customs entry
    released|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Customs Hold: Contains Goods with Export
    Restrictions|`/shipment#customs_hold_contains_goods_with_export_restrictions`|FID
    63495 - Customs Hold: Contains Goods with Export
    Restrictions|[Shipment](/v2/tag/Shipment)|

    |Delivery Appointment
    Confirmed|`/shipment#delivery_appointment_confirmed`|Delivery Appointment
    Confirmed|[Shipment](/v2/tag/Shipment)|

    |Delivery Appointment
    Updated|`/shipment#delivery_appointment_updated`|Delivery Appointment
    Updated|[Shipment](/v2/tag/Shipment)|

    |Delivery Cancelled: Wrong Delivery
    Address|`/shipment#delivery_cancelled_wrong_delivery_address`|Delivery
    Cancelled: Wrong Delivery Address|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Delivery Delay|`/shipment#delivery_delay`|FID 63495 -
    Delivery Delay|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Delivery Location Not
    Accessible|`/shipment#delivery_location_not_accessible`|FID 63495 -
    Delivery Location Not Accessible|[Shipment](/v2/tag/Shipment)|

    |Demurrage (Storage)
    Incurred|`/shipment#demurrage_storage_incurred`|Demurrage (Storage)
    Incurred|[Shipment](/v2/tag/Shipment)|

    |Discharge Delay at Ocean
    Port|`/shipment#discharge_delay_at_ocean_port`|Discharge Delay at Ocean
    Port|[Shipment](/v2/tag/Shipment)|

    |Dry Run: Delivery Attempt Not
    Completed|`/shipment#dry_run_delivery_attempt_not_completed`|Dry Run:
    Delivery Attempt Not Completed|[Shipment](/v2/tag/Shipment)|

    |Dry Run: Delivery Location
    Closed|`/shipment#dry_run_delivery_location_closed`|Dry Run: Delivery
    Location Closed|[Shipment](/v2/tag/Shipment)|

    |Dry Run: Delivery Refused by
    Consignee|`/shipment#dry_run_delivery_refused_by_consignee`|Dry Run:
    Delivery Refused by Consignee|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Dry Run: Improper Equipment for
    Delivery|`/shipment#dry_run_improper_equipment_for_delivery`|FID 63495 -
    Dry Run: Improper Equipment for Delivery|[Shipment](/v2/tag/Shipment)|

    |Dry Run: Pick Up Not Completed|`/shipment#dry_run_pickup`|Dry Run: Pick
    Up Not Completed|[Shipment](/v2/tag/Shipment)|

    |Early Delivery Expected|`/shipment#early_delivery_expected`|Early
    Delivery Expected|[Shipment](/v2/tag/Shipment)|

    |EMEA Customs Hold Released|`/shipment#emea_customs_hold_released`|EMEA
    Customs Hold Released|[Shipment](/v2/tag/Shipment)|

    |EMEA Customs Inspection
    Released|`/shipment#emea_customs_inspection_released`|EMEA Customs
    Inspection Released|[Shipment](/v2/tag/Shipment)|

    |Empty Container Not
    Returned|`/shipment#empty_container_not_returned`|Empty Container Not
    Returned|[Shipment](/v2/tag/Shipment)|

    |Shipment Under EPA Exam - Hold Cargo
    Intact|`/shipment#epa_exam_hold_intact`|Shipment Under EPA Exam - Hold
    Cargo Intact|[Shipment](/v2/tag/Shipment)|

    |EPA May Proceed (Released)|`/shipment#epa_may_proceed`|EPA May Proceed
    (Released)|[Shipment](/v2/tag/Shipment)|

    |Shipment Under EPA Review - Hold Cargo
    Intact|`/shipment#epa_review_under_review_hold_cargo_intact`|Shipment
    Under EPA Review - Hold Cargo Intact|[Shipment](/v2/tag/Shipment)|

    |Equipment Unavailable|`/shipment#equipment_unavailable`|Equipment
    Unavailable|[Shipment](/v2/tag/Shipment)|

    |EU Other Government Agency (OGA)
    Hold|`/shipment#eu_other_government_agency_oga_hold`|EU Other Government
    Agency (OGA) Hold|[Shipment](/v2/tag/Shipment)|

    |Export Country Customs
    Exam|`/shipment#export_country_customs_exam`|Export Country Customs
    Exam|[Shipment](/v2/tag/Shipment)|

    |Export Country Magnetism
    Exam|`/shipment#export_country_magnetism_exam`|Export Country Magnetism
    Exam|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Export Customs Cleared|`/shipment#export_customs_cleared`|FID
    63495 - Export Customs Cleared|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Export Customs
    Requested|`/shipment#export_customs_requested`|FID 63495 - Export Customs
    Requested|[Shipment](/v2/tag/Shipment)|

    |Shipment Under FDA Hold - Hold Cargo
    Intact|`/shipment#fda_hold_hold_intact`|Shipment Under FDA Hold - Hold
    Cargo Intact|[Shipment](/v2/tag/Shipment)|

    |FDA May Proceed (Released)|`/shipment#fda_may_proceed`|FDA May Proceed
    (Released)|[Shipment](/v2/tag/Shipment)|

    |Shipment Under Standard FDA Review - Hold Cargo Intact (No Action
    Needed)|`/shipment#fda_review_under_review_hold_cargo_intact`|Shipment
    Under Standard FDA Review - Hold Cargo Intact (No Action
    Needed)|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Delay at
    unloading|`/shipment#fid_63495_delay_at_unloading`|FID 63495 - Delay at
    unloading|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Linehaul arrival
    late|`/shipment#fid_63495_linehaul_arrival_late`|FID 63495 - Linehaul
    arrival late|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Linehaul departure
    late|`/shipment#fid_63495_linehaul_departure_late`|FID 63495 - Linehaul
    departure late|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Pick-up delayed due to late assignment by
    TMC|`/shipment#fid_63495_pick_up_delayed_due_to_late_assignment_by_tmc`|FID
    63495 - Pick-up delayed due to late assignment by
    TMC|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Root cause
    unknown|`/shipment#fid_63495_root_cause_unknown`|FID 63495 - Root cause
    unknown|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Technical problems at LSP (at hub / consolidation
    point)|`/shipment#fid_63495_technical_problems_at_lsp_at_hub_consolidation_point_`|FID
    63495 - Technical problems at LSP (at hub / consolidation
    point)|[Shipment](/v2/tag/Shipment)|

    |Shipment Under Fish & Wildlife (FWS) Hold - Hold Cargo
    Intact|`/shipment#fish_and_wildlife_hold`|Shipment Under Fish & Wildlife
    (FWS) Hold - Hold Cargo Intact|[Shipment](/v2/tag/Shipment)|

    |Fish & Wildlife (FWS)
    Released|`/shipment#fish_and_wildlife_released`|Fish & Wildlife (FWS)
    Released|[Shipment](/v2/tag/Shipment)|

    |Flexport Booking Error|`/shipment#flexport_booking_error`|Flexport
    Booking Error|[Shipment](/v2/tag/Shipment)|

    |Flexport Documentation
    Error|`/shipment#flexport_documentation_error`|Flexport Documentation
    Error|[Shipment](/v2/tag/Shipment)|

    |Flight Delay: Mechanical
    Problem|`/shipment#flight_delay_mechanical`|Flight Delay: Mechanical
    Problem|[Shipment](/v2/tag/Shipment)|

    |Flight Delay: Schedule Updated by
    Carrier|`/shipment#flight_delay_schedule_updated_by_carrier`|Flight Delay:
    Schedule Updated by Carrier|[Shipment](/v2/tag/Shipment)|

    |Goods Damaged|`/shipment#goods_damaged`|Goods
    Damaged|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Goods Damaged at Service
    Center|`/shipment#goods_damaged_at_service_center`|FID 63495 - Goods
    Damaged at Service Center|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Goods Damaged in
    Transit|`/shipment#goods_damaged_in_transit`|FID 63495 - Goods Damaged in
    Transit|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Goods Lost in Transit|`/shipment#goods_lost_in_transit`|FID
    63495 - Goods Lost in Transit|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Goods Missing in
    Transit|`/shipment#goods_missing_in_transit`|FID 63495 - Goods Missing in
    Transit|[Shipment](/v2/tag/Shipment)|

    |US Customs Hold|`/shipment#hold_cbp`|US Customs
    Hold|[Shipment](/v2/tag/Shipment)|

    |Incomplete Shipper
    Onboarding|`/shipment#incomplete_shipper_onboarding`|Incomplete Shipper
    Onboarding|[Shipment](/v2/tag/Shipment)|

    |ISF Not on File|`/shipment#isf_not_on_file`|ISF Not on
    File|[Shipment](/v2/tag/Shipment)|

    |[DO NOT USE]Late House Bill of Lading
    Release|`/shipment#late_bill_of_lading_release`|[DO NOT USE]Late House
    Bill of Lading Release|[Shipment](/v2/tag/Shipment)|

    |LSP Prealert Issue|`/shipment#lsp_prealert_issue`|LSP Prealert
    Issue|[Shipment](/v2/tag/Shipment)|

    |US Customs Manifest Hold|`/shipment#manifest_hold_cbp`|US Customs
    Manifest Hold|[Shipment](/v2/tag/Shipment)|

    |Missed Appointment|`/shipment#missed_appointment`|Missed
    Appointment|[Shipment](/v2/tag/Shipment)|

    |Missing Cargo at Final Destination|`/shipment#missing_cargo`|Missing
    Cargo at Final Destination|[Shipment](/v2/tag/Shipment)|

    |Missing Consignee Commercial Invoice/Packing
    List|`/shipment#missing_consignee_commercial_invoice_packing_list`|Missing
    Consignee Commercial Invoice/Packing List|[Shipment](/v2/tag/Shipment)|

    |Missing Customs Documents|`/shipment#missing_customs_documents`|Missing
    Customs Documents|[Shipment](/v2/tag/Shipment)|

    |Missing Dangerous Goods (DG)
    Document|`/shipment#missing_dangerous_goods_dg_document`|Missing Dangerous
    Goods (DG) Document|[Shipment](/v2/tag/Shipment)|

    |Missing Proof of Delivery
    (POD)|`/shipment#missing_proof_of_delivery_pod_`|Missing Proof of Delivery
    (POD)|[Shipment](/v2/tag/Shipment)|

    |Name of Consignee Unclear|`/shipment#name_of_consignee_unclear`|Name of
    Consignee Unclear|[Shipment](/v2/tag/Shipment)|

    |No Delivery Appointments
    Available|`/shipment#no_appointments_available`|No Delivery Appointments
    Available|[Shipment](/v2/tag/Shipment)|

    |No Attempt Made|`/shipment#no_attempt_made`|No Attempt
    Made|[Shipment](/v2/tag/Shipment)|

    |Ocean Port Dwell Delay|`/shipment#ocean_port_dwell_delay`|Ocean Port
    Dwell Delay|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - On Hand at Destination Service
    Center|`/shipment#on_hand_at_destination_service_center`|FID 63495 - On
    Hand at Destination Service Center|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - On Hand at Hub/Consolidation Center
    Destination|`/shipment#on_hand_at_hub_consolidation_center_destination`|FID
    63495 - On Hand at Hub/Consolidation Center
    Destination|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - On Hand at Hub/Consolidation Center
    Origin|`/shipment#on_hand_at_hub_consolidation_center_origin`|FID 63495 -
    On Hand at Hub/Consolidation Center Origin|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - On Hand at Origin Service
    Center|`/shipment#on_hand_at_origin_service_center`|FID 63495 - On Hand at
    Origin Service Center|[Shipment](/v2/tag/Shipment)|

    |Other Customs Exception|`/shipment#other_customs_exception`|Other Customs
    Exception|[Shipment](/v2/tag/Shipment)|

    |Packaging Issue|`/shipment#packaging_issue`|Packaging
    Issue|[Shipment](/v2/tag/Shipment)|

    |Passed OGA Exam|`/shipment#passed_oga_exam`|Passed OGA
    exam|[Shipment](/v2/tag/Shipment)|

    |Pending Customs Clearance from Nominated
    Broker|`/shipment#pending_customs_clearance_from_nominated_broker`|Pending
    Customs Clearance from Nominated Broker|[Shipment](/v2/tag/Shipment)|

    |Pending Delivery Appointment
    Confirmation|`/shipment#pending_delivery_appointment_confirmation`|Pending
    Delivery Appointment Confirmation|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Pickup Cancelled: Cargo
    Damaged|`/shipment#pickup_cancelled_cargo_damaged`|FID 63495 - Pickup
    Cancelled: Cargo Damaged|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Pickup Cancelled: No Pickup Possible
    |`/shipment#pickup_cancelled_no_pickup_possible`|FID 63495 - Pickup
    Cancelled: No Pickup Possible |[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Pickup Cancelled: Wrong Pickup
    Address|`/shipment#pickup_cancelled_wrong_pickup_address`|FID 63495 -
    Pickup Cancelled: Wrong Pickup Address|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Pickup Delay|`/shipment#pickup_delayed`|FID 63495 - Pickup
    Delay|[Shipment](/v2/tag/Shipment)|

    |Port Strike Delay|`/shipment#port_strike_delay`|Port Strike
    Delay|[Shipment](/v2/tag/Shipment)|

    |Railcar Equipment
    Breakdown|`/shipment#rail_car_equipment_breakdown`|Railcar Equipment
    Breakdown|[Shipment](/v2/tag/Shipment)|

    |Rail Delay: Schedule Updated by
    Carrier|`/shipment#rail_delay_schedule_updated_by_carrier`|Rail Delay:
    Schedule Updated by Carrier|[Shipment](/v2/tag/Shipment)|

    |Rail Interchange Delay|`/shipment#rail_interchange_delay`|Rail
    Interchange Delay|[Shipment](/v2/tag/Shipment)|

    |Rail Transfer Delay|`/shipment#rail_transfer_delay`|Rail Transfer
    Delay|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Cargo Returned to Shipper|`/shipment#returned_to_shipper`|FID
    63495 - Cargo Returned to Shipper|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Security Delay|`/shipment#security_delay`|FID 63495 -
    Security Delay|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment Booked with
    Carrier|`/shipment#shipment_booked_with_carrier`|FID 63495 - Shipment
    Booked with Carrier|[Shipment](/v2/tag/Shipment)|

    |Shipment Cancellation
    Requested|`/shipment#shipment_cancellation_requested`|Shipment
    Cancellation Requested|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment Cancellation Requested: Post
    Pickup|`/shipment#shipment_cancellation_requested_post_pickup`|FID 63495 -
    Shipment Cancellation Requested: Post Pickup|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment Cancellation Requested: Pre
    Pickup|`/shipment#shipment_cancellation_requested_pre_pickup`|FID 63495 -
    Shipment Cancellation Requested: Pre Pickup|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment Delay: Force
    Majeure|`/shipment#shipment_delay_force_majeure`|FID 63495 - Shipment
    Delay: Force Majeure|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment Delay:
    Holiday|`/shipment#shipment_delay_holiday`|FID 63495 - Shipment Delay:
    Holiday|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment Delay: In
    Clarification|`/shipment#shipment_delay_in_clarification`|FID 63495 -
    Shipment Delay: In Clarification|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment Delay: Other
    Reasons|`/shipment#shipment_delay_other_reasons`|FID 63495 - Shipment
    Delay: Other Reasons|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Shipment On Time|`/shipment#shipment_on_time`|FID 63495 -
    Shipment On Time|[Shipment](/v2/tag/Shipment)|

    |Shipment Re-Routed by
    Carrier|`/shipment#shipment_rerouted_by_carrier`|Shipment Re-Routed by
    Carrier|[Shipment](/v2/tag/Shipment)|

    |Shipment Re-Routed per Client
    Request|`/shipment#shipment_rerouted_per_client_request`|Shipment
    Re-Routed per Client Request|[Shipment](/v2/tag/Shipment)|

    |[Ocean Planning]Carrier-Initiated Change Of Vessel / Shipment
    Roll|`/shipment#shipment_rolled_by_carrier`|[Ocean
    Planning]Carrier-Initiated Change Of Vessel / Shipment
    Roll|[Shipment](/v2/tag/Shipment)|

    |Shipment Split|`/shipment#shipment_split`|Shipment
    Split|[Shipment](/v2/tag/Shipment)|

    |Shortage/Overage of Cargo Received at Origin
    CFS|`/shipment#shortage_overage_of_cargo_received_at_origin_cfs`|Shortage/Overage
    of Cargo Received at Origin CFS|[Shipment](/v2/tag/Shipment)|

    |SLA Error/SLA Alignment|`/shipment#sla_error_sla_alignment`|SLA Error/SLA
    Alignment|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Sorting Error|`/shipment#sorting_error`|FID 63495 - Sorting
    Error|[Shipment](/v2/tag/Shipment)|

    |Export Special Handling
    Request|`/shipment#special_handling_request`|Export Special Handling
    Request|[Shipment](/v2/tag/Shipment)|

    |Shipper Late Documents|`/shipment#supplier_late_documents`|Shipper Late
    Documents|[Shipment](/v2/tag/Shipment)|

    |Supplier Late Gate-In|`/shipment#supplier_late_gate_in`|Supplier Late
    Gate-In|[Shipment](/v2/tag/Shipment)|

    |FID 63495 - Tendered To Carrier|`/shipment#tendered_to_carrier`|FID 63495
    - Tendered To Carrier|[Shipment](/v2/tag/Shipment)|

    |Terminal Departure Delay:
    Other|`/shipment#terminal_departure_delay_other`|Terminal Departure Delay:
    Other|[Shipment](/v2/tag/Shipment)|

    |Transload Delay|`/shipment#transload_delay`|Transload
    Delay|[Shipment](/v2/tag/Shipment)|

    |Transshipment Delay|`/shipment#transshipment_delay`|Transshipment
    Delay|[Shipment](/v2/tag/Shipment)|

    |Trucker Rejected|`/shipment#trucker_rejected`|Trucker
    Rejected|[Shipment](/v2/tag/Shipment)|

    |Trucker's Hours Expired|`/shipment#truckers_hours_expired`|Trucker's
    Hours Expired|[Shipment](/v2/tag/Shipment)|

    |Trucking Delay: Chassis
    Problem|`/shipment#trucking_delay_chassis_problem`|Trucking Delay: Chassis
    Problem|[Shipment](/v2/tag/Shipment)|

    |Trucking Delay: Mechanical
    Problem|`/shipment#trucking_delay_mechanical_problem`|Trucking Delay:
    Mechanical Problem|[Shipment](/v2/tag/Shipment)|

    |Trucking Delay: Other|`/shipment#trucking_delay_other`|Trucking Delay:
    Other|[Shipment](/v2/tag/Shipment)|

    |Port congestion. Shipment has been
    delayed|`/shipment#trucking_delay_port_congestion`|Port congestion.
    Shipment has been delayed|[Shipment](/v2/tag/Shipment)|

    |Trucking Delay: Strike|`/shipment#trucking_delay_strike`|Trucking Delay:
    Strike|[Shipment](/v2/tag/Shipment)|

    |Trucking Delay: Traffic|`/shipment#trucking_delay_traffic`|Trucking
    Delay: Traffic|[Shipment](/v2/tag/Shipment)|

    |Unclear/Mismatched Consignee Commercial Invoice/Packing
    List|`/shipment#unclear_mismatched_consignee_commercial_invoice_packing_list`|Unclear/Mismatched
    Consignee Commercial Invoice/Packing List|[Shipment](/v2/tag/Shipment)|

    |Undergoing CPSC|`/shipment#undergoing-cpsc`|Undergoing
    CPSC|[Shipment](/v2/tag/Shipment)|

    |Undergoing FDA Exam|`/shipment#undergoing-fda-exam`|Undergoing FDA
    Exam|[Shipment](/v2/tag/Shipment)|

    |Undergoing USDA|`/shipment#undergoing-usda`|Undergoing
    USDA|[Shipment](/v2/tag/Shipment)|

    |Undergoing OGA Exam|`/shipment#undergoing_oga_exam`|Undergoing OGA
    exam|[Shipment](/v2/tag/Shipment)|

    |Unexpected Flight Cancellation by the
    Carrier|`/shipment#unexpected_flight_cancellation_by_the_carrier`|Unexpected
    Flight Cancellation by the Carrier|[Shipment](/v2/tag/Shipment)|

    |Unknown Customs Hold Type|`/shipment#unknown_customs_hold_type`|Unknown
    Customs Hold Type|[Shipment](/v2/tag/Shipment)|

    |Vessel Delay: Mechanical
    Problem|`/shipment#vessel_delay_mechanical`|Vessel Delay: Mechanical
    Problem|[Shipment](/v2/tag/Shipment)|

    |Vessel Delay: Port
    Congestion|`/shipment#vessel_delay_port_congestion`|Vessel Delay: Port
    Congestion|[Shipment](/v2/tag/Shipment)|

    |Vessel Delay: Ocean Transit Schedule Updated by
    Carrier|`/shipment#vessel_delay_schedule_updated_by_carrier`|Vessel Delay:
    Ocean Transit Schedule Updated by Carrier|[Shipment](/v2/tag/Shipment)|

    |Warehouse Devan Delay|`/shipment#warehouse_devan_delay`|Warehouse Devan
    Delay|[Shipment](/v2/tag/Shipment)|

    |Warehouse: Other|`/shipment#warehouse_other`|Warehouse:
    Other|[Shipment](/v2/tag/Shipment)|

    |Weather delay|`/shipment#weather_delay`|Weather
    delay|[Shipment](/v2/tag/Shipment)|


    ## Invoice Events

    For all Invoice Events, the data field of the Event webhook payload is an
    Invoice Event Data object. There is no direct access from the payload to
    shipment, location, or container information like there is in a Shipment
    Event Data object.


    |Name|Type|Description|

    |----|----|----|

    |Invoice Payment Made|`/invoice#invoice_payment_made`|Invoice payment has
    been made|

    |Invoice Due Date Adjusted|`/invoice#invoice_due_date_adjusted`|Invoice
    payment due date has been adjusted|

    |Invoice Shared|`/invoice#invoice_shared`|Invoice has been shared|

    |Invoice Voided|`/invoice#invoice_voided`|Invoice has been voided|

    |Invoice Credit Applied|`/invoice#invoice_credit_applied`|Invoice credit
    has been applied|

    |Invoice Refund Applied|`/invoice#invoice_refund_applied`|Invoice refund
    has been applied|

    |Invoice Payment Failed|`/invoice#invoice_payment_failed`|Invoice payment
    failed|


    ## Document Events

    For all Document Events, the data field of the Document webhook payload is
    a Document Event Data object. Depending on what the document is connected
    to, the payload may or may not contain shipment information.


    |Name|Type|Description|

    |----|----|----|

    |Document Created*|`/document#document_created`|A document has been
    created|


    ## PurchaseOrder Events

    For all PurchaseOrder Events, the data field of the Event webhook payload
    is a PurchaseOrder Event Data object. It contains PurchaseOrder
    header-level information, as well as context that is unique to each event.

    |Name|Type|Description|

    |----|----|----|

    |PurchaseOrder Acknowledged|`/purchase_order#acknowledged`|PurchaseOrder
    has been acknowledged|

    |PurchaseOrder Updated|`/purchase_order#updated`|PurchaseOrder has been
    updated, currently only supports update through order collaboration flow|


    ## Container Load Result Events

    For all Container Load Result Events, the data field of the Event webhook
    payload is a Container Load Result Event Data object. It contains ids for
    the container load result and associated shipment for each event.

    |Name|Type|Description|

    |----|----|----|

    |Container Load Result Created|`/container_load_result#created`|Container
    Load Result has been created or updated|
- name: Terms and Conditions
  description: >
    [Click here to see the Terms & Conditions for the Flexport
    API](https://www.flexport.com/terms-and-conditions/software_visibility_terms_and_conditions/)
- name: Webhook Endpoints
  x-traitTag: true
  description: >
    Webhook endpoints can be created in your account's Settings section. They
    allow you to be notified of changes

    on your Flexport data and milestone events for your shipments.


    Some webhook events require additional setup by Flexport. Selecting an
    event category in your webhook settings does not

    activate the corresponding capability. See
    [Milestones](/v2/tag/Milestones/) for details, and contact your Flexport

    team if you need these events.


    ## Setting a Secret Token

    Set a secret token for each webhook endpoint. Flexport uses this token as
    the HMAC key to sign

    each request body. Verify the signature before accepting or processing the
    webhook.


    ## Payloads

    The payload for a webhook is an `Event` object.


    Flexport sends both of the following signature headers with each request.
    Use HMAC-SHA256 for

    new integrations and migrate existing integrations from HMAC-SHA1 to
    HMAC-SHA256.


    | Header | Algorithm | Header value format |

    |----|----|----|

    | `X-Hub-Signature-256` | HMAC-SHA256 (recommended) | `sha256=` followed
    by 64 lowercase hexadecimal characters |

    | `X-Hub-Signature` | HMAC-SHA1 (legacy) | `sha1=` followed by 40
    lowercase hexadecimal characters |


    HTTP header names are case-insensitive. Your HTTP server or framework may
    expose them as

    `x-hub-signature-256` and `x-hub-signature`. Use a case-insensitive header
    lookup or your framework's

    normalized header names. The digest is hex-encoded, not base64-encoded,
    and the algorithm prefix

    is part of the header value.


    To validate a payload using HMAC-SHA256:


    1. Read the `X-Hub-Signature-256` header. Reject the request if the header
    is missing or does not
       contain `sha256=` followed by exactly 64 lowercase hexadecimal characters.
    2. Compute the HMAC-SHA256 digest using your endpoint's secret token as
    the key and the raw request
       body bytes as the message. Do not parse and re-serialize the JSON before computing
    the digest:
       changes to whitespace, key order, or encoding will change the signature.
    3. Encode the computed digest as lowercase hexadecimal.

    4. Remove the `sha256=` prefix from the received header value and compare
    the remaining digest
       with your computed digest using a constant-time comparison. Alternatively,
    prepend `sha256=`
       to your computed hexadecimal digest and compare the complete header values
    in constant time.
    5. Accept the webhook only if the signatures match.


    For legacy HMAC-SHA1 verification, follow the same steps using
    `X-Hub-Signature`, HMAC-SHA1,

    the `sha1=` prefix, and a 40-character lowercase hexadecimal digest.


    ## Response

    Flexport expects to receive an HTTP `200` response code from your
    endpoint. We will continue trying to deliver

    the message a number of times if we don’t receive one. To prevent time
    outs, it is wise to configure your

    endpoints to send a `200` and then do any long running processing on the
    data.
- name: Document Types
  x-traitTag: true
  description: >
    Documents can be filtered by type. Below is a list of commonly used
    document types, along with their slug to use for filtering. This list is
    not comprehensive - any `document_type` that is returned from the API is a
    valid parameter for this filter.

    |Document Type|Slug|

    |----|----|

    |90-Day Inspection|90_day_inspection|

    |AEO/ISO Certification|aeo_iso_certification|

    |AFR Worksheet|afr_worksheet|

    |Air Certification for Safe
    Transport|air_certification_for_safe_transport|

    |Air Export SOP|air_export_sop|

    |Air Import SOP|air_import_sop|

    |Air Waybill|air_waybill|

    |Air Waybill Draft|air_waybill_draft|

    |Airline Security (Other Asia Air
    Carriers)|airline_security_other_asia_air_carriers|

    |AMS/ACI Worksheet|ams_aci_worksheet|

    |Animal and Plant Health Inspection Service (APHIS) Plant and Plant
    Product Declaration
    Form|animal_and_plant_health_inspection_service_aphis_plant_and_plant_product_declaration_form|

    |Anti-Corruption Compliance
    Agreement|anti_corruption_compliance_agreement|

    |Approved House Bill of Lading Draft|approved_house_bill_of_lading_draft|

    |Arrival Agent Payment|arrival_agent_payment|

    |Arrival Notice|arrival_notice|

    |Arrival Notice / Invoice|arrival_notice_invoice|

    |Articles of Incorporation|articles_of_incorporation|

    |Australia Customs Entry Form (N10)|australia_customs_entry_form_n10|

    |Australia FCL - Packing Declaration
    Candidate|australia_fcl_packing_declaration_candidate|

    |Australia - Packing Declaration|australia_packing_declaration|

    |Authority To Make Entry|authority_to_make_entry|

    |Automated Export System (AES)
    Transmission|automated_export_system_aes_transmission|

    |Bank Slip|bank_slip|

    |Battery Certification|battery_certification|

    |Bill of Lading|bill_of_lading|

    |Bill of Lading Attachment|bill_of_lading_attachment|

    |Bill of Lading Draft|bill_of_lading_draft|

    |Bill of Lading [Endorsed Original]|bill_of_lading_endorsed_original|

    |Bill of Lading [Telex Release]|bill_of_lading_telex_release|

    |Billing Packet|billing_packet|

    |Bond Package|bond_package|

    |Bond Query|bond_query|

    |Booking Form (CSV)|booking_form_csv|

    |Booking Form (PDF)|booking_form_pdf|

    |Booking Sheet|booking_sheet|

    |Broker to Broker Transportation
    Agreement|broker_to_broker_transportation_agreement|

    |Broker to Motor Carrier Agreement|broker_to_motor_carrier_agreement|

    |BSC Document|bsc_document|

    |Business License|business_license|

    |Business Registration|business_registration|

    |Canada Customs Coding Form (B3)|canada_customs_coding_form_b3|

    |Canada Customs Coding Form (B3)
    Recap|canada_customs_coding_form_b3_recap|

    |Canada Customs Release (RNS)|canada_customs_release_rns|

    |Canada eManifest Close Message|canada_emanifest_close_message|

    |Canada eManifest HBL|canada_emanifest_hbl|

    |Cargo Label|cargo_label|

    |Cargo Manifest|cargo_manifest|

    |Cargo Picture|cargo_picture|

    |Cargo Tracking Note|cargo_tracking_note|

    |Carrier Acceptance Confirmation for DG/NDG
    Declaration|carrier_acceptance_confirmation_for_dg_ndg_declaration|

    |Carrier Contract Amendment|carrier_contract_amendment|

    |Carrier Invoice|carrier_invoice|

    |Carrier invoice for origin services|carrier_invoice_for_origin_services|

    |Carrier Letter of Indemnity|carrier_letter_of_indemnity|

    |Carrier POA|carrier_poa|

    |Certificate of Analysis|certificate_of_analysis|

    |Certificate of Conformity|certificate_of_conformity|

    |Certificate of Insurance|certificate_of_insurance|

    |Certificate of Insurance (Shipment)|certificate_of_insurance_shipment|

    |Certificate of Origin|certificate_of_origin|

    |Certification for Safe Transport of Chemical Goods
    (CHINA)|certification_for_safe_transport_of_chemical_goods_china|

    |China Customs Advanced Manifest|china_customs_advanced_manifest|

    |China Import and Export Goods Declaration
    Form|china_import_and_export_goods_declaration_form|

    |Chinese Tax Invoice (Fapiao)|chinese_tax_invoice_fapiao|

    |CIQ|ciq|

    |Class 9 Receiving Checklist|class_9_receiving_checklist|

    |Client Shipment Request|client_shipment_request|

    |Co-Brokerage Agreement|co_brokerage_agreement|

    |Coloader Booking Form|coloader_booking_form|

    |Combined CI Packet|combined_ci_packet|

    |Commercial Invoice|commercial_invoice|

    |Commercial Invoice / Packing List|commercial_invoice_packing_list|

    |Company CPSC Info|company_cpsc_info|

    |Company FCC Info|company_fcc_info|

    |Company FDA Info|company_fda_info|

    |Consignment Security Declaration|consignment_security_declaration|

    |Consumer Product Safety Commission (CPSC) General Certificate of
    Conformity
    (GCC)|consumer_product_safety_commission_cpsc_general_certificate_of_conformity_gcc|

    |Container Loading Pictures|container_loading_pictures|

    |Container Loading Plan|container_loading_plan|

    |Convention on International Trade in Endangered Species of Wild Fauna and
    Flora (CITES)
    Permit|convention_on_international_trade_in_endangered_species_of_wild_fauna_and_flora_cites_permit|

    |CPSC Info|cpsc_info|

    |Credit Application|credit_application|

    |Credit Approval|credit_approval|

    |CTPAT Container Checklist|ctpat_container_checklist|

    |CUSTOMS_Billing Invoice|customs_billing_invoice|

    |Customs Billing Packet|customs_billing_packet|

    |Customs Broker Packet|customs_broker_packet|

    |Customs Clearance|customs_clearance|

    |Customs Duty|customs_duty|

    |Customs Entry Packet|customs_entry_packet|

    |Customs Entry Summary (7501)|customs_entry_summary_7501|

    |Customs Entry Summary (US 7501/EU Duty Bill
    equivalent)|customs_entry_summary_us_7501_eu_duty_bill_equivalent|

    |Customs EU T Documents Agreement|customs_eu_t_documents_agreement|

    |Customs EU T Documents Guarantee|customs_eu_t_documents_guarantee|

    |Customs FDA Document|customs_fda_document|

    |Customs Footwear Declaration|customs_footwear_declaration|

    |Customs Form 28 (CF-28) Request for
    Information|customs_form_28_cf_28_request_for_information|

    |Customs Form 29 (CF-29) Notice of
    Action|customs_form_29_cf_29_notice_of_action|

    |Customs HS7 for US Department of
    Transportation|customs_hs7_for_us_department_of_transportation|

    |Customs Lacey Declaration|customs_lacey_declaration|

    |Customs Release (3461)|customs_release_3461|

    |Customs Release (US 3461/EU SAD
    equivalent)|customs_release_us_3461_eu_sad_equivalent|

    |Customs Toxic Substance Control Act
    Declaration|customs_toxic_substance_control_act_declaration|

    |Customs US Fish and Wildlife Service Form
    3-177|customs_us_fish_and_wildlife_service_form_3_177|

    |Customs Us Ftz Entry (3461) NetChb
    Upload|customs_us_ftz_entry_3461_netchb_upload|

    |Customs Us Ftz Entry (7501) NetChb
    Upload|customs_us_ftz_entry_7501_netchb_upload|

    |Damage Photos|damage_photos|

    |Dangerous Goods Inspection
    Checklist|dangerous_goods_inspection_checklist|

    |Delivery Order (DO)|delivery_order_do|

    |Delivery SOP|delivery_sop|

    |Denied Parties Proof|denied_parties_proof|

    |Devan Report|devan_report|

    |Direct Representation|direct_representation|

    |Draft Commercial Invoice|draft_commercial_invoice|

    |Draft Commercial Invoice / Packing
    List|draft_commercial_invoice_packing_list|

    |Draft Container Loading Plan|draft_container_loading_plan|

    |Draft Dangerous Goods Declaration|draft_dangerous_goods_declaration|

    |Draft Packing List|draft_packing_list|

    |Drawback 4811|drawback_4811|

    |Drawback Application|drawback_application|

    |Drawback One Time Waiver|drawback_one_time_waiver|

    |Drawback Ruling|drawback_ruling|

    |Drawback Services Agreement|drawback_services_agreement|

    |Drawback Supporting Document|drawback_supporting_document|

    |Driver's License|driver_s_license|

    |DVIR|dvir|

    |ECTN/CTN Document|ectn_ctn_document|

    |Email Correspondence|email_correspondence|

    |Environmental Protection Agency (EPA) Form
    3540-8|environmental_protection_agency_epa_form_3540_8|

    |Environmental Protection Agency (EPA) Formaldehyde Emission Standards for
    Composite Wood
    Products|environmental_protection_agency_epa_formaldehyde_emission_standards_for_composite_wood_products|

    |EU Business Registration|eu_business_registration|

    |EU Customs Duties Bill|eu_customs_duties_bill|

    |EU Customs Export Document (EAD)|eu_customs_export_document_ead|

    |EU Customs Inspection Documents|eu_customs_inspection_documents|

    |EU Customs Release (SAD)|eu_customs_release_sad|

    |EU Declaration of Conformity|eu_declaration_of_conformity|

    |EU FLEGT License|eu_flegt_license|

    |EU Known Consignor (KC) Verification|eu_known_consignor_kc_verification|

    |EU Movement Under Bond (T1)|eu_movement_under_bond_t1|

    |EU Operator's Licence|eu_operator_s_licence|

    |EU Regulated Agent Authorization|eu_regulated_agent_authorization|

    |EU Regulated Agent (RA) Verification|eu_regulated_agent_ra_verification|

    |Evidence of Insurance|evidence_of_insurance|

    |Evidence of Insurance (Shipment)|evidence_of_insurance_shipment|

    |Exam Notice|exam_notice|

    |Export Commercial Invoice|export_commercial_invoice|

    |Export Commercial Invoice / Packing
    List|export_commercial_invoice_packing_list|

    |Export Customs Declaration|export_customs_declaration|

    |Export Customs Pre-Manifest|export_customs_pre_manifest|

    |Export Customs Release Notice|export_customs_release_notice|

    |Export License|export_license|

    |Exporter's Statement of Origin|exporter_s_statement_of_origin|

    |Fabric Detail Sheet|fabric_detail_sheet|

    |FCC Info|fcc_info|

    |FDA Info|fda_info|

    |Federal Fish and Wildlife (FWS)
    Permit|federal_fish_and_wildlife_fws_permit|

    |FERI Document|feri_document|

    |First Sale Invoice|first_sale_invoice|

    |Fiscal Representation|fiscal_representation|

    |Fish and Wildlife Service (FWS) Designated Port Exception
    Permit|fish_and_wildlife_service_fws_designated_port_exception_permit|

    |Fish and Wildlife Service (FWS) eDec Submission
    Confirmation|fish_and_wildlife_service_fws_edec_submission_confirmation|

    |Fish and Wildlife Service (FWS) Payment
    Confirmation|fish_and_wildlife_service_fws_payment_confirmation|

    |Flexport Arrival Notice|flexport_arrival_notice|

    |Flexport Bill of Lading|flexport_bill_of_lading|

    |Flexport EU Power of Attorney|flexport_eu_power_of_attorney|

    |Flexport Original Bill Of Lading|flexport_original_bill_of_lading|

    |Flexport OSRA Demurrage and Detention Invoice
    Addendum|flexport_osra_demurrage_and_detention_invoice_addendum|

    |Flexport Sailing Advisement|flexport_sailing_advisement|

    |Flexport Space Reservation|flexport_space_reservation|

    |Flexport Warehouse Manifest|flexport_warehouse_manifest|

    |Food and Drug Administration (FDA) Impact Resistance Test
    Results|food_and_drug_administration_fda_impact_resistance_test_results|

    |Food and Drug Administration (FDA) Intended Use
    Statement|food_and_drug_administration_fda_intended_use_statement|

    |Food and Drug Administration (FDA) Notice of
    Action|food_and_drug_administration_fda_notice_of_action|

    |Food and Drug Administration (FDA) Registration
    Certificate|food_and_drug_administration_fda_registration_certificate|

    |Foreign Power of Attorney|foreign_power_of_attorney|

    |Forwarder's Cargo Receipt|forwarder_s_cargo_receipt|

    |Forwarder's Certificate of Receipt|forwarder_s_certificate_of_receipt|

    |Freight Forwarder Invoice|freight_forwarder_invoice|

    |Freight Forwarder Payment|freight_forwarder_payment|

    |Freight Forwarder Quote|freight_forwarder_quote|

    |Freight Release|freight_release|

    |Fumigation Certificate|fumigation_certificate|

    |General|general|

    |General Taxpayer Certificate|general_taxpayer_certificate|

    |Haiti Hope II Visa Application|haiti_hope_ii_visa_application|

    |Handling Instructions|handling_instructions|

    |HK Account Consignor Declaration of
    Compliance|hk_account_consignor_declaration_of_compliance|

    |HK Export/Re-export Declaration Form
    2|hk_export_re_export_declaration_form_2|

    |HK Import Declaration Form 1|hk_import_declaration_form_1|

    |HK Known Consignor Declaration of
    Compliance|hk_known_consignor_declaration_of_compliance|

    |House Bill of Lading Draft|house_bill_of_lading_draft|

    |IAC KNOWN Cargo Certification|iac_known_cargo_certification|

    |IAC UNKNOWN Cargo Certification|iac_unknown_cargo_certification|

    |Import License|import_license|

    |Importer Security Filing (ISF) Entry|importer_security_filing_isf_entry|

    |Indirect Representation|indirect_representation|

    |Inland Arrival Notice|inland_arrival_notice|

    |Insurance Declination Form|insurance_declination_form|

    |Insurance Policy|insurance_policy|

    |Insurance Pre-Claim|insurance_pre_claim|

    |Insurance Review|insurance_review|

    |Interim Footwear Invoice|interim_footwear_invoice|

    |IRS Notice|irs_notice|

    |ISC Payment Receipt|isc_payment_receipt|

    |ISF Worksheet|isf_worksheet|

    |Known Shipper Management System|known_shipper_management_system|

    |KSMS Shipper Status: KNOWN|ksms_shipper_status_known|

    |KSMS Shipper Status: UNKNOWN|ksms_shipper_status_unknown|

    |Letter of Donation|letter_of_donation|

    |Letter of Indemnity (LOI)|letter_of_indemnity_loi|

    |Letter of Indemnity (LOI) for lost
    OBL|letter_of_indemnity_loi_for_lost_obl|

    |Letter of Indemnity (LOI) for non-DG|letter_of_indemnity_loi_for_non_dg|

    |Letter of Indemnity (LOI) for Telex
    release|letter_of_indemnity_loi_for_telex_release|

    |Letter of Indemnity - Return Cargo|letter_of_indemnity_return_cargo|

    |Lithium Battery Declaration|lithium_battery_declaration|

    |Lithium Battery Receiving Checklist|lithium_battery_receiving_checklist|

    |Lithium Battery Transportation
    Document|lithium_battery_transportation_document|

    |Magnetic Testing Report|magnetic_testing_report|

    |Manufacturer's Affidavit|manufacturer_s_affidavit|

    |Master Air Waybill|master_air_waybill|

    |Master Air Waybill Draft|master_air_waybill_draft|

    |Master Bill of Lading|master_bill_of_lading|

    |Master Bill of Lading Draft|master_bill_of_lading_draft|

    |Master Bill of Lading [Endorsed
    Original]|master_bill_of_lading_endorsed_original|

    |Master Bill of Lading [Telex
    Release]|master_bill_of_lading_telex_release|

    |Master House Bill of Lading|master_house_bill_of_lading|

    |Master House Bill of Lading Draft|master_house_bill_of_lading_draft|

    |Master House Bill of Lading [Endorsed
    Original]|master_house_bill_of_lading_endorsed_original|

    |Master House Bill of Lading [Telex
    Release]|master_house_bill_of_lading_telex_release|

    |Material Safety Data Sheet (MSDS)|material_safety_data_sheet_msds|

    |Medical Certification|medical_certification|

    |Message Inline Image|message_inline_image|

    |Misc Entry Document|misc_entry_document|

    |Motor Vehicle Record (MVR)|motor_vehicle_record_mvr|

    |National Highway Traffic Safety Administration (NHTSA) HS-7
    Declaration|national_highway_traffic_safety_administration_nhtsa_hs_7_declaration|

    |New Zealand FCL - Packing
    Declaration|new_zealand_fcl_packing_declaration|

    |New Zealand FCL - Packing Declaration
    Candidate|new_zealand_fcl_packing_declaration_candidate|

    |Non-Disclosure Agreement|non_disclosure_agreement|

    |Non-Flexport Power of Attorney|non_flexport_power_of_attorney|

    |NRA|nra|

    |NRA Authorization|nra_authorization|

    |Ocean Export SOP|ocean_export_sop|

    |Ocean Import SOP|ocean_import_sop|

    |Offline Booking Form (CSV)|offline_booking_form_csv|

    |Offline Booking Form (PDF)|offline_booking_form_pdf|

    |Onboarding SOP|onboarding_sop|

    |Origin cargo receipt|origin_cargo_receipt|

    |Origin Fee Invoice Provided by
    Shipper|origin_fee_invoice_provided_by_shipper|

    |Origin Warehouse Receipt|origin_warehouse_receipt|

    |Other|other|

    |Other Customs Documents|other_customs_documents|

    |Outbound Plan|outbound_plan|

    |Packing List|packing_list|

    |Partner Banking Information|partner_banking_information|

    |Partner Bill|partner_bill|

    |Partner Contact List|partner_contact_list|

    |Payment Method Terms and Conditions
    Agreement|payment_method_terms_and_conditions_agreement|

    |Permit To Transfer|permit_to_transfer|

    |Photo|photo|

    |Photo ID|photo_id|

    |Phytosanitary Certificate|phytosanitary_certificate|

    |Port Call Confirmation for AMS & ISF5
    filing|port_call_confirmation_for_ams_isf5_filing|

    |Port Exit Release|port_exit_release|

    |Power of Attorney|power_of_attorney|

    |Power of Attorney Addendum|power_of_attorney_addendum|

    |Pre-Alert|pre_alert|

    |Pre-Alert Instructions|pre_alert_instructions|

    |Pro Forma Invoice|pro_forma_invoice|

    |Product List|product_list|

    |Profile Photo|profile_photo|

    |Proof|proof|

    |Proof of Delivery (POD)|proof_of_delivery_pod|

    |Proof Of Delivery (POD) Candidate|proof_of_delivery_pod_candidate|

    |Proof of EU Port Filing|proof_of_eu_port_filing|

    |Proof of Insurance|proof_of_insurance|

    |Proof of Passthrough|proof_of_passthrough|

    |Proof of Vehicle Insurance|proof_of_vehicle_insurance|

    |Purchase Order|purchase_order|

    |Quality Control Document|quality_control_document|

    |Rated Commercial Invoice|rated_commercial_invoice|

    |Redacted Packing List|redacted_packing_list|

    |RFQ / RFP Final Bid|rfq_rfp_final_bid|

    |Sea/Air Certification for Safe
    Transport|sea_air_certification_for_safe_transport|

    |Sea Certification for Safe
    Transport|sea_certification_for_safe_transport|

    |Secondary Photo ID|secondary_photo_id|

    |Segregation Work Order|segregation_work_order|

    |Shipper Onboarding Questionnaire|shipper_onboarding_questionnaire|

    |Shipper's Bank Slip|shipper_s_bank_slip|

    |Shipper's Declaration for Dangerous
    Goods|shipper_s_declaration_for_dangerous_goods|

    |Shipper's Declaration of Dangerous
    Goods|shipper_s_declaration_of_dangerous_goods|

    |Shipper's Letter of Instructions|shipper_s_letter_of_instructions|

    |Shipper's Letter of Instructions
    (SLI)|shipper_s_letter_of_instructions_sli|

    |Shipper Security Endorsement|shipper_security_endorsement|

    |Shipping Instructions|shipping_instructions|

    |Shipping Labels|shipping_labels|

    |Shipping Order|shipping_order|

    |Social Security Card|social_security_card|

    |Strategic Commodities LOI|strategic_commodities_loi|

    |T2-Transit Accompanying Document|t2_transit_accompanying_document|

    |T86 Manifest|t86_manifest|

    |Telex Release LOI Confirmation
    Letter|telex_release_loi_confirmation_letter|

    |Temp Rel Doc For Inclusion Into Entry
    Packet|temp_rel_doc_for_inclusion_into_entry_packet|

    |Trade Advisory Services Agreement|trade_advisory_services_agreement|

    |Transaction Value Worksheet|transaction_value_worksheet|

    |Transit Paper Agreement|transit_paper_agreement|

    |Transport Document for Li Batteries (Thailand
    Only)|transport_document_for_li_batteries_thailand_only|

    |Transportation Entry and Manifest of Goods Subject to CBP Inspection and
    Permit Form
    (7512)|transportation_entry_and_manifest_of_goods_subject_to_cbp_inspection_and_permit_form_7512|

    |Transportation Worker Identification Credential
    (TWIC)|transportation_worker_identification_credential_twic|

    |Trucking Bill of Lading|trucking_bill_of_lading|

    |Trucking Invoice|trucking_invoice|

    |Trucking Payment|trucking_payment|

    |Trucking Quote|trucking_quote|

    |TSA Authorization|tsa_authorization|

    |TSA Designated Shipment ID Form|tsa_designated_shipment_id_form|

    |TSA Known Shipper Verification|tsa_known_shipper_verification|

    |TSA Shipper Verification|tsa_shipper_verification|

    |UK Customs Pre-Lodgement Advice (H2)|uk_customs_pre_lodgement_advice_h2|

    |UN 38.3|un_38_3|

    |Unclassified|unclassified|

    |Unknown|unknown|

    |Unknown Message|unknown_message|

    |Unverified Certificate of Insurance|unverified_certificate_of_insurance|

    |Uploaded By Email|uploaded_by_email|

    |US ADD Non-Reimbursement Statement|us_add_non_reimbursement_statement|

    |US Bonded Move Authorization|us_bonded_move_authorization|

    |US Customs and Border Protection (CBP) Post Summary
    Correction|us_customs_and_border_protection_cbp_post_summary_correction|

    |US Customs and Border Protection (CBP)
    Protest|us_customs_and_border_protection_cbp_protest|

    |US Customs Census Warning|us_customs_census_warning|

    |US Customs Form 4647 Notice to Mark and/or Notice to
    Redeliver|us_customs_form_4647_notice_to_mark_and_or_notice_to_redeliver|

    |US Department of Agriculture AMS NOP Import
    Certificate|us_department_of_agriculture_ams_nop_import_certificate|

    |US Department of Agriculture (USDA)
    Permit|us_department_of_agriculture_usda_permit|

    |US Department of Agriculture (USDA) Phytosanitary Certificate PPQ Form
    577|us_department_of_agriculture_usda_phytosanitary_certificate_ppq_form_577|

    |US Department of Commerce Aluminum Import Monitoring and Analysis (AIM)
    License|us_department_of_commerce_aluminum_import_monitoring_and_analysis_aim_license|

    |US Department of Commerce Steel Import Monitoring and Analysis (SIMA)
    License|us_department_of_commerce_steel_import_monitoring_and_analysis_sima_license|

    |US Goods Returned - Consignee
    Declaration|us_goods_returned_consignee_declaration|

    |US Goods Returned - Foreign Shipper
    Declaration|us_goods_returned_foreign_shipper_declaration|

    |VAT Invoice|vat_invoice|

    |VAT Package|vat_package|

    |Vehicle Registration|vehicle_registration|

    |Vendor OSRA Demurrage and Detention Invoice
    Addendum|vendor_osra_demurrage_and_detention_invoice_addendum|

    |Verified Gross Mass Declaration|verified_gross_mass_declaration|

    |Verified Gross Mass Declaration
    Excel|verified_gross_mass_declaration_excel|

    |W-9|w_9|

    |Warehouse Instructions Receipt|warehouse_instructions_receipt|

    |Warehouse Packaging Slip|warehouse_packaging_slip|

    |Warehouse Payment|warehouse_payment|

    |Warehouse Receipt|warehouse_receipt|

    |Warehouse Release|warehouse_release|

    |Warehouse Shipping Order|warehouse_shipping_order|

    |Witness Photo ID|witness_photo_id|
- name: BookingAmendment
  description: >-
    Endpoints relating to BookingAmendment objects. An existing booking is
    required to create booking amendments for.
- name: BookingLineItem
  description: >-
    Endpoints relating to BookingLineItem objects. **The Booking Line Item
    endpoints need special permission to access. Please contact
      your Flexport Sales representative if you are interested in using these endpoints.**
- name: Booking
  description: Endpoints relating to Booking objects
- name: Commercial Invoices
  description: Endpoints relating to Commercial Invoice objects
- name: Customs Entries
  description: Endpoints relating to Customs Entry objects
- name: Document
  description: Endpoints relating to Document objects
- name: Event
  description: Endpoints relating to Event objects
- name: Invoices
  description: Endpoints relating to Invoice objects
- name: Company
  description: Endpoints relating to Company objects
- name: CompanyEntity
  description: Endpoints relating to CompanyEntity objects
- name: Contact
  description: Endpoints relating to Contact objects
- name: Location
  description: Endpoints relating to Location objects
- name: ContainerLeg
  description: Endpoints relating to ContainerLeg objects
- name: Container
  description: Endpoints relating to Container objects
- name: ContainerLoadResult
  description: >-
    Endpoints relating to ContainerLoadResult objects. A container load result
    is a digitization of the packing list(s) on a shipment that has been
    validated against your purchase orders. **The ContainerLoadResult
    endpoints need special permission to access. Please contact your Flexport
    Sales representative if you are interested in using these endpoints.**
- name: Ports
  description: Endpoints relating to Ports objects
- name: Product
  description: Endpoints relating to Product objects
- name: PurchaseOrderLineItem
  description: >-
    Endpoints relating to PurchaseOrderLineItem objects. **The Purchase Order
    Line Item endpoints need special permission to access. Please contact your
    Flexport Sales representative if you are interested in using these
    endpoints.**
- name: PurchaseOrder
  description: >-
    Endpoints relating to PurchaseOrder objects. **The Purchase Order
    endpoints need special permission to access. Please contact your Flexport
    Sales representative if you are interested in using these endpoints.**
- name: ShipmentLeg
  description: Endpoints relating to ShipmentLeg objects
- name: Shipment
  description: Endpoints relating to Shipment objects
- name: ShipmentShareable
  description: >-
    Returns a list of shipments status shareable url.<br><br> **The
    ShipmentShareable POST endpoint needs special permission to access. Please
    contact your Flexport Sales representative if you are interested in using
    this endpoint.**
x-tagGroups:
- name: General
  tags:
  - Authentication
  - Response Semantics
  - Pagination
  - Expansion
  - Versioning
  - Errors
  - Metadata
  - Webhook Endpoints
  - Terms and Conditions
  - Changelog
- name: Webhooks
  tags:
  - Milestones
  - Event
- name: Shipment Status
  tags:
  - Container
  - ContainerLeg
  - Shipment
  - ShipmentLeg
  - ShipmentShareable
- name: Purchase Orders
  tags:
  - PurchaseOrderLineItem
  - PurchaseOrder
  - ContainerLoadResult
- name: Booking
  tags:
  - BookingAmendment
  - BookingLineItem
  - Booking
- name: Customs
  tags:
  - Commercial Invoices
  - Customs Entries
- name: Invoices
  tags:
  - Invoices
- name: Products
  tags:
  - Product
- name: Network
  tags:
  - Company
  - CompanyEntity
  - Contact
  - Location
- name: Ports
  tags:
  - Ports
- name: Documents
  tags:
  - Document Types
  - Document
paths:
  /booking_amendments:
    post:
      tags:
      - BookingAmendment
      operationId: booking_amendment_create
      summary: Create a new booking amendment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBookingAmendment'
            example:
              booking_id: 12345
              new_name: Valentine's Day - 2020
              amendment_note: >-
                This is an amendment note with useful context to changes made to
                the booking.
              new_container_counts:
                twenty_ft: 2
                forty_ft: 3
                forty_ft_hc: 4
                forty_five_ft_hc: 5
              new_wants_pickup_service: false
              new_wants_import_customs_service: false
              new_origin_address_ref: warehouse_cn
              new_origin_port_loc_code: CNSZP
              new_cargo_ready_date: '2019-06-30'
              new_delivery_date: '2019-07-31'
              new_cargo:
                volume:
                  value: 472.62
                  unit: cbm
                weight:
                  value: 2300.4
                  unit: kg
                marks_and_numbers: Fragile
                shipping_units:
                - name: Watches
                  volume:
                    value: 472.62
                    unit: cbm
                  weight:
                    value: 2300.4
                    unit: kg
                  height:
                    value: 472.62
                    unit: cm
                  length:
                    value: 472.62
                    unit: cm
                  width:
                    value: 472.62
                    unit: cm
                  count: 9
                  atomic_count: 9
                  unit_type: carton
                contains_hazmat: true
                contains_magnets: true
                contains_other_dangerous_goods: true
                contains_li_ion: true
                contains_non_li_ion_battery: true
                lithium_batteries_packing_types:
                - packed_loose
              new_metadata:
                PO:
                - '12345'
                SKU:
                - abc123
      responses:
        '200':
          description: The created booking amendment
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/booking_amendments
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/BookingAmendment'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    version: 2
                    data:
                      _object: /booking_amendment
                      id: 2983
                      booking_id: 12345
                      is_pending: false
                      new_name: Valentine's Day - 2020
                      new_container_counts:
                        twenty_ft: 2
                        forty_ft: 3
                        forty_ft_hc: 4
                        forty_five_ft_hc: 5
                      new_wants_pickup_service: false
                      new_wants_import_customs_service: false
                      new_origin_address:
                        _object: /address
                        street_address: 123 Queen St
                        street_address2:
                        city: Shanghai
                        state:
                        country: China
                        country_code: CN
                        zip:
                        unlocode: CNSHA
                        timezone: China/Shanghai
                        ref: my-shanghai-address-ref
                      new_port_of_loading:
                        _object: /address
                        street_address: 123 Queen St
                        street_address2:
                        city: Shanghai
                        state:
                        country: China
                        country_code: CN
                        zip:
                        unlocode: CNSHA
                        timezone: China/Shanghai
                        ref: my-shanghai-address-ref
                      new_port_of_unloading:
                        _object: /address
                        street_address: 10000 West O'Hare Ave
                        street_address2: PO Box 66142
                        city: Chicago
                        state: IL
                        country: United States of America
                        country_code: US
                        zip: '60666'
                        unlocode: US AL2
                        timezone: America/Chicago
                        ref: my-chicago-ref
                      new_cargo_ready_date: '2019-06-30'
                      new_delivery_date: '2019-07-31'
                      new_cargo:
                        volume:
                          value: 472.62
                          unit: cbm
                        weight:
                          value: 2300.4
                          unit: kg
                        marks_and_numbers: Fragile
                        shipping_units:
                        - name: Watches
                          volume:
                            value: 472.62
                            unit: cbm
                          weight:
                            value: 2300.4
                            unit: kg
                          height:
                            value: 472.62
                            unit: cm
                          length:
                            value: 472.62
                            unit: cm
                          width:
                            value: 472.62
                            unit: cm
                          count: 9
                          atomic_count: 9
                          unit_type: carton
                        contains_hazmat: true
                        contains_magnets: true
                        contains_other_dangerous_goods: true
                        contains_li_ion: true
                        contains_non_li_ion_battery: true
                        lithium_batteries_packing_types:
                        - packed_loose
                      new_metadata:
                        PO:
                        - '12345'
                        SKU:
                        - abc123
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/booking_amendments
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /booking_line_items:
    get:
      tags:
      - BookingLineItem
      operationId: booking_line_item_index
      summary: List all booking line items
      description: Returns a list of booking line items linked to submitted bookings
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: direction
        description: Set sort order. Allows "asc" (ascending) or "desc"  (descending)
        required: false
        schema:
          type: string
          default: desc
          enum:
          - asc
          - desc
      - in: query
        name: f.purchase_order.id
        description: Filters for all booking line items from a purchase order
        required: false
        schema:
          type: integer
          example: 123
      - in: query
        name: f.booking.id
        description: Filters for all booking line items from a specific booking
        required: false
        schema:
          type: integer
          example: 54321
      - in: query
        name: f.purchase_order_line_item.id
        description: >-
          Filters for all booking line items from a specific purchase order
          line item.
        required: false
        schema:
          type: integer
          example: 54321
      responses:
        '200':
          description: collection of booking line items
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/booking_line_items
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/booking_line_items?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/booking_line_items?page=3&per=10
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/BookingLineItem'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/booking_line_items?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: >-
                        https://api.flexport.com/booking_line_items?page=12&per=10
                      next:
                      data:
                      - _object: /purchase_orders/booking_line_item
                        id: 123456
                        booking:
                          _object: /api/refs/object
                          ref_type: /booking
                          link: https://api.flexport.com/bookings/9876
                          id: 9876
                        purchase_order_line_item:
                          _object: /api/refs/object
                          ref_type: /purchase_orders/line_item
                          link: >-
                            https://api.flexport.com/purchase_order_line_items/112358
                          id: 112358
                        units: 200
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/booking_line_items
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - BookingLineItem
      operationId: booking_line_item_create
      summary: Create a booking line item
      description: >
        Creates and returns a booking line item.


        ## Errors

        When a request fails validation, the API returns a `400` with an `error`
        object. `error.code` is `invalid_param` for malformed/invalid input or
        `bad_request` for business-rule violations, and `error.message`
        describes the specific problem. The table below lists the errors you may
        encounter, their cause, and how to resolve them.


        | Error message | Code | Cause | Suggested fix |

        |---------------|------|-------|---------------|

        | `Null values are not allowed for property booking_id` |
        `invalid_param` | `booking_id` was sent as `null` or omitted from the
        request body. | Provide a non-null integer `booking_id` in the request.
        |

        | `Either units or decimal_units must be set` | `invalid_param` |
        Neither `units` nor `decimal_units` was provided, or both were provided
        simultaneously. | Provide exactly one of `units` (integer) or
        `decimal_units` (decimal string), not both and not neither. |

        | `Missing property units` | `invalid_param` | `units` was not provided
        and the `decimal_units` feature is not enabled for your account. |
        Include `units` as a positive integer in the request. |

        | `booking could not be found` | `bad_request` | The `booking_id` does
        not resolve to a booking accessible by the authenticated account. |
        Verify the `booking_id` belongs to a booking in your account. |

        | `Cannot create booking line items for a draft booking` | `bad_request`
        | The referenced booking is in DRAFT stage and has not been submitted. |
        Submit the booking first before attaching line items. |

        | `the po line item could not be found` | `bad_request` | The
        `purchase_order_line_item_id` does not resolve to an accessible PO line
        item. | Verify the `purchase_order_line_item_id` exists and belongs to a
        PO in your account. |

        | `Could not find the specified shipment` | `bad_request` | The
        booking's associated shipment is not accessible to the authenticated
        user. | Ensure your account has access to the booking's associated
        shipment. |

        | `decimal_units Units of measure '<uom>' does not support decimal
        values` | `bad_request` | The PO line item's unit of measure only
        supports whole-number quantities but a decimal value was supplied. |
        Provide a whole number for `decimal_units`/`units` for unit-of-measure
        types that do not support fractions. |
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBookingLineItem'
            example:
              purchase_order_line_item_id: 112358
              booking_id: 9876
              units: 200
      responses:
        '200':
          description: The created booking line item
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/invoices
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/BookingLineItem'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/booking_line_items/123456
                    version: 2
                    data:
                      _object: /purchase_orders/booking_line_item
                      id: 123456
                      booking:
                        _object: /api/refs/object
                        ref_type: /booking
                        link: https://api.flexport.com/bookings/9876
                        id: 9876
                      purchase_order_line_item:
                        _object: /api/refs/object
                        ref_type: /purchase_orders/line_item
                        link: >-
                          https://api.flexport.com/purchase_order_line_items/112358
                        id: 112358
                      units: 200
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/booking_line_items
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /booking_line_items/{id}:
    get:
      tags:
      - BookingLineItem
      operationId: booking_line_item_show
      summary: Retrieves the details of a single booking line item.
      description: Returns a list of booking line items
      parameters:
      - in: path
        name: id
        description: The unique id for the booking line item to be retrieved
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: A collection of booking line items
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/booking_line_items/123456
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/BookingLineItem'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/booking_line_items/123456
                    version: 2
                    data:
                      _object: /purchase_orders/booking_line_item
                      id: 123456
                      booking:
                        _object: /api/refs/object
                        ref_type: /booking
                        link: https://api.flexport.com/bookings/9876
                        id: 9876
                      purchase_order_line_item:
                        _object: /api/refs/object
                        ref_type: /purchase_orders/line_item
                        link: >-
                          https://api.flexport.com/purchase_order_line_items/112358
                        id: 112358
                      units: 200
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/booking_line_items/123456
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /bookings:
    get:
      tags:
      - Booking
      operationId: bookings_index
      summary: List all bookings
      description: Returns a list of bookings.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: >-
          Count of items in each page. Should be between 1 and 100
          (inclusive).
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: sort
        description: Sort results by the specified field.
        required: false
        schema:
          type: string
          enum:
          - cargo_ready_date
          - created_at
      - in: query
        name: direction
        description: Set sort order. Allows "asc"(ascending) or "desc" (descending).
        required: false
        schema:
          type: string
          default: desc
          enum:
          - asc
          - desc
      - in: query
        name: f.status
        description: Filter the list based on status of the booking
        required: false
        schema:
          type: string
          enum:
          - booked
          - submitted
      - in: query
        name: f.shipment.id
        description: Filter by the shipment resulting from the booking
        required: false
        schema:
          type: integer
          example: 123456
      - in: query
        name: f.consignee_entity_ref
        description: Filters the list based on the booking's consignee
        required: false
        schema:
          type: string
          example: amazon-us
      - in: query
        name: f.shipper_entity_ref
        description: Filters the list based on the booking's shipper
        required: false
        schema:
          type: string
          example: amazon-us
      - in: query
        name: f.name
        required: false
        schema:
          type: string
      - in: query
        name: f.cargo_ready_date
        description: Filters the list for bookings with the specified cargo ready
          date
        required: false
        schema:
          type: string
      - in: query
        name: f.cargo_ready_date.gt
        description: >-
          Filters the list for bookings with cargo ready date after the
          specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.cargo_ready_date.gte
        description: >-
          Filters the list for bookings with cargo ready date after the
          specified date, inclusive
        required: false
        schema:
          type: string
      - in: query
        name: f.cargo_ready_date.lt
        description: >-
          Filters the list for bookings with cargo ready date before the
          specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.cargo_ready_date.lte
        description: >-
          Filters the list for bookings with cargo ready date before the
          specified date, inclusive
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at
        description: Filters the list for bookings with the specified created_at
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.gt
        description: Filters the list for bookings created after the specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.gte
        description: >-
          Filters the list for bookings created after the specified date,
          inclusive
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.lt
        description: Filters the list for bookings created before the specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.lte
        description: >-
          Filters the list for bookings created before the specified date,
          inclusive
        required: false
        schema:
          type: string
      - in: query
        name: f.updated_at
        description: Filters the list for bookings with the specified updated_at
        required: false
        schema:
          type: string
      - in: query
        name: f.updated_at.gt
        description: Filters the list for bookings updated after the specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.updated_at.gte
        description: >-
          Filters the list for bookings updated after the specified date,
          inclusive
        required: false
        schema:
          type: string
      - in: query
        name: f.updated_at.lt
        description: Filters the list for bookings updated before the specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.updated_at.lte
        description: >-
          Filters the list for bookings updated before the specified date,
          inclusive
        required: false
        schema:
          type: string
      - in: query
        name: f.metadata.YOUR_METADATA_KEY
        description: >
          Filters the list for bookings that have a specific metadata
          key-value pair. Multiple metadata filters can be added to a single
          query. If there are multiple metadata filters each with the same
          metadata key, then the filter will return bookings matching any of
          the specified metadata values for that metadata key. Note that keys
          must be URL encoded; e.g.: `f.metadata.PO #=123` is invalid. It
          should instead be `f.metadata.PO%20%23`
        required: false
        schema:
          type: string
      responses:
        '200':
          description: collection of bookings
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/bookings
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/bookings?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/bookings?page=3&per=10
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Booking'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/bookings?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/bookings?page=12&per=10
                      next:
                      data:
                      - _object: /booking
                        id: 123
                        name: PO 123
                        shipper_entity:
                          _object: /company_entity
                          id: 9281
                          name: Zoomit V2
                          ref: zoomit-us
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: USAL2
                            timezone: America/Los_Angeles
                            ref: my-address-ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: GB
                            number: GB 123746396
                        consignee_entity:
                          _object: /company_entity
                          id: 9281
                          name: Zoomit
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: USAL2
                            timezone: America/Los_Angeles
                            ref: my-address-ref
                          ref: zoomit_ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 123746396
                        notify_party:
                        ocean_booking:
                          _object: /ocean/booking
                          is_lcl: false
                          incoterm: FOB
                          container_counts:
                            twenty_ft: 2
                            forty_ft: 3
                            forty_ft_hc: 4
                            forty_five_ft_hc: 5
                          product_descriptions:
                          - description: Watches
                            hs_code:
                              _object: /hs_code
                              description:
                              code: '9101.00'
                              country_code: US
                            description_for_export_customs: "\u624B\u8868"
                            description_for_export_customs_locale: zh_CN
                          origin_port:
                            _object: /place
                            name: Shenzhen, China
                            address:
                              _object: /address
                              street_address: 123 Queen St
                              street_address2:
                              city: Shanghai
                              state:
                              country: China
                              country_code: CN
                              zip:
                              unlocode: CNSZP
                              timezone: America/Los_Angeles
                              ref:
                            details:
                            - _object: /trucking/port
                              port_code: '57035'
                            - _object: /ocean/port
                              port_code: '57035'
                          destination_port:
                            _object: /place
                            name: Long Beach, Los Angeles, California
                            address:
                              _object: /address
                              street_address: 123 Queen St
                              street_address2:
                              city: Los Angeles
                              state:
                              country: United States
                              country_code: US
                              zip:
                              unlocode: USLA
                              timezone: America/Los_Angeles
                              ref:
                            details:
                            - _object: /trucking/port
                              port_code: '2704'
                            - _object: /ocean/port
                              port_code: '2704'
                          wants_pickup_service: false
                          wants_delivery_service: false
                        cargo_ready_date: '2019-06-30'
                        delivery_date: '2019-07-31'
                        wants_export_customs_service: true
                        wants_import_customs_service: true
                        cargo:
                          volume:
                            _object: /quantity/volume
                            value: 472.62
                            unit: cbm
                          weight:
                            _object: /quantity/weight
                            value: 2300.4
                            unit: kg
                          marks_and_numbers: Fragile
                          shipping_units:
                          - name: Watches
                            volume:
                              _object: /quantity/volume
                              value: 472.62
                              unit: cbm
                            weight:
                              _object: /quantity/weight
                              value: 2300.4
                              unit: kg
                            height:
                              _object: /quantity/length
                              value: 472.62
                              unit: cm
                            length:
                              _object: /quantity/length
                              value: 472.62
                              unit: cm
                            width:
                              _object: /quantity/length
                              value: 472.62
                              unit: cm
                            count: 9
                            atomic_count: 9
                            unit_type: carton
                          contains_hazmat: true
                          contains_magnets: true
                          contains_other_dangerous_goods: true
                          contains_li_ion: true
                          contains_non_li_ion_battery: true
                          lithium_batteries_packing_types:
                          - packed_loose
                        special_instructions: Handle carefully
                        created_at: '2019-04-01T18:44:34.098Z'
                        updated_at: '2019-04-01T18:44:34.098Z'
                        metadata:
                          purchase_order:
                          - '12345'
                          sku:
                          - abc123
                        quote_status: accepted_quote
                        user_email: john@example.com
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/bookings
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - Booking
      operationId: booking_create
      summary: Create and return a booking
      description: >
        Create and return a booking.


        ## Errors

        When a request fails validation, the API returns a `400` with an `error`
        object. `error.code` is `invalid_param` for malformed/invalid input or
        `bad_request` for business-rule violations, and `error.message`
        describes the specific problem. The table below lists the errors you may
        encounter, their cause, and how to resolve them.


        | Error message | Code | Cause | Suggested fix |

        |---------------|------|-------|---------------|

        | `<field>_ref does not exist in your network` (e.g. shipper_entity_ref,
        consignee_entity_ref) | `invalid_param` | The company entity ref does
        not resolve to an entity in your network. | Use an entity `ref` that
        exists in your Network and is visible to your account. |

        | `origin_address_ref does not exist in your network` /
        `destination_address_ref does not exist in your network` |
        `invalid_param` | The address/location ref is not a valid location in
        your network. | Use a location `ref` that exists in your Network (create
        it first if needed). |

        | `Missing property <field>` | `invalid_param` | A required field is
        absent from the request body (e.g. `name`, `consignee_entity_ref`,
        `wants_pickup_service`, `product_descriptions`). | Include all required
        fields in the request. |

        | `Null values are not allowed for property <field>` | `invalid_param` |
        A required field was sent as `null`. | Provide a non-null value for the
        field. |

        | `Unknown attribute(s): <name>` (e.g. `origin_port`) | `invalid_param`
        | The request used a field name the API does not recognize. | Use the
        documented field names (e.g. `origin_port_loc_code` /
        `origin_port_us_cbp_port_code`), not custom names. |

        | `Container count is required for ocean FCL shipments` | `bad_request`
        | An ocean FCL booking (`is_lcl: false`) was submitted without container
        counts. | Provide `container_counts` (e.g. `forty_ft: 1`) for FCL ocean
        bookings. |

        | `No port found for port_of_loading` / `No port found for
        port_of_unloading` | `invalid_param` | The supplied port code does not
        match a known port. | Use a valid UN/LOCODE or US CBP port code for the
        port. |

        | `Only one code can be specified for a port` | `invalid_param` | Both a
        LOCODE and a US CBP code were sent for the same port. | Specify exactly
        one port code per port. |

        | `Invalid HS code` / `Invalid HS code - Must be a string` |
        `invalid_param` | A `product_descriptions[].hs_code` is unrecognized or
        not a string. | Provide a valid HS code as a string (e.g. `"9403.60"`).
        |

        | `Invalid enum value provided for: incoterm` | `invalid_param` | The
        `incoterm` is not one of the accepted values. | Use a valid incoterm
        (EXW, FOB, FAS, FCA, CPT, CFR, CIF, CIP, DAT, DAP, DDP, DPU). |

        | `Invalid payment_terms <value>; expected one of prepaid,collect` |
        `invalid_param` | The trucking `payment_terms` value is invalid. | Use
        `prepaid` or `collect`. |

        | `For these values of pickup and delivery service <location(s)> is/are
        required` | `bad_request` | The pickup/delivery selection requires
        origin/destination address or port that was not provided. | Provide the
        required origin/destination address and port for your pickup/delivery
        selection. |

        | `shipping_unit must be provided` | `invalid_param` | Cargo has no
        shipping units. | Include at least one shipping unit in
        `cargo.shipping_units`. |

        | `Count and atomic count should be equal for unit type of <type>` |
        `bad_request` | For non-pallet units, `count` does not equal
        `atomic_count`. | Set `count` equal to `atomic_count` for non-pallet
        unit types. |

        | `With incoterms <X> the <role> must be a Flexport client` |
        `bad_request` | The paying party (per incoterm) is not a Flexport
        client. | Ensure the incoterm-designated paying party is a Flexport
        client, or contact your Flexport team. |
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBooking'
            example:
              name: PO 123
              shipper_entity_ref: zoomit-us
              consignee_entity_ref: zoomit_ref
              notify_party:
              ocean_booking:
                is_lcl: false
                incoterm: FOB
                container_counts:
                  twenty_ft: 2
                  forty_ft: 3
                  forty_ft_hc: 4
                  forty_five_ft_hc: 5
                product_descriptions:
                - description: Watches
                  hs_code: '9101.00'
                  description_for_export_customs: "\u624B\u8868"
                  description_for_export_customs_locale: zh_CN
                wants_pickup_service: false
                wants_delivery_service: false
              origin_address_ref: id-274346
              destination_address_ref: my-albany-ref
              cargo_ready_date: '2019-06-30'
              delivery_date: '2019-07-31'
              wants_export_customs_service: true
              cargo:
                volume:
                  _object: /quantity/volume
                  value: 472.62
                  unit: cbm
                weight:
                  _object: /quantity/weight
                  value: 2300.4
                  unit: kg
                marks_and_numbers: Fragile
                shipping_units:
                - name: Watches
                  volume:
                    _object: /quantity/volume
                    value: 472.62
                    unit: cbm
                  weight:
                    _object: /quantity/weight
                    value: 2300.4
                    unit: kg
                  height:
                    _object: /quantity/length
                    value: 472.62
                    unit: cm
                  length:
                    _object: /quantity/length
                    value: 472.62
                    unit: cm
                  width:
                    _object: /quantity/length
                    value: 472.62
                    unit: cm
                  count: 9
                  atomic_count: 9
                  unit_type: carton
                contains_hazmat: true
                contains_magnets: true
                contains_other_dangerous_goods: true
                contains_li_ion: true
                contains_non_li_ion_battery: true
                lithium_batteries_packing_types:
                - packed_loose
              special_instructions: Handle carefully
              metadata:
                purchase_order:
                - '12345'
                sku:
                - abc123
              user_email: john@example.com
      responses:
        '200':
          description: The created booking
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/bookings
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Booking'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/bookings
                    version: 2
                    data:
                      id: 2983
                      _object: /booking
                      name: PO 123
                      shipper_entity:
                        _object: /company_entity
                        id: 9281
                        name: My Manufacturer
                        ref: manufacturer_1
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      consignee_entity:
                        _object: /company_entity
                        id: 9281
                        name: Zoomit
                        ref: self
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      notify_party:
                      transportation_mode: ocean
                      ocean_booking:
                        _object: /ocean/booking
                        is_lcl: false
                        container_counts:
                          _object: /container_counts
                          twenty_ft: 2
                          forty_ft: 3
                          forty_ft_hc: 4
                          forty_five_ft_hc: 5
                        incoterm: FOB
                        wants_pick_up_service: false
                        wants_delivery_service: false
                        origin_port:
                          _object: /place
                          name: Shenzhen, China
                          address:
                            _object: /address
                            street_address: 123 Queen St
                            street_address2:
                            city: Shanghai
                            state:
                            country: China
                            country_code: CN
                            zip:
                            unlocode: CNSZP
                            timezone: America/Los_Angeles
                            ref: shanghai-ref
                          details:
                          - _object: /trucking/port
                            port_code: '57035'
                          - _object: /ocean/port
                            port_code: '57035'
                        destination_port:
                          _object: /place
                          name: Long Beach, Los Angeles, California
                          address:
                            _object: /address
                            street_address: 123 Queen St
                            street_address2:
                            city: Los Angeles
                            state:
                            country: United States
                            country_code: US
                            zip:
                            unlocode: USLA
                            timezone: America/Los_Angeles
                            ref: la-address-ref
                          details:
                          - _object: /trucking/port
                            port_code: '2704'
                          - _object: /ocean/port
                            port_code: '2704'
                        product_descriptions:
                        - _object: /bookings/product_descriptions
                          description: Watches
                          description_for_export_customs: "\u624B\u8868"
                          description_for_export_customs_locale: zh_CN
                          hs_code:
                            _object: /hs_code
                            description: >-
                              N-Butyl-2,2,6,6-tetramethylpiperidin-4-amine
                              (CAS No. 36177-92-1) (provided for in subheading
                              2933.39.91)
                            code: '9101.00'
                            country_code: US
                      air_booking:
                      trucking_booking:
                      origin_address:
                        _object: /address
                        street_address: 1641 Settlers Lane
                        street_address2: STE 2918
                        city: Albany
                        state: MN
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: US AL2
                        timezone: America/Los_Angeles
                        ref: warehouse_cn
                      cargo_ready_date: '2019-05-30'
                      destination_address:
                        _object: /address
                        street_address: 325 Balboa St
                        street_address2: Apt 6
                        city: San Francisco
                        state: CA
                        country: United States of America
                        country_code: US
                        zip: '94113'
                        unlocode: US SF3
                        timezone: America/Los_Angeles
                        ref: warehouse_us
                      delivery_date: '2019-05-30'
                      wants_export_customs_service: true
                      wants_import_customs_service: true
                      cargo:
                        volume:
                          _object: /quantity/volume
                          value: 472.62
                          unit: cbm
                        weight:
                          _object: /quantity/weight
                          value: 2300.4
                          unit: kg
                        marks_and_numbers: Fragile
                        shipping_units:
                        - name: Watches
                          volume:
                            _object: /quantity/volume
                            value: 472.62
                            unit: cbm
                          weight:
                            _object: /quantity/weight
                            value: 2300.4
                            unit: kg
                          height:
                            _object: /quantity/length
                            value: 472.62
                            unit: cm
                          length:
                            _object: /quantity/length
                            value: 472.62
                            unit: cm
                          width:
                            _object: /quantity/length
                            value: 472.62
                            unit: cm
                          count: 9
                          atomic_count: 9
                          unit_type: carton
                        contains_hazmat: true
                        contains_magnets: true
                        contains_other_dangerous_goods: true
                        contains_li_ion: true
                        contains_non_li_ion_battery: true
                        lithium_batteries_packing_types:
                        - packed_loose
                      special_instructions: Handle carefully
                      metadata:
                        purchase_order:
                        - '12345'
                        sku:
                        - abc123
                      created_at: '2019-04-01T18:44:34.098Z'
                      quote_status:
                      user_email: john@example.com
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/bookings
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /bookings/{id}:
    get:
      tags:
      - Booking
      operationId: booking_show
      summary: Retrieve a booking
      description: |
        Retrieves the details of a single booking.
      parameters:
      - in: path
        name: id
        description: The unique id for the booking to be retrieved
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/bookings/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Booking'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/bookings/1234
                    version: 2
                    data:
                      id: 2983
                      _object: /booking
                      name: PO 123456
                      shipper_entity:
                        _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      consignee_entity:
                        _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      notify_party: Jane Doe; jane@example.com; 905-555-1234
                      transportation_mode: ocean
                      ocean_booking:
                        _object: /ocean/booking
                        is_lcl: false
                        container_counts:
                          _object: /container_counts
                          twenty_ft: 1
                          forty_ft: 2
                          forty_ft_hc: 4
                          forty_five_ft_hc: 8
                        incoterm: FOB
                        wants_pick_up_service: true
                        wants_delivery_service: false
                        origin_port:
                          _object: /place
                          name: Shanghai, China
                          address:
                            _object: /address
                            street_address: 123 Queen St
                            street_address2:
                            city: Shanghai
                            state:
                            country: China
                            country_code: CN
                            zip:
                            unlocode: CNSHA
                            timezone: China/Shanghai
                            ref: my-shanghai-ref
                          details:
                          - _object: /trucking/port
                            port_code: '57035'
                          - _object: /ocean/port
                            port_code: '57035'
                        destination_port:
                          _object: /place
                          name: Shanghai, China
                          address:
                            _object: /address
                            street_address: 123 Queen St
                            street_address2:
                            city: Shanghai
                            state:
                            country: China
                            country_code: CN
                            zip:
                            unlocode: CNSHA
                            timezone: China/Shanghai
                            ref: my-shanghai-ref
                          details:
                          - _object: /trucking/port
                            port_code: '57035'
                          - _object: /ocean/port
                            port_code: '57035'
                      air_booking:
                      trucking_booking:
                      origin_address:
                        _object: /address
                        street_address: 1641 Settlers Lane
                        street_address2: STE 2918
                        city: Albany
                        state: MN
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: US AL2
                        timezone: America/Los Angeles
                        ref: my-address-ref
                      cargo_ready_date: '2019-01-30'
                      destination_address:
                        _object: /address
                        street_address: 325 Balboa St
                        street_address2: Apt 6
                        city: San Francisco
                        state: CA
                        country: United States of America
                        country_code: US
                        zip: '94113'
                        unlocode: US SF3
                        timezone: America/Los Angeles
                        ref: my-sf-ref
                      delivery_date: '2019-02-22'
                      wants_export_customs_service: true
                      wants_import_customs_service: true
                      cargo:
                        volume:
                          _object: /quantity/volume
                          value: 472.62
                          unit: cbm
                        weight:
                          _object: /quantity/weight
                          value: 2300.4
                          unit: kg
                        marks_and_numbers: Very fragile
                        shipping_units:
                        - name: Airplanes
                          volume:
                            _object: /quantity/volume
                            value: 472.62
                            unit: cbm
                          weight:
                            _object: /quantity/weight
                            value: 2300.4
                            unit: kg
                          height:
                            _object: /quantity/length
                            value: 472.62
                            unit: cm
                          length:
                            _object: /quantity/length
                            value: 472.62
                            unit: cm
                          width:
                            _object: /quantity/length
                            value: 472.62
                            unit: cm
                          count: 3
                          atomic_count: 9
                          unit_type: carton
                        contains_hazmat: false
                        contains_magnets: false
                        contains_other_dangerous_goods: false
                        contains_li_ion: true
                        contains_non_li_ion_battery: false
                        lithium_batteries_packing_types:
                        - contained_in_equipment
                      special_instructions: ''
                      metadata:
                        purchase_order:
                        - '12345'
                        sku:
                        - abc123
                      created_at: '2019-04-01T18:44:34.098Z'
                      quote_status: accepted_quote
                      user_email: john@example.com
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/bookings/123456
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /commercial_invoices:
    get:
      tags:
      - Commercial Invoices
      operationId: commercial_invoices_index
      summary: List commercial invoices
      description: Returns a list of commercial invoices
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.shipment.id
        description: The unique id for the shipment.
        required: false
        schema:
          type: string
      - in: query
        name: f.invoice_number
        description: Filters results based on the invoice number.
        required: false
        schema:
          type: string
      - in: query
        name: f.involved_party_seller_id
        description: Filters results based on the involved party seller ID.
        required: false
        schema:
          type: string
      - in: query
        name: f.involved_party_seller_ref
        description: Filters results based on the involved party seller ref.
        required: false
        schema:
          type: string
      - in: query
        name: f.updated_at
        description: Filters results with the specified updated_at
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.gt
        description: Filters results updated after the specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.gte
        description: Filters results updated after the specified date, inclusive
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.lt
        description: Filters results updated before the specified date
        required: false
        schema:
          type: string
      - in: query
        name: f.created_at.lte
        description: Filters results updated before the specified date, inclusive
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/commercial_invoices?page=2&per=10
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/commercial_invoices?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/commercial_invoices?page=3&per=10
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/CommercialInvoice'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/commercial_invoices?page=2&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: >-
                        https://api.flexport.com/commercial_invoices?page=1&per=10
                      next:
                      data:
                      - _object: /commercial_invoices
                        id: abcxyz-23456-def
                        invoice_number: ABCDEFGHIJKLMNOP
                        digitization_status: complete
                        manufacturer_addresses:
                        - _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: id-3333
                        total_value:
                          _object: /money
                          amount: '100'
                          currency_code: USD
                        total_unit_count: '12345'
                        total_weight:
                          _object: /quantity/weight
                          value: 100
                          unit: kg
                        total_volume:
                          _object: /quantity/volume
                          value: 100
                          unit: cbm
                        line_items:
                        - _object: /commercial_invoice_line_item
                          id: 12345
                          price_per_unit:
                            _object: /money
                            amount: '12.34'
                            currency_code: USD
                          value:
                            _object: /money
                            amount: '12.34'
                            currency_code: USD
                          total_units: 10
                          container_number:
                            id: 123
                            container_number: XYZ123
                            commercial_invoice_line_item_id: 12345
                            deleted_at:
                            created_at: '2020-01-01T15:28:03.265Z'
                            updated_at: '2020-01-01T15:28:03.265Z'
                          purchase_order_number: 9876-ABC
                          weight:
                            _object: /quantity/weight
                            value: 12.34
                            unit: kg
                          volume:
                            _object: /quantity/volume
                            value: 12.34
                            unit: cbm
                          product:
                            _object: /api/refs/object
                            ref_type: /product
                            link: https://api.flexport.com/products/12345
                            id: 12345
                        updated_at: '2020-01-01T15:28:03.265Z'
                        shipment:
                          _object: /api/refs/object
                          ref_type: /shipment
                          link: https://api.flexport.com/shipments/123456
                          id: 123456
  /commercial_invoices/{id}:
    get:
      tags:
      - Commercial Invoices
      operationId: commercial_invoices_show
      summary: Retrieve a commercial invoice
      description: Retrieves the details of a single commercial invoice.
      parameters:
      - in: path
        name: id
        description: The unique id for the requested commercial invoice
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: >-
                      https://api.flexport.com/commercial_invoices/abcxyz-23456-def
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/CommercialInvoice'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: >-
                      https://api.flexport.com/commercial_invoices/abcxyz-23456-def
                    version: 2
                    data:
                      _object: /commercial_invoice
                      id: abcxyz-23456-def
                      invoice_number: ABCDEFGHIJKLMNOP
                      digitization_status: complete
                      manufacturer_addresses:
                      - _object: /address
                        street_address: 1641 Settlers Lane
                        street_address2: STE 2918
                        city: Albany
                        state: MN
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: US AL2
                        timezone: America/Los_Angeles
                        ref: id-3333
                      total_value:
                        _object: /money
                        amount: '100'
                        currency_code: USD
                      total_unit_count: '12345'
                      total_weight:
                        _object: /quantity/weight
                        value: 100
                        unit: kg
                      total_volume:
                        _object: /quantity/volume
                        value: 100
                        unit: cbm
                      line_items:
                      - _object: /commercial_invoice_line_item
                        id: 12345
                        price_per_unit:
                          _object: /money
                          amount: '12.34'
                          currency_code: USD
                        value:
                          _object: /money
                          amount: '12.34'
                          currency_code: USD
                        total_units: 10
                        container_number:
                          id: 123
                          container_number: XYZ123
                          commercial_invoice_line_item_id: 12345
                          deleted_at:
                          created_at: '2020-01-01T15:28:03.265Z'
                          updated_at: '2020-01-01T15:28:03.265Z'
                        purchase_order_number: 9876-ABC
                        weight:
                          _object: /quantity/weight
                          value: 12.34
                          unit: kg
                        volume:
                          _object: /quantity/volume
                          value: 12.34
                          unit: cbm
                        product:
                          _object: /api/refs/object
                          ref_type: /product
                          link: https://api.flexport.com/products/12345
                          id: 12345
                      shipment:
                        _object: /api/refs/object
                        ref_type: /shipment
                        link: https://api.flexport.com/shipments/123456
                        id: 123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: >-
                      https://api.flexport.com/commercial_invoices/abcxyz-23456-def
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /container_load_results/{id}:
    get:
      tags:
      - ContainerLoadResult
      operationId: container_load_result_show
      summary: Retrieve a container load result
      description: Retrieves the details of a single container load result.
      parameters:
      - in: path
        name: id
        description: The unique id for the container load result to be retrieved
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/container_load_results/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/ContainerLoadResult'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /container_load_result
                    id: 123
                    groups:
                    - _object: /container_load_result_group
                      total_packages: 2
                      total_packed_units: 10
                      total_weight_kg: 1000
                      total_volume_cbm: 1000
                      container_info:
                        container_number: 1234567890
                        seal_number: 1234567890
                        container_size: twenty_ft
                        container_type: dry
                      packages:
                      - _object: /container_load_result_package
                        count: 2
                        unit_of_measure: BX
                        gross_weight_kg: 1000
                        net_weight_kg: 1000
                        gross_volume_cbm: 1000
                        items:
                        - _object: /container_load_result_item
                          units: 10
                          purchase_order_line_item:
                            _object: /api/refs/object
                            ref_type: /purchase_orders/line_item
                            link: >-
                              https://api.flexport.com/purchase_order_line_items/1234
                            id: 1234
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/container_load_results/12345
                  version:
                    type: integer
                    example: 3
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /customs_entries:
    get:
      tags:
      - Customs Entries
      operationId: customs_entry_index
      summary: List customs entry objects
      description: Returns a list of customs entries.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.shipment.id
        description: The unique id for the shipment.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: collection of customs entries
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/customs_entries
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/customs_entries?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/customs_entries?page=3&per=10
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/CustomsEntry'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/customs_entries?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/customs_entries?page=12&per=10
                      next:
                      data:
                      - _object: /customs_entries
                        id: ABC123
                        entry_number: ABC-123456-7
                        release_status: cleared
                        release_date: '2019-05-03'
                        shipment:
                          _object: /api/refs/object
                          ref_type: /shipment
                          link: https://api.flexport.com/shipments/123456
                          id: 123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/custom_entries
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /customs_entries/{id}:
    get:
      tags:
      - Customs Entries
      operationId: customs_entries_show
      summary: Retrieve a customs entry
      description: Retrieves the details of a single customs entry.
      parameters:
      - in: path
        name: id
        description: The unique id for the requested customs entry
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: >-
                      https://api.flexport.com/customs_entries/abcdefg-1234567-hijk
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/CustomsEntry'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: >-
                      https://api.flexport.com/customs_entries/abcdefg-1234567-hijk
                    version: 2
                    data:
                      _object: /customs_entry
                      id: abcdefg-1234567-hijk
                      entry_number: ABC-123456-7
                      release_status: cleared
                      release_date: '2019-05-03'
                      shipment:
                        _object: /api/refs/object
                        ref_type: /shipment
                        link: https://api.flexport.com/shipments/123456
                        id: 123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: >-
                      https://api.flexport.com/customs_entries/abcdefg-1234567-hijk
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /documents:
    get:
      tags:
      - Document
      operationId: documents_index
      summary: List document objects
      description: Returns a list of all documents associated with shipments
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.shipment.id
        description: Filters the list for documents that belong to the given shipment
        required: false
        schema:
          type: string
      - in: query
        name: f.document_type
        description: Filters the list for documents that are the given type
        required: false
        schema:
          type: string
      - in: query
        name: f.archived_at.exists
        description: Filters the list for documents that have been archived
        required: false
        schema:
          type: string
      - in: query
        name: f.uploaded_at.gt
        description: >-
          Filters the list for documents that where uploaded after the given
          time
        required: false
        schema:
          type: string
      - in: query
        name: f.uploaded_at.lt
        description: >-
          Filters the list for documents that where uploaded before the given
          time
        required: false
        schema:
          type: string
      - in: query
        name: f.uploaded_at.gte
        description: >-
          Filters the list for documents that where uploaded on or after the
          given time
        required: false
        schema:
          type: string
      - in: query
        name: f.uploaded_at.lte
        description: >-
          Filters the list for documents that where uploaded on or before the
          given time
        required: false
        schema:
          type: string
      responses:
        '200':
          description: collection of documents
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/documents
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/documents?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/documents?page=3&per=10
                      total_count:
                        type: integer
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Document'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/documents?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/documents?page=12&per=10
                      next:
                      total_count: 121
                      data:
                      - _object: /document
                        id: ABC123
                        file_name: readme.txt
                        document_type: billing_packet
                        memo:
                        file_link: https://api.flexport.com/documents/ABC123/download
                        archived_at:
                        file_metadata:
                          _object: file/metadata
                          size: 20000
                          uploaded_at: '2019-06-12T02:00:00.338Z'
                        shipment:
                          _object: /api/refs/object
                          ref_type: /shipment
                          link: https://api.flexport.com/shipments/123456
                          id: 123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/documents
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - Document
      operationId: documents_create
      summary: Create a document
      description: Create a new document for this client using the request payload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDocument'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/documents/
                  version:
                    type: integer
                    example: 3
                  data:
                    $ref: '#/components/schemas/CreateDocument'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/documents
                    version: 3
                    data:
                    - _object: /document
                      id: ABC123
                      file_name: readme.pdf
                      document_type: packing_list
                      memo: ''
                      file_link: https://api.flexport.com/documents/ABC123/download
                      archived_at:
                      file_metadata:
                        _object: file/metadata
                        size: 2000
                        uploaded_at: '2019-06-12T02:00:00.338Z'
                      shipment:
                        _object: /api/refs/object
                        ref_type: /shipment
                        link: https://api.flexport.com/shipments/123456
                        id: 123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/documents
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /documents/{id}:
    get:
      tags:
      - Document
      operationId: documents_show
      summary: Retrieve a document
      description: Retrieves the details of a single document.
      parameters:
      - in: path
        name: id
        description: The unique id for the requested document
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/documents/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Document'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/documents/ABC123
                    version: 2
                    data:
                      _object: /document
                      id: ABC123
                      file_name: readme.txt
                      document_type: billing_packet
                      memo:
                      file_link: https://api.flexport.com/documents/ABC123/download
                      archived_at:
                      file_metadata:
                        _object: file/metadata
                        size: 20000
                        uploaded_at: '2019-06-12T02:00:00.338Z'
                      shipment:
                        _object: /api/refs/object
                        ref_type: /shipment
                        link: https://api.flexport.com/shipments/123456
                        id: 123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/documents/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /documents/{id}/download:
    get:
      tags:
      - Document
      operationId: documents_download
      summary: Download a document
      description: >-
        Retrieves the contents of a specified file. Returns the file as a stream
        of bytes.
      parameters:
      - in: path
        name: id
        description: The unique id for the requested document
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            image/png:
              schema:
                type: string
                format: binary
            application/vnd.ms-excel:
              schema:
                type: string
                format: binary
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            text/csv:
              schema:
                type: string
                format: binary
            image/tiff:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
            application/vnd.openxmlformats-officedocument.wordprocessingml.document:
              schema:
                type: string
                format: binary
            application/msword:
              schema:
                type: string
                format: binary
            application/zip:
              schema:
                type: string
                format: binary
            text/plain:
              schema:
                type: string
                format: binary
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/documents/ABC123/download
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /events:
    get:
      tags:
      - Event
      operationId: events_index
      summary: List all webhook events
      description: >-
        Returns a list of all events delivered to any webhook registered by this
        client
      parameters:
      - in: query
        name: f.type
        description: Filter by the type of the event
        required: false
        schema:
          type: string
        example: /shipment_leg#departed
      - in: query
        name: f.occurred_at.gte
        description: Filter by events which occurred on or after this datetime
        required: false
        schema:
          type: string
        example: '2020-01-10T20:00:00.000Z'
      - in: query
        name: f.occurred_at.lte
        description: Filter by events which occurred on or before this datetime
        required: false
        schema:
          type: string
        example: '2020-01-10T20:00:00.000Z'
      - in: query
        name: f.data.shipment.id
        description: >-
          Get all events which involved the shipment with this ID. Only event
          payloads that embed a top-level 'shipment' object support this
          filter: shipment events (types starting with /shipment#,
          /shipment_leg#, /ocean/shipment_container# or
          /ocean/shipment_container_leg#) and freight milestones. Invoice
          (/invoice#*), document (/document#*), order-management
          (/purchase_order#* and related types) and async-API events reference
          shipments only through a 'resource' link, so this filter never
          matches them. To list invoice events, filter by event type and time
          range instead, e.g.
          'f.type=/invoice#invoice_shared&f.occurred_at.gte=2026-01-01T00:00:00.000Z'
        required: false
        schema:
          type: integer
      - in: query
        name: f.data.resource._object
        description: >-
          Get all events which involved a resource of this type. The key for
          this filter will be the '_object' value for your target resource.
          Note: this filter can be combined with 'f.data.shipment.id' only for
          event types whose payload embeds a top-level shipment object
          (shipment-family events). For /invoice, /document and
          order-management resources the payload has no inline shipment, so
          combining the two filters always returns an empty result.
        required: false
        schema:
          type: string
          enum:
          - /document
          - /invoice
          - /ocean/shipment_container
          - /ocean/shipment_container_leg
          - /shipment
          - /shipment_leg
        example: /invoice
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/events
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example:
                      next:
                        type:
                        - string
                        - 'null'
                        example:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/WebhookEvent'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/events
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /events/{id}:
    get:
      tags:
      - Event
      operationId: events_show
      summary: Retrieve a single webhook event
      description: Returns the webhook event with ID ":id"
      parameters:
      - in: path
        name: id
        description: The unique id for the event object to be retrieved
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/events/123456
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/WebhookEvent'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/events/123456
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /invoices:
    get:
      tags:
      - Invoices
      operationId: invoice_index
      summary: List all invoices.
      description: Returns a list of invoices.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: >-
          Count of items in each page. Should be between 1 and 100
          (inclusive).
        required: false
        schema:
          type: integer
          example: 20
          minimum: 1
          maximum: 100
      - in: query
        name: sort
        description: Sort results by the specified field.
        required: false
        schema:
          type: string
          enum:
          - due_date
      - in: query
        name: direction
        description: Set sort order. Allows "asc"(ascending) or "desc" (descending).
        required: false
        schema:
          type: string
          default: desc
          enum:
          - asc
          - desc
      - in: query
        name: f.status
        description: Filters the list based on the status of the invoice
        required: false
        schema:
          type: string
          enum:
          - outstanding
          - past_due
          - void
          - paid
      - in: query
        name: f.shipment.id
        description: Filters the list for invoices associated with a shipment
        required: false
        schema:
          type: integer
          example: 12345
      - in: query
        name: f.billed_directly_to_client
        description: >
          Filters for invoices that are billed directly to the client, rather
          than invoices that are billed to a shipment.

          This parameter is mutually exclusive with the f.shipment.id filter.
        required: false
        schema:
          type: boolean
      - in: query
        name: f.entity.id
        description: >-
          Filters the list based on the ID of the company entity that receives
          the invoice
        required: false
        schema:
          type: integer
          example: 12345
      - in: query
        name: f.entity.ref
        description: >-
          Filters the list based on the ref of the company entity that
          receives the invoice
        required: false
        schema:
          type: string
          example: my-entity-ref
      - in: query
        name: f.name
        description: Filters the list based on the name of the invoice
        required: false
        schema:
          type: string
          example: FLEX-123456-1
      - in: query
        name: f.issued_at.gt
        description: Filters the list for invoices issued after the specified date
        required: false
        schema:
          type: string
          example: '2019-06-01'
      - in: query
        name: f.issued_at.lt
        description: Filters the list for invoices issued before the specified date
        required: false
        schema:
          type: string
          example: '2019-06-01T17:29:23.172Z'
      - in: query
        name: f.last_updated_at.gt
        description: Filters the list for invoices last updated after the specified
          date
        required: false
        schema:
          type: string
          example: '2019-06-01'
      - in: query
        name: f.last_updated_at.lt
        description: Filters the list for invoices last updated before the specified
          date
        required: false
        schema:
          type: string
          example: '2019-06-01T17:29:23.172Z'
      - in: query
        name: f.client_id
        description: >-
          [DEPRECATED] Filters the list for invoices billed directly to a
          client
        required: false
        deprecated: true
        schema:
          type: integer
          example: 54321
      - in: query
        name: f.shipment_id
        description: >-
          [DEPRECATED] Filters the list for invoices associated with a
          shipment
        required: false
        deprecated: true
        schema:
          type: integer
          example: 12345
      responses:
        '200':
          description: collection of invoices
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/invoices
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/invoices?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/invoices?page=3&per=10
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Invoice'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/invoices
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev:
                      next: https://api.flexport.com/invoices?page=2&per=10
                      data:
                      - _object: /invoice
                        id: gwdpaYrhTI-T1ljn1M7o7w
                        name: FLEX-123456-1
                        issued_at: '2019-05-22T18:39:53.679Z'
                        due_date: '2019-05-22'
                        quote_currency_code: USD
                        exchange_rate: 1.2543
                        invoice_type: customs
                        total:
                          _object: /money
                          amount: '6843.29'
                          currency_code: EUR
                        balance:
                          _object: /money
                          amount: '6743.29'
                          currency_code: EUR
                        status: void
                        type: Shipment
                        voided_at: '2019-05-22T20:49:15.639Z'
                        last_updated_at: '2019-05-24T20:49:15.653Z'
                        service_level: Standard
                        notes:
                        - |-
                          **Container numbers**

                          1234567
                        - |-
                          **Notes**

                          Other details about this invoice
                        recipient:
                          _object: /company_entity
                          id: 123456
                          name: Your Company Name
                          mailing_address:
                            _object: /address
                            street_address: 123 MAIN ST
                            street_address2: ''
                            city: Anytown
                            state: CA
                            country: United States
                            country_code: US
                            zip: '12345'
                            unlocode:
                            timezone: America/Los_Angeles
                            ref: my-address-ref
                          ref: id-123456
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 573467947
                        issuer:
                          _object: /company_entity
                          id: 28714
                          name: Flexport LLC
                          mailing_address:
                            _object: /address
                            street_address: 760 MARKET ST FL 8
                            street_address2: ''
                            city: SAN FRANCISCO
                            state: CA
                            country: United States
                            country_code: US
                            zip: 94102-2300
                            unlocode:
                            timezone: America/Los_Angeles
                            ref: flexport-address-ref
                          ref: id-54321
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 572559803
                        items:
                        - _object: /invoice_item
                          name: Import Customs Clearance
                          slug: import_customs_clearance
                          category: customs
                          amount:
                            _object: /money
                            amount: '125'
                            currency_code: EUR
                          rate:
                            _object: /invoice/rate
                            value: '125.00'
                            qualifier: EUR
                          quantity:
                            _object: /invoice/quantity
                            value: '1'
                            qualifier: total
                        - _object: /invoice_item
                          name: Fuel Surcharge
                          slug: fuel_surcharge
                          category: destination
                          amount:
                            _object: /money
                            amount: '200.61'
                            currency_code: EUR
                          rate:
                            _object: /invoice/rate
                            value: '23'
                            qualifier: '% Cartage Base'
                          quantity:
                            _object: /invoice/quantity
                            value: '872.22'
                            qualifier: EUR
                        - _object: /invoice_item
                          name: Cartage Base
                          slug: cartage_base
                          category: destination
                          amount:
                            _object: /money
                            amount: '872.22'
                            currency_code: EUR
                          rate:
                            _object: /invoice/rate
                            value: '0.5233'
                            qualifier: EUR
                          quantity:
                            _object: /invoice/quantity
                            value: '1667'
                            qualifier: 100_LB
                        - _object: /invoice_item
                          name: Automated Manifest System
                          slug: automated_manifest_system_freight
                          category: freight
                          amount:
                            _object: /money
                            amount: '15'
                            currency_code: EUR
                          rate:
                            _object: /invoice/rate
                            value: '15'
                            qualifier: EUR
                          quantity:
                            _object: /invoice/quantity
                            value: '1'
                            qualifier: bill of lading
                        - _object: /invoice_item
                          name: Air Freight
                          slug: air_freight
                          category: freight
                          amount:
                            _object: /money
                            amount: '5197.13'
                            currency_code: EUR
                          rate:
                            _object: /invoice/rate
                            value: '3.1183'
                            qualifier: EUR
                          quantity:
                            _object: /invoice/quantity
                            value: '1667.67'
                            qualifier: KG
                        - _object: /invoice_item
                          name: Fuel Surcharge
                          slug: fuel_surcharge
                          category: freight
                          amount:
                            _object: /money
                            amount: '433.33'
                            currency_code: EUR
                          rate:
                            _object: /invoice/rate
                            value: '0.26'
                            qualifier: EUR
                          quantity:
                            _object: /invoice/quantity
                            value: '1667.67'
                            qualifier: KG
                        credit_memos:
                        - _object: /credit_memo
                          amount:
                            _object: /money
                            amount: '100'
                            currency_code: EUR
                          categories:
                          - customs
                          - freight
                          reasons:
                          - reason for credit
                          - another reason
                          credited_at: '2019-05-24T18:39:53.679Z'
                        shipments:
                          _object: /api/refs/collection
                          ref_type: /shipment
                          link: >-
                            https://api.flexport.com/shipments?f.invoice_id=gwdpaYrhTI-T1ljn1M7o7w
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/invoices
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /invoices/{id}:
    get:
      tags:
      - Invoices
      operationId: invoices_show
      summary: Retrieve an invoice
      description: Retrieves the details of a single invoice
      parameters:
      - in: path
        name: id
        description: The unique id for the invoice to be retrieved
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/invoices/abcdef123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Invoice'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/invoices/abcdef123
                    version: 2
                    data:
                      _object: /invoice
                      id: abcdef123
                      name: FLEX-123456-1
                      issued_at: '2019-05-22T18:39:53.679Z'
                      due_date: '2019-05-22'
                      quote_currency_code: USD
                      exchange_rate: 1.2543
                      invoice_type: general
                      total:
                        _object: /money
                        amount: '6843.29'
                        currency_code: EUR
                      balance:
                        _object: /money
                        amount: '6743.29'
                        currency_code: EUR
                      status: void
                      type: Shipment
                      voided_at: '2019-05-22T20:49:15.639Z'
                      last_updated_at: '2019-05-24T20:49:15.653Z'
                      service_level: Standard
                      notes:
                      - |-
                        **Container numbers**

                        1234567
                      - |-
                        **Notes**

                        Other details about this invoice
                      recipient:
                        _object: /company_entity
                        id: 123456
                        name: Your Company Name
                        mailing_address:
                          _object: /address
                          street_address: 123 MAIN ST
                          street_address2: ''
                          city: Anytown
                          state: CA
                          country: United States
                          country_code: US
                          zip: '12345'
                          unlocode:
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: id-123456
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 573467947
                      issuer:
                        _object: /company_entity
                        id: 28714
                        name: Flexport LLC
                        mailing_address:
                          _object: /address
                          street_address: 760 MARKET ST FL 8
                          street_address2: ''
                          city: SAN FRANCISCO
                          state: CA
                          country: United States
                          country_code: US
                          zip: 94102-2300
                          unlocode:
                          timezone: America/Los_Angeles
                          ref: flexport-address-ref
                        ref: id-54321
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 572559803
                      items:
                      - _object: /invoice_item
                        name: Import Customs Clearance
                        slug: import_customs_clearance
                        category: customs
                        amount:
                          _object: /money
                          amount: '125'
                          currency_code: EUR
                        rate:
                          _object: /invoice/rate
                          value: '125.00'
                          qualifier: EUR
                        quantity:
                          _object: /invoice/quantity
                          value: '1'
                          qualifier: total
                      - _object: /invoice_item
                        name: Fuel Surcharge
                        slug: fuel_surcharge
                        category: destination
                        amount:
                          _object: /money
                          amount: '200.61'
                          currency_code: EUR
                        rate:
                          _object: /invoice/rate
                          value: '23'
                          qualifier: '% Cartage Base'
                        quantity:
                          _object: /invoice/quantity
                          value: '872.22'
                          qualifier: EUR
                      - _object: /invoice_item
                        name: Cartage Base
                        slug: cartage_base
                        category: destination
                        amount:
                          _object: /money
                          amount: '872.22'
                          currency_code: EUR
                        rate:
                          _object: /invoice/rate
                          value: '0.5233'
                          qualifier: EUR
                        quantity:
                          _object: /invoice/quantity
                          value: '1667'
                          qualifier: 100_LB
                      - _object: /invoice_item
                        name: Automated Manifest System
                        slug: automated_manifest_system_freight
                        category: freight
                        amount:
                          _object: /money
                          amount: '15'
                          currency_code: EUR
                        rate:
                          _object: /invoice/rate
                          value: '15'
                          qualifier: EUR
                        quantity:
                          _object: /invoice/quantity
                          value: '1'
                          qualifier: bill of lading
                      - _object: /invoice_item
                        name: Air Freight
                        slug: air_freight
                        category: freight
                        amount:
                          _object: /money
                          amount: '5197.13'
                          currency_code: EUR
                        rate:
                          _object: /invoice/rate
                          value: '3.1183'
                          qualifier: EUR
                        quantity:
                          _object: /invoice/quantity
                          value: '1667.67'
                          qualifier: KG
                      - _object: /invoice_item
                        name: Fuel Surcharge
                        slug: fuel_surcharge
                        category: freight
                        amount:
                          _object: /money
                          amount: '433.33'
                          currency_code: EUR
                        rate:
                          _object: /invoice/rate
                          value: '0.26'
                          qualifier: EUR
                        quantity:
                          _object: /invoice/quantity
                          value: '1667.67'
                          qualifier: KG
                      credit_memos:
                      - _object: /credit_memo
                        amount:
                          _object: /money
                          amount: '100'
                          currency_code: EUR
                        categories:
                        - customs
                        - freight
                        reasons:
                        - reason for credit
                        - another reason
                        credited_at: '2019-05-24T18:39:53.679Z'
                      shipments:
                        _object: /api/refs/collection
                        ref_type: /shipment
                        link: >-
                          https://api.flexport.com/shipments?f.invoice_id=abcdef123
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/invoices/abcdef123
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/companies:
    get:
      tags:
      - Company
      operationId: network_company_index
      summary: List company objects
      description: Returns a list of companies in the network.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.ref
        description: The ref for the company.
        required: false
        schema:
          type: string
      - in: query
        name: f.metadata.YOUR_METADATA_KEY
        description: >-
          Only return companies that have a specific metadata key-value pair.
          Multiple metadata filters can be added to a single query. If there
          are multiple metadata filters each with the same metadata key, then
          the filter will return companies matching any of the specified
          metadata values for that metadata key.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: collection of companies
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/companies
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/companies?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/companies?page=3&per=10
                      total_count:
                        type: integer
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Company'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/companies?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: >-
                        https://api.flexport.com/network/companies?page=12&per=10
                      next:
                      total_count: 121
                      data:
                      - _object: /network/company
                        id: ABC123
                        metadata: {}
                        name: CompanyFoo
                        ref: ref_for_company
                        editable: true
                        entities:
                        - _object: /company_entity
                          id: 9281
                          name: Zoomit
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: USAL2
                            timezone: America/Los_Angeles
                            ref: zoomit_address_ref
                          ref: zoomit_ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 123746396
                        locations:
                          _object: /api/refs/collection
                          ref_type: /network/location
                          link: https://api.flexport.com/network/location/123456
                        contacts:
                          _object: /api/refs/collection
                          ref_type: /network/contacts
                          link: https://api.flexport.com/network/contact/1234
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/companies
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - Company
      operationId: network_company_create
      summary: Create a new company object
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompany'
      responses:
        '200':
          description: The created company
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Company'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/companies
                    version: 2
                    data:
                      _object: /network/company
                      id: K67EZV1K8cQ5afQErZwk1Q
                      name: Zoomit
                      ref: zoomit_ref
                      editable: true
                      entities:
                      - _object: /company/entity
                        id: 123456
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: USAL2
                          timezone: America/Los_Angeles
                          ref: zoomit_address_ref
                        ref: id-123456
                        vat_numbers: []
                      locations:
                        _object: /api/refs/collection
                        ref_type: /network/location
                        link: >-
                          https://api.flexport.com/network/locations?f.company.id=K67EZV1K8cQ5afQErZwk1Q
                      contacts:
                        _object: /api/refs/collection
                        ref_type: /network/contact
                        link: >-
                          https://api.flexport.com/network/contacts?f.company.id=K67EZV1K8cQ5afQErZwk1Q
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/companies
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/companies/{id}:
    get:
      tags:
      - Company
      operationId: network_company_show
      summary: Retrieve a company
      description: Retrieves the details of a single company.
      parameters:
      - in: path
        name: id
        description: The unique id for the requested company
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/companies/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Company'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/companies/ABC123
                    version: 2
                    data:
                      _object: /network/company
                      id: ABC123
                      metadata: {}
                      name: CompanyFoo
                      ref: ref_for_company
                      editable: true
                      entities:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: USAL2
                          timezone: America/Los_Angeles
                          ref: zoomit_address_ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      locations:
                        _object: /api/refs/collection
                        ref_type: /network/location
                        link: https://api.flexport.com/network/locations/123456
                      contacts:
                        _object: /api/refs/collection
                        ref_type: /network/contact
                        link: https://api.flexport.com/network/contacts/1234
    patch:
      tags:
      - Company
      operationId: network_company_update
      summary: Update an existing company
      parameters:
      - in: path
        name: id
        description: The unique id for the requested company
        required: true
        schema:
          type: string
        example: K67EZV1K8cQ5afQErZwk1Q
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCompany'
      responses:
        '200':
          description: The updated company
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/companies/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Company'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/companies
                    version: 2
                    data:
                      _object: /network/company
                      id: K67EZV1K8cQ5afQErZwk1Q
                      name: Updated Zoomit
                      ref: zoomit_ref
                      editable: true
                      entities:
                      - _object: /company/entity
                        id: 123456
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: USAL2
                          timezone: America/Los_Angeles
                          ref: zoomit_address_ref
                        ref: id-123456
                        vat_numbers: []
                      locations:
                        _object: /api/refs/collection
                        ref_type: /network/location
                        link: >-
                          https://api.flexport.com/network/locations?f.company.id=K67EZV1K8cQ5afQErZwk1Q
                      contacts:
                        _object: /api/refs/collection
                        ref_type: /network/contact
                        link: >-
                          https://api.flexport.com/network/contacts?f.company.id=K67EZV1K8cQ5afQErZwk1Q
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/companies/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/company_entities:
    get:
      tags:
      - CompanyEntity
      operationId: company_entity_index
      summary: List of company entity objects
      description: Returns a list of the company entity objects in the network.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.ref
        description: The ref for the company entity
        required: false
        schema:
          type: string
      - in: query
        name: f.company_id
        description: The id for the company entity's parent company
        required: false
        schema:
          type: string
      - in: query
        name: f.company_ref
        description: The ref for the company entity's parent company
        required: false
        schema:
          type: string
      responses:
        '200':
          description: collection of company entities
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/company_entities?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/company_entities?page=3&per=10
                      total_count:
                        type: integer
                        example: 35
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/CompanyEntity'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: >-
                      https://api.flexport.com/network/company_entities?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: >-
                        https://api.flexport.com/network/company_entities?page=12&per=10
                      next:
                      total_count: 121
                      data:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: USAL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - CompanyEntity
      operationId: network_company_entity_create
      summary: Create and return a new company entity
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompanyEntity'
      responses:
        '200':
          description: The created company entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/CompanyEntity'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/company_entities
                    version: 2
                    data:
                      _object: /company_entity
                      id: 9281
                      name: Zoomit
                      ref: my-zoomit-ref
                      mailing_address:
                        _object: /address
                        street_address: 1641 Settlers Lane
                        street_address2: STE 2918
                        city: Albany
                        state: MN
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: USAL2
                        timezone: America/Los_Angeles
                        ref: my-address-ref
                      vat_numbers:
                      - _object: /company_entity/vat_number
                        country_code: GB
                        number: GB 123456789
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/company_entities/{id}:
    get:
      tags:
      - CompanyEntity
      operationId: network_company_entity_show
      summary: Retrieve a company entity
      description: Retrieves the details of a single company entity
      parameters:
      - in: path
        name: id
        description: The unique id for the requested company entity
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities/9281
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/CompanyEntity'
              examples:
                response:
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/company_entities/9281
                    version: 2
                    data:
                      _object: /company_entity
                      id: 9281
                      name: Zoomit
                      mailing_address:
                        _object: /address
                        street_address: 1641 Settlers Lane
                        street_address2: STE 2918
                        city: Albany
                        state: MN
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: USAL2
                        timezone: America/Los_Angeles
                        ref: my-address-ref
                      ref: zoomit_ref
                      vat_numbers:
                      - _object: company_entity/vat_number
                        country_code: US
                        number: US 123746396
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities/9281
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    patch:
      tags:
      - CompanyEntity
      operationId: network_company_entity_update
      summary: Update a company entity
      parameters:
      - in: path
        name: id
        description: The unique id for the requested company entity
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCompanyEntity'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities/9281
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/CompanyEntity'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/company_entities/9281
                    version: 2
                    data:
                      _object: /company_entity
                      id: 9281
                      name: Zoomit V2
                      ref: zoomit-us
                      mailing_address:
                        _object: /address
                        street_address: 1641 Settlers Lane
                        street_address2: STE 2918
                        city: Albany
                        state: MN
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: USAL2
                        timezone: America/Los_Angeles
                        ref: my-address-ref
                      vat_numbers:
                      - _object: company_entity/vat_number
                        country_code: GB
                        number: GB 123746396
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/company_entities/9281
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/contacts:
    get:
      tags:
      - Contact
      operationId: network_contact_index
      summary: List contact objects
      description: Returns a list of contacts in the network.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.company_ref
        description: The ref for the company.
        required: false
        schema:
          type: string
      - in: query
        name: f.company.id
        description: The id for the company.
        required: false
        schema:
          type: string
      - in: query
        name: f.location.id
        description: Filters out all contacts not related to this location.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: collection of contacts
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/contacts?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/contacts?page=3&per=10
                      total_count:
                        type: integer
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Contact'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/contacts?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/network/contacts?page=12&per=10
                      next:
                      total_count: 121
                      data:
                      - _object: /network/contact
                        id: ABC123
                        name: Joe Schmoe
                        email: joe@example.com
                        phone_number: '6789998212'
                        locations:
                          _object: /api/refs/collection
                          ref_type: /network/location
                          link: https://api.flexport.com/network/locations/123456
                        company:
                          _object: /api/refs/object
                          ref_type: /network/company
                          link: >-
                            https://api.flexport.com/network/companies/2UXaj4xcHoW8nwh9UVOMpw
                          id: 2UXaj4xcHoW8nwh9UVOMpw
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - Contact
      operationId: network_contact_create
      summary: Create a new contact object
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContact'
      responses:
        '200':
          description: The created contact
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Contact'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/contacts
                    version: 2
                    data:
                      _object: /network/contact
                      id: FHLKEFHHoW8nwh9UVOMpw
                      name: John Smith
                      email: john@example.com
                      phone_number: 861-555-5555
                      locations:
                        _object: /api/refs/collection
                        ref_type: /network/location
                        link: >-
                          https://api.flexport.com/network/locations?f.contact.id=FHLKEFHHoW8nwh9UVOMpw
                      company:
                        _object: /api/refs/object
                        ref_type: /network/company
                        link: >-
                          https://api.flexport.com/network/companies/2UXaj4xcHoW8nwh9UVOMpw
                        id: 2UXaj4xcHoW8nwh9UVOMpw
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/contacts/{id}:
    get:
      tags:
      - Contact
      operationId: network_contact_show
      summary: Retrieve a contact
      description: Retrieves the details of a single contact.
      parameters:
      - in: path
        name: id
        description: The unique id for the requested contact
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Contact'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/contacts/ABC123
                    version: 2
                    data:
                      _object: /network/contact
                      id: ABC123
                      name: Joe Schmoe
                      email: joe@example..com
                      phone_number: '6789998212'
                      locations:
                        _object: /api/refs/collection
                        ref_type: /network/location
                        link: https://api.flexport.com/network/locations/123456
                      company:
                        _object: /api/refs/object
                        ref_type: /network/company
                        link: >-
                          https://api.flexport.com/network/companies/2UXaj4xcHoW8nwh9UVOMpw
                        id: 2UXaj4xcHoW8nwh9UVOMpw
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    patch:
      tags:
      - Contact
      operationId: network_contact_update
      summary: Update an existing contact
      parameters:
      - in: path
        name: id
        description: The unique id for the requested contact
        required: true
        schema:
          type: string
        example: FHLKEFHHoW8nwh9UVOMpw
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContact'
      responses:
        '200':
          description: The updated contact
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Contact'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: >-
                      https://api.flexport.com/network/contacts/FHLKEFHHoW8nwh9UVOMpw
                    version: 2
                    data:
                      _object: /network/contact
                      id: FHLKEFHHoW8nwh9UVOMpw
                      name: John Smith
                      email: john_new_email@example.com
                      phone_number: 861-555-7777
                      locations:
                        _object: /api/refs/collection
                        ref_type: /network/location
                        link: >-
                          https://api.flexport.com/network/locations?f.contact.id=FHLKEFHHoW8nwh9UVOMpw
                      company:
                        _object: /api/refs/object
                        ref_type: /network/company
                        link: >-
                          https://api.flexport.com/network/companies/2UXaj4xcHoW8nwh9UVOMpw
                        id: 2UXaj4xcHoW8nwh9UVOMpw
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/contacts/ABC123
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/locations:
    get:
      tags:
      - Location
      operationId: location_index
      summary: List of location objects
      description: Returns a list of location objects in the network.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.ref
        description: The ref for the location.
        required: false
        schema:
          type: string
      - in: query
        name: f.company_ref
        description: The ref for a company.
        required: false
        schema:
          type: string
      - in: query
        name: f.company.id
        description: The id for a company.
        required: false
        schema:
          type: string
      - in: query
        name: f.contact.id
        description: The id for a contact at this location.
        required: false
        schema:
          type: string
      - in: query
        name: f.metadata.YOUR_METADATA_KEY
        description: >-
          Only return locations that have a specific metadata key-value pair.
          Multiple metadata filters can be added to a single query. If there
          are multiple metadata filters each with the same metadata key, then
          the filter will return locations matching any of the specified
          metadata values for that metadata key.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: collection of locations
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/locations?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/network/locations?page=3&per=10
                      total_count:
                        type: integer
                        example: 35
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Location'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/locations?page=2&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/network/locations?page=1&per=10
                      next:
                      total_count: 11
                      data:
                      - _object: /network/location
                        id: abdef123
                        metadata: {}
                        name: Wayne Enterprises
                        address:
                          _object: /address
                          street_address: 1641 Gotham Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: USAL2
                          timezone: America/Los_Angeles
                          ref: wayne_enterprises_ref
                        editable: true
                        contacts:
                          _object: /api/refs/collection
                          ref_type: /network/contacts
                          link: >-
                            https://api.flexport.com/network/contacts?f.location.id=abdef123
                        company:
                          _object: /api/refs/object
                          ref_type: /network/company
                          link: https://api.flexport.com/network/companies/abc123
                          id: abc123
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - Location
      operationId: network_location_create
      summary: Create and return a new location
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLocation'
      responses:
        '200':
          description: The created location
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Location'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/locations
                    version: 2
                    data:
                      _object: /network/location
                      id: abdef123
                      metadata: {}
                      name: Zoomit
                      address:
                        _object: /address
                        street_address: 1641 Settlers Lane
                        street_address2: STE 2918
                        city: Los Angeles
                        state: CA
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: USLAX
                        timezone: America/Los_Angeles
                        ref: zoomit-management-co
                      editable: true
                      contacts:
                        _object: /api/refs/collection
                        ref_type: /network/contacts
                        link: >-
                          https://api.flexport.com/network/contacts?f.location.id=abdef123
                      company:
                        _object: /api/refs/object
                        ref_type: /network/company
                        link: https://api.flexport.com/network/companies/xyz_123_abc
                        id: xyz_13_zbc
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/locations/{id}:
    get:
      tags:
      - Location
      operationId: network_location_show
      summary: Retrieve a location by id
      description: Retrieves the details of a single location
      parameters:
      - in: path
        name: id
        description: The unique id for the requested location
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations/abdef123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Location'
              examples:
                response:
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/locations/abdef123
                    version: 2
                    data:
                      _object: /network/location
                      id: abdef123
                      metadata: {}
                      name: Wayne Enterprises
                      address:
                        _object: /address
                        street_address: 1641 Gotham Lane
                        street_address2: STE 2918
                        city: Albany
                        state: MN
                        country: United States of America
                        country_code: US
                        zip: '56307'
                        unlocode: USAL2
                        timezone: America/Los_Angeles
                        ref: wayne_enterprises_ref
                      editable: true
                      contacts:
                        _object: /api/refs/collection
                        ref_type: /network/contacts
                        link: >-
                          https://api.flexport.com/network/contacts?f.location.id=abdef123
                      company:
                        _object: /api/refs/object
                        ref_type: /network/company
                        link: https://api.flexport.com/network/companies/abc123
                        id: abc123
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations/abdef123
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    patch:
      tags:
      - Location
      operationId: location_update
      summary: Update a network location
      parameters:
      - in: path
        name: id
        description: The unique id for the requested location
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLocation'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations/abdef123
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Location'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/locations/abdef123
                    version: 2
                    data:
                      _object: /network/location
                      id: abdef123
                      metadata: {}
                      name: Zoomit V2
                      address:
                        _object: /address
                        street_address: 2 World Way
                        street_address2:
                        city: Los Angeles
                        state: CA
                        country: United States of America
                        country_code: US
                        zip: '90045'
                        unlocode: USLAX
                        timezone: America/Los_Angeles
                        ref: zoomit-management-co
                      editable: true
                      contacts:
                        _object: /api/refs/collection
                        ref_type: /network/contacts
                        link: >-
                          https://api.flexport.com/network/contacts?f.location.id=abdef123
                      company:
                        _object: /api/refs/object
                        ref_type: /network/company
                        link: https://api.flexport.com/network/companies/xyz_123_abc
                        id: xyz_13_zbc
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/locations/abdef123
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /network/me/companies:
    get:
      tags:
      - Company
      operationId: network_company_me
      summary: Retrieve your company
      description: Retrieves the details of your own organization.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/me/companies
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Company'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/network/me/companies
                    version: 2
                    data:
                      _object: /network/company
                      id: ABC123
                      name: CompanyFoo
                      ref: ref_for_company
                      editable: true
                      entities:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: USAL2
                          timezone: America/Los_Angeles
                          ref: zoomit_address_ref
                        ref: zoomit_ref
                        vat_numbers: []
                      locations:
                        _object: /api/refs/collection
                        ref_type: /network/location
                        link: https://api.flexport.com/network/locations/123456
                      contacts:
                        _object: /api/refs/collection
                        ref_type: /network/contact
                        link: https://api.flexport.com/network/contacts/1234
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/network/me/companies
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /ocean/shipment_container_legs:
    get:
      tags:
      - ContainerLeg
      operationId: ocean_container_legs_index
      summary: List all container legs
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: >-
          Count of items in each page. Should be between 1 and 100
          (inclusive).
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.leg.id
        description: >-
          Only return containers legs associated with the shipment leg
          specified by this id.
        required: false
        schema:
          type: integer
      - in: query
        name: f.shipment_container.id
        description: >-
          Only return containers legs associated with the shipment container
          specified by this id.
        required: false
        schema:
          type: integer
      - in: query
        name: f.shipment_container.container_number
        description: >-
          Only return containers legs associated with the given container
          number.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/ocean/shipment_container_legs
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/ocean/shipment_container_legs?page=1
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/ocean/shipment_container_legs?page=3
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/OceanShipmentContainerLeg'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/ocean/shipment_container_legs
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: >-
                        https://api.flexport.com/ocean/shipment_container_legs?page=1
                      next: >-
                        https://api.flexport.com/ocean/shipment_container_legs?page=3
                      data:
                      - _object: /ocean/shipment_container_leg
                        shipment_container:
                          _object: /api/refs/object
                          ref_type: /ocean/shipment_container
                          link: >-
                            https://api.flexport.com/ocean/shipment_containers/123
                          id: 123
                        leg:
                          _object: /api/refs/object
                          ref_type: /shipment_leg
                          link: https://api.flexport.com/shipment_legs/123
                          id: 123
                        dates:
                        - actual_loaded_on_board_date: '2019-01-18T22:08:38.599Z'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/ocean/shipment_container_legs
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /ocean/shipment_container_legs/{id}:
    get:
      tags:
      - ContainerLeg
      operationId: ocean_container_legs_show
      summary: Retrieve a container leg on an Ocean shipment
      parameters:
      - in: path
        name: id
        description: The unique id for the ContainerLeg to be retrieved
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: >-
                      https://api.flexport.com/ocean/shipment_container_legs/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/OceanShipmentContainerLeg'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: >-
                      https://api.flexport.com/ocean/shipment_container_legs/1234
                    version: 2
                    data:
                      _object: /ocean/shipment_container_leg
                      shipment_container:
                        _object: /api/refs/object
                        ref_type: /ocean/shipment_container
                        link: https://api.flexport.com/ocean/shipment_containers/123
                        id: 123
                      leg:
                        _object: /api/refs/object
                        ref_type: /shipment_leg
                        link: https://api.flexport.com/shipment_legs/123
                        id: 123
                      dates:
                      - actual_loaded_on_board_date: '2019-01-18T22:08:38.599Z'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: >-
                      https://api.flexport.com/ocean/shipment_container_legs/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /ocean/shipment_containers:
    get:
      tags:
      - Container
      operationId: container_list
      summary: List all containers.
      description: >-
        Returns a list of containers. The containers are sorted descending by
        creation date.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: >-
          Count of items in each page. Should be between 1 and 100
          (inclusive).
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.shipment.id
        description: >-
          Only return containers associated with the shipment specified by
          this id.
        required: false
        schema:
          type: integer
      - in: query
        name: f.container_number
        description: Only return containers associated with the given container number.
        required: false
        schema:
          type: string
      - in: query
        name: f.reference_code
        description: Only return containers associated with the given reference code.
        required: false
        schema:
          type: string
      - in: query
        name: f.metadata.YOUR_METADATA_KEY
        description: >-
          Only return containers that have a specific metadata key-value pair.
          Multiple metadata filters can be added to a single query. If there
          are multiple metadata filters each with the same metadata key, then
          the filter will return containers matching any of the specified
          metadata values for that metadata key.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/ocean/shipment_containers?page=1
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/ocean/shipment_containers?page=3
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/ShipmentContainer'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: >-
                        https://api.flexport.com/ocean/shipment_containers?page=1
                      next: >-
                        https://api.flexport.com/ocean/shipment_containers?page=3
                      data:
                      - _object: /ocean/shipment_container
                        metadata: {}
                        id: 283910
                        container_type: dry
                        container_number: BWSE3982156
                        container_size: fourty_ft
                        reference_code: 19HON037-UK
                        seal_number: UE_WQ2934875
                        estimated_departure_date: '2019-02-06T19:28:25.000+00:00'
                        actual_departure_date: '2019-02-06T19:28:25.000+00:00'
                        estimated_arrival_date: '2019-02-06T19:28:25.000+00:00'
                        actual_arrival_date: '2019-02-06T19:28:25.000+00:00'
                        estimated_pickup_date: '2019-02-06T19:28:25.000+00:00'
                        actual_pickup_date: '2019-02-06T19:28:25.000+00:00'
                        estimated_delivery_date: '2019-02-06T19:28:25.000+00:00'
                        actual_delivery_date: '2019-02-06T19:28:25.000+00:00'
                        last_free_day_date: '2019-02-16T00:00:00.000Z'
                        empty_ready_date: '2019-02-16T00:00:00.000Z'
                        empty_returned_date: '2019-02-28'
                        cargo_ready_date: '2019-02-06'
                        available_for_pickup_date: '2019-02-16T00:00:00.000Z'
                        estimated_available_for_pickup_date: '2019-02-16T00:00:00.000Z'
                        shipment:
                          _object: /api/refs/object
                          ref_type: /shipment
                          link: https://api.flexport.com/shipments/123
                          id: 123
                        container_legs:
                          _object: /api/refs/collection
                          ref_type: /ocean/shipment_container_leg
                          link: >-
                            https://api.flexport.com/ocean/shipment_container_legs?f.shipment_container.id=123
                        items:
                        - _object: /shipment_item
                          id: 29820
                          total_units: 523
                          total_weight:
                            _object: /quantity/weight
                            value: 224.02
                            unit: kg
                          total_volume:
                            _object: /quantity/volume
                            value: 8200
                            unit: cbm
                          purchase_order_number: PO002811
                          product:
                            _object: /product
                            id: 84291
                            name: AC Adapter 12V
                            sku: WDVCDFD-RM00472
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/ocean/shipment_containers
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /ocean/shipment_containers/{id}:
    get:
      tags:
      - Container
      operationId: container_show
      summary: Retrieve a container.
      description: Retrieves the details of a single container.
      parameters:
      - in: path
        name: id
        description: The unique id for the shipment to be retrieved.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/ocean/shipment_containers/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/ShipmentContainer'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/ocean/shipment_containers/1234
                    version: 2
                    data:
                      _object: /ocean/shipment_container
                      metadata: {}
                      id: 283910
                      container_type: dry
                      container_number: BWSE3982156
                      container_size: fourty_ft
                      seal_number: UE_WQ2934875
                      estimated_departure_date: '2019-02-06T19:28:25+00:00'
                      actual_departure_date: '2019-02-06T19:28:25+00:00'
                      estimated_arrival_date: '2019-02-06T19:28:25+00:00'
                      actual_arrival_date: '2019-02-06T19:28:25+00:00'
                      estimated_pickup_date: '2019-02-06T19:28:25+00:00'
                      actual_pickup_date: '2019-02-06T19:28:25+00:00'
                      estimated_delivery_date: '2019-02-06T19:28:25+00:00'
                      actual_delivery_date: '2019-02-06T19:28:25+00:00'
                      last_free_day_date: '2019-02-16T00:00:00.000Z'
                      empty_ready_date: '2019-02-16T00:00:00.000Z'
                      empty_returned_date: '2019-02-28'
                      cargo_ready_date: '2019-02-06'
                      available_for_pickup_date: '2019-02-16T00:00:00.000Z'
                      estimated_available_for_pickup_date: '2019-02-16T00:00:00.000Z'
                      shipment:
                        _object: /api/refs/object
                        ref_type: /shipment
                        link: https://api.flexport.com/shipments/123
                        id: 123
                      container_legs:
                        _object: /api/refs/collection
                        ref_type: /ocean/shipment_container_leg
                        link: >-
                          https://api.flexport.com/ocean/shipment_container_legs?f.shipment_container.id=123
                      items:
                      - _object: /shipment_item
                        id: 29820
                        total_units: 523
                        total_weight:
                          _object: /quantity/weight
                          value: 224.02
                          unit: kg
                        total_volume:
                          _object: /quantity/volume
                          value: 8200
                          unit: cbm
                        purchase_order_number: PO002811
                        product:
                          _object: /product
                          id: 84291
                          name: AC Adapter 12V
                          sku: WDVCDFD-RM00472
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/ocean/shipment_containers/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /ports:
    get:
      tags:
      - Ports
      operationId: ports_index
      summary: List of ports
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.port_type
        description: Filter by the type of port. Ports can have more than one type
        required: false
        schema:
          type: string
          enum:
          - airport
          - railport
          - roadport
          - seaport
      - in: query
        name: f.unlocode
        description: Filter by unlocode.
        required: false
        schema:
          type: string
          example: CATOR
      responses:
        '200':
          description: collection of ports
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/ports
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/pors?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/ports?page=3&per=10
                      total_count:
                        type: integer
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Place'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/ports?page=2&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/ports?page=1&per=10
                      next: https://api.flexport.com/ports?page=1&per=10
                      total_count: 1960
                      data:
                      - _object: /place
                        name: ORD - Chicago - IL
                        address:
                          _object: /address
                          street_address: 10000 West O'Hare Ave
                          street_address2: PO Box 66142
                          city: Chicago
                          state: IL
                          country: United States of America
                          country_code: US
                          zip: '60666'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-chicago-ref
                        details:
                        - _object: /air/port
                          port_code: '3901'
                          country_code: US
                          iata_code: ORD
                          icao_code: KORD
                        - _object: /trucking/port
                          port_code: '3901'
                      - _object: /place
                        name: Oakland, CA
                        address:
                          _object: /address
                          street_address: 530 Water St
                          street_address2:
                          city: Oakland
                          state: CA
                          country: United States of America
                          country_code: US
                          zip: '94607'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: oakland-ref
                        details:
                        - _object: /trucking/port
                          port_code: '2811'
                        - _object: /ocean/railport
                          port_code: '2811'
                        - _object: /ocean/port
                          port_code: '2811'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/ports
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /products:
    get:
      tags:
      - Product
      operationId: product_index
      summary: List all products for a client
      description: Returns a list of all products belonging to this client
      parameters:
      - in: query
        name: f.sku
        description: >-
          Find the products having this SKU. SKUs are unique among active
          products, but there may be archived products that share the same
          sku.
        required: false
        schema:
          type: string
      - in: query
        name: f.archived_at.exists
        description: >-
          Filter out all archived products (f.archived_at.exists=false) or
          filter out all unarchived products (f.archived_at.exists=true)
        required: false
        schema:
          type: boolean
      - in: query
        name: f.product_properties.TYPE
        description: >-
          Search for product properties that are key-value pairs. The key
          (TYPE) is appended at the end of the parameter name. Multiple
          property filters can be added to the same query. E.G.
          f.product_properties.color=blue
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                      next:
                        type:
                        - string
                        - 'null'
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Product'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/products?page=2&per=10
                    version: 2
                    data:
                      _object: /api/collectoins/paginated
                      prev: https://api.flexport.com/products?page=1&per=10
                      next: https://api.flexport.com/products?page=3&per=10
                      data:
                      - _object: /product
                        id: 84291
                        name: AC Adapter 12V
                        sku: WDVCDFD-RM00472
                        description: The best 12V AC Adapter on the market
                        archived_at: '2019-01-18T22:08:38.599Z'
                        product_category: Cosmetics
                        country_of_origin: China
                        client_verified: true
                        product_properties:
                        - _object: /product/property
                          type: color
                          value: blue
                        hs_codes:
                        - _object: /hs_code
                          description:
                          code: 0301:00
                        classifications:
                        - _object: /product/classification
                          codes:
                          - 0301:00
                          region: US
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    post:
      tags:
      - Product
      operationId: product_create
      summary: Create a product
      description: Create a new product for this client using the request payload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProduct'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products/
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Product'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/products/84291
                    version: 2
                    data:
                      _object: /product
                      id: 84291
                      name: AC Adapter 12V
                      sku: WDVCDFD-RM00472
                      description: The best 12V AC Adapter on the market
                      archived_at: '2019-01-18T22:08:38.599Z'
                      product_category: Cosmetics
                      country_of_origin: China
                      client_verified: true
                      product_properties:
                      - _object: /product/property
                        type: color
                        value: blue
                      hs_codes:
                      - _object: /hs_code
                        description:
                        code: 0301:00
                      classifications:
                      - _object: /product/classification
                        codes:
                        - 0301:00
                        region: US
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /products/{id}:
    get:
      tags:
      - Product
      operationId: product_show
      summary: Retrieve a single product
      description: Returns the client's product with this ID
      parameters:
      - in: path
        name: id
        description: Unique id for the product to be retrieved
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products/1
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Product'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/products/84291
                    version: 2
                    data:
                      _object: /product
                      id: 84291
                      name: AC Adapter 12V
                      sku: WDVCDFD-RM00472
                      description: The best 12V AC Adapter on the market
                      archived_at: '2019-01-18T22:08:38.599Z'
                      product_category: Cosmetics
                      country_of_origin: China
                      client_verified: true
                      product_properties:
                      - _object: /product/property
                        type: color
                        value: blue
                      hs_codes:
                      - _object: /hs_code
                        description:
                        code: 0301:00
                      classifications:
                      - _object: /product/classification
                        codes:
                        - 0301:00
                        region: US
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products/84291
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    patch:
      tags:
      - Product
      operationId: product_update
      summary: Update a product
      description: Update this product to represent the request payload
      parameters:
      - in: path
        name: id
        description: Unique id for the product to be updated
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProduct'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products/1
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Product'
              examples:
                response:
                  summary: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/products/84291
                    version: 2
                    data:
                      _object: /product
                      id: 84291
                      name: AC Adapter 12V
                      sku: WDVCDFD-RM00472
                      description: The best 12V AC Adapter on the market
                      archived_at: '2019-01-18T22:08:38.599Z'
                      product_category: Cosmetics
                      country_of_origin: China
                      client_verified: true
                      product_properties:
                      - _object: /product/property
                        type: color
                        value: blue
                      hs_codes:
                      - _object: /hs_code
                        description:
                        code: 0301:00
                      classifications:
                      - _object: /product/classification
                        codes:
                        - 0301:00
                        region: US
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/products/84291
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /purchase_order_line_items:
    get:
      tags:
      - PurchaseOrderLineItem
      operationId: purchase_order_line_item_index
      summary: List all purchase order line items
      description: Returns a list of purchase order line items
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page. Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: direction
        description: Set sort order. Allows "asc"(ascending) or "desc" (descending)
        required: false
        schema:
          type: string
          default: desc
          enum:
          - asc
          - desc
      - in: query
        name: f.purchase_order.id
        description: Filters the list based on the purchase order id
        required: false
        schema:
          type: integer
          example: 123
      - in: query
        name: f.line_item_number
        description: Filters the list based on line item number
        required: false
        schema:
          type: string
          example: '1'
      - in: query
        name: f.item_key
        description: Filters the list based on item key
        required: false
        schema:
          type: string
          example: item1
      - in: query
        name: f.purchase_order_version.id
        description: >-
          The id of the version of a purchase order. By default, the latest
          version of the purchase order is used.
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: collection of purchase order line items
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_order_line_items
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/purchase_order_line_items?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: >-
                          https://api.flexport.com/purchase_order_line_items?page=3&per=10
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/PurchaseOrderLineItem'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: >-
                      https://api.flexport.com/purchase_order_line_items?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: >-
                        https://api.flexport.com/purchase_order_line_items?page=12&per=10
                      next:
                      data:
                      - _object: /purchase_orders/line_item
                        id: 123456
                        purchase_order:
                          _object: /api/refs/object
                          ref_type: /purchase_order
                          link: https://api.flexport.com/purchase_orders/26088
                          id: 12345
                        line_item_number: 1
                        item_key: item1
                        product:
                          _object: /product
                          id: 54321
                          sku: CHAIRS-BL-1
                          name: Black chairs
                          product_category: Furniture
                          country_of_origin: Vietnam
                          product_properties:
                          - type: material
                            value: cotton
                          hs_codes:
                          - description: >-
                              Rock lobster and other sea crawfish (
                              Palinurus spp.  Panulirus spp  Jasus spp. )
                            code: '0306.02'
                        units: 20
                        incoterm: FOB
                        transportation_mode: air
                        unit_of_measure: HUN
                        cargo_ready_date: '2010-02-11'
                        must_arrive_date: '2019-03-11'
                        origin_port:
                        origin_address:
                          _object: /address
                          street_address: 10th YouSong Industrial District
                          street_address2:
                          city: Shenzhen
                          state: '44'
                          country: China
                          country_code: CN
                          timezone: China/Shenzhen
                          zip:
                          unlocode:
                          ref: sellingcoaddress
                        destination_port:
                        destination_address:
                          _object: /address
                          street_address: 1556 20TH ST STE 2D
                          street_address2:
                          city: SANTA MONICA
                          state: CA
                          country: United States
                          country_code: US
                          zip: 90404-3465
                          unlocode:
                          ref: studiosantamonica
                          timezone: America/Los Angeles
                        hs_codes:
                        - _object: /hs_code
                          code: 8309.90.10.00
                          country_code: US
                          description:
                        unit_cost:
                          _object: /money
                          amount: '121.00'
                          currency_code: USD
                        booking_line_items:
                          _object: /api/refs/collection
                          ref_type: /purchase_orders/booking_line_item
                          link: >-
                            https://api.flexport.com/booking_line_items?f.purchase_order_line_item.id=123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_order_line_items
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /purchase_order_line_items/{id}:
    get:
      tags:
      - PurchaseOrderLineItem
      operationId: purchase_order_line_item_show
      summary: Retrieve a purchase order line item
      description: Returns the details of a purchase order line item
      parameters:
      - in: path
        name: id
        description: The unique id for the PO line item to be retrieved
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: collection of purchase order line items
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_order_line_items/123456
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/PurchaseOrderLineItem'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/purchase_order_line_items/123456
                    version: 2
                    data:
                      _object: /purchase_orders/line_item
                      id: 123456
                      purchase_order:
                        _object: /api/refs/object
                        ref_type: /purchase_order
                        link: https://api.flexport.com/purchase_orders/26088
                        id: 12345
                      line_item_number: 1
                      item_key: item1
                      product:
                        _object: /product
                        id: 54321
                        sku: CHAIRS-BL-1
                        name: Black chairs
                        product_category: Furniture
                        country_of_origin: Vietnam
                        product_properties:
                        - type: material
                          value: cotton
                        hs_codes:
                        - description: >-
                            Rock lobster and other sea crawfish ( Palinurus
                            spp. Panulirus spp  Jasus spp. )
                          code: '0306.21'
                      units: 20
                      incoterm: FOB
                      transportation_mode: air
                      unit_of_measure: HUN
                      cargo_ready_date: '2019-02-11'
                      must_arrive_date: '2019-03-11'
                      origin_port:
                      origin_address:
                        _object: /address
                        street_address: 10th YouSong Industrial District
                        street_address2:
                        city: Shenzhen
                        state: '44'
                        country: China
                        country_code: CN
                        timezone: China/Shenzhen
                        zip:
                        unlocode:
                        ref: sellingcoaddress
                      destination_port:
                      destination_address:
                        _object: /address
                        street_address: 1556 20TH ST STE 2D
                        street_address2:
                        city: SANTA MONICA
                        state: CA
                        country: United States
                        country_code: US
                        zip: 90404-3465
                        unlocode:
                        ref: studiosantamonica
                        timezone: America/Los Angeles
                      hs_codes:
                      - _object: /hs_code
                        code: 8309.90.10.00
                        country_code: US
                        description:
                      unit_cost:
                        _object: /money
                        amount: '121.00'
                        currency_code: USD
                      booking_line_items:
                        _object: /api/refs/collection
                        ref_type: /purchase_orders/booking_line_item
                        link: >-
                          https://api.flexport.com/booking_line_items?f.purchase_order_line_item.id=123456
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_order_line_items/123456
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /purchase_orders:
    get:
      tags:
      - PurchaseOrder
      operationId: purchase_order_index
      summary: List all purchase orders
      description: Returns a list of purchase orders
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: Count of items in each page Should be between 1 and 100 (inclusive)
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: sort
        description: >-
          Sort results by the specified field (only `id` is supported at this
          time)
        required: false
        schema:
          type: string
          default: id
          enum:
          - id
      - in: query
        name: direction
        description: Set sort order. Allows "asc"(ascending) or "desc" (descending)
        required: false
        schema:
          type: string
          default: asc
          enum:
          - asc
          - desc
      - in: query
        name: f.archived_at.exists
        description: >-
          Filter out all archived purchase orders (f.archived_at.exists=false)
          or filter out all unarchived purchase orders
          (f.archived_at.exists=true)
        required: false
        schema:
          type: boolean
      - in: query
        name: f.status
        description: Filters the list based on the PO status
        required: false
        schema:
          type: string
          enum:
          - open
          - closed
          - cancelled
      - in: query
        name: f.buyer_ref
        description: Filters the list based on PO buyer
        required: false
        schema:
          type: string
          example: amazon-us
      - in: query
        name: f.seller_ref
        description: Filters the list based on the PO seller
        required: false
        schema:
          type: string
          example: amazon-us
      - in: query
        x-deprecated-after-version: 2
        name: f.role
        description: Filters the list based on which role you take in the PO
        required: false
        schema:
          type: string
          enum:
          - buyer
          - seller
      - in: query
        name: f.shipment.id
        description: >-
          Filter the list based on whether a PO is on the shipment matching
          the provided ID
        required: false
        schema:
          type: integer
          example: 123456
      - in: query
        name: f.name
        description: Filter the list based on PO name
        required: false
        schema:
          type: string
          example: PO-123456
      - in: query
        name: f.updated_at.lt
        description: Filter the list for POs last updated before the provided time
        required: false
        schema:
          type: string
          example: 2022-01-01 18:26:37 PST
      - in: query
        name: f.updated_at.gt
        description: Filter the list for POs last updated after the provided time
        required: false
        schema:
          type: string
          example: 2022-01-01 18:26:37 PST
      - in: query
        name: f.created_at.lt
        description: Filter the list for POs created before the provided time
        required: false
        schema:
          type: string
          example: 2023-01-01 04:52:36 PST
      - in: query
        name: f.created_at.gt
        description: Filter the list for POs created after the provided time
        required: false
        schema:
          type: string
          example: 2023-01-01 04:52:36 PST
      responses:
        '200':
          description: collection of purchase orders
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_orders
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/purchase_orders?page=1&per=10
                      next:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/purchase_orders?page=3&per=10
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/PurchaseOrder'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/purchase_orders?page=13&per=10
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/purchase_orders?page=12&per=10
                      next:
                      data:
                      - _object: /purchase_order
                        id: 123456
                        name: PO1234
                        seller:
                          _object: /company
                          id: 1234
                          name: Seller Co.
                          ref: sellerco
                        buyer:
                          _object: /company
                          id: 2345
                          name: Studio Apparel
                          ref: studio
                        incoterm: FOB
                        transportation_mode: ocean
                        cargo_ready_date: '2019-02-04'
                        must_arrive_date: '2019-03-11'
                        origin_port:
                        origin_address:
                          _object: /address
                          street_address: 10th YouSong Industrial District
                          street_address2:
                          city: Shenzhen
                          state: '44'
                          country: China
                          country_code: CN
                          zip:
                          unlocode:
                          timezone: China/Shenzhen
                          ref: sellingcoaddress
                        destination_port:
                        destination_address:
                          _object: /address
                          street_address: 1556 20TH ST STE 2D
                          street_address2:
                          city: SANTA MONICA
                          state: CA
                          country: United States
                          country_code: US
                          zip: 90404-3465
                          unlocode:
                          timezone: America/Los_Angeles
                          ref: studiosantamonica
                        line_items:
                          _object: /api/refs/collection
                          ref_type: /purchase_orders/line_item
                          link: >-
                            https://api.flexport.com/purchase_order_line_items?f.purchase_order.id=123456
                        memo: FTZ
                        archived_at: '2019-06-05T15:32:08.723Z'
                        created_at: '2019-05-15T23:43:23.333Z'
                        updated_at: '2019-06-05T15:32:08.723Z'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_orders
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /purchase_orders/{id}:
    get:
      tags:
      - PurchaseOrder
      operationId: purchase_order_show
      summary: Retrieve a purchase order
      description: |
        Retrieves the details of a single purchase order.
      parameters:
      - in: path
        name: id
        description: The unique id for the purchase order to be retrieved
        required: true
        schema:
          type: integer
      - in: query
        name: f.purchase_order_version.id
        description: >-
          The id of the version of a purchase order. By default, the latest
          version of the purchase order is used.
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_orders/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/PurchaseOrder'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/purchase_orders/1234
                    version: 2
                    data:
                      _object: /purchase_order
                      id: 123456
                      name: PO1234
                      status: open
                      seller:
                        _object: /company
                        id: 1234
                        name: Seller Co.
                        ref: sellerco
                      buyer:
                        _object: /company
                        id: 2345
                        name: Studio Apparel
                        ref: studio
                      incoterm: FOB
                      transportation_mode: ocean
                      cargo_ready_date: '2019-02-04'
                      must_arrive_date: '2019-03-11'
                      origin_port:
                      origin_address:
                        _object: /address
                        street_address: 10th YouSong Industrial District
                        street_address2: ''
                        city: Shenzhen
                        state: '44'
                        country: China
                        country_code: CN
                        zip:
                        unlocode:
                        timezone: China/Shenzhen
                        ref: sellingcoaddress
                      destination_port:
                      destination_address:
                        _object: /address
                        street_address: 1556 20TH ST STE 2D
                        street_address2: ''
                        city: SANTA MONICA
                        state: CA
                        country: United States
                        country_code: US
                        zip: 90404-3465
                        unlocode:
                        timezone: America/Los_Angeles
                        ref: studiosantamonica
                      line_items:
                        _object: /api/refs/collection
                        ref_type: /purchase_orders/line_item
                        link: >-
                          https://api.flexport.com/purchase_order_line_items?f.purchase_order.id=123456
                      memo: FTZ
                      archived_at: '2019-06-05T15:32:08.723Z'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/purchase_orders/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /shipment_legs:
    get:
      tags:
      - ShipmentLeg
      operationId: shipment_leg_index
      summary: List all shipment route legs
      description: >-
        Returns a list of shipment route legs. The legs are sorted descending by
        creation date.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          default: 1
          minimum: 1
      - in: query
        name: per
        description: >-
          Count of items in each page. Should be between 1 and 100
          (inclusive).
        required: false
        schema:
          type: integer
          example: 20
          default: 20
          minimum: 1
          maximum: 100
      - in: query
        name: f.shipment.id
        description: Only return legs for the shipment specified by this id.
        required: false
        schema:
          type: integer
      - in: query
        name: f.transportation_mode
        description: Only return legs that match the given transportation mode
        required: false
        schema:
          type: integer
      - in: query
        name: f.include_deleted
        description: Returns legs including deleted legs
        required: false
        schema:
          type: boolean
          default: false
        allowEmptyValue: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipment_legs
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/shipment_legs?page=1
                      next:
                        type:
                        - string
                        - 'null'
                        example: https://api.flexport.com/shipment_legs?page=3
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/ShipmentLeg'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/shipment_legs
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev: https://api.flexport.com/shipment_legs?page=1
                      next: https://api.flexport.com/shipment_legs?page=3
                      data:
                      - _object: /shipment_leg
                        id: 948211
                        shipment:
                          _object: /api/refs/object
                          ref_type: /shipment
                          link: https://api.flexport.com/shipments/123
                          id: 123
                        estimated_arrival_date: '2019-02-06T19:28:25.000+00:00'
                        actual_arrival_date: '2019-02-06T19:28:25.000+00:00'
                        estimated_departure_date: '2019-02-06T19:28:25.000+00:00'
                        actual_departure_date: '2019-02-06T19:28:25.000+00:00'
                        deleted_at:
                        additional_dates:
                          cargo_ready_date: '2019-02-06'
                          delivery_appointment_requested_at_date: '2019-07-09T12:00:00.000+08:00'
                          delivery_appointment_requested_for_date: '2019-07-14T12:00:00.000+08:00'
                          delivery_appointment_scheduled_at_date: '2019-07-11T12:00:00.000+08:00'
                          delivery_appointment_scheduled_for_date: '2019-07-14T12:00:00.000+08:00'
                          loaded_on_truck_date: '2019-07-13T12:00:00.000+08:00'
                          delivery_completed: '2019-07-14T12:00:00.000+08:00'
                        origin:
                          _object: /shipment_node
                          tags:
                          - port_of_loading
                          place:
                            _object: /place
                            name: ORD - Chicago - IL
                            address:
                              _object: /address
                              street_address: 10000 West O'Hare Ave
                              street_address2: PO Box 66142
                              city: Chicago
                              state: IL
                              country: United States of America
                              country_code: US
                              zip: '60666'
                              unlocode: US AL2
                              timezone: America/Chicago
                              ref: ''
                            details:
                            - _object: /air/port
                              port_code: '3901'
                              country_code: US
                              iata_code: ORD
                              icao_code: KORD
                            - _object: /trucking/port
                              port_code: '3901'
                          terminal:
                            _object: /shipment_node/terminal
                            name: Terminal 3
                            address:
                              _object: /address
                              street_address: 1645 Settlers Lane
                              street_address2:
                              city: Albany
                              state: MN
                              country: United States of America
                              country_code: US
                              zip: '56307'
                              unlocode: US AL2
                              timezone: America/Chicago
                              ref: address_ref_1
                        destination:
                          _object: /shipment_node
                          tags:
                          - port_of_loading
                          place:
                            _object: /place
                            name: ORD - Chicago - IL
                            address:
                              _object: /address
                              street_address: 10000 West O'Hare Ave
                              street_address2: PO Box 66142
                              city: Chicago
                              state: IL
                              country: United States of America
                              country_code: US
                              zip: '60666'
                              unlocode: US AL2
                              timezone: America/Chicago
                              ref: address_ref_1
                            details:
                            - _object: /air/port
                              port_code: '3901'
                              country_code: US
                              iata_code: ORD
                              icao_code: KORD
                            - _object: /trucking/port
                              port_code: '3901'
                          terminal:
                        transportation_mode: ocean
                        carrier_name: Liberty Carrier
                        air_leg:
                        barge_leg:
                        trucking_leg:
                        rail_leg:
                        ocean_leg:
                          _object: /ocean/shipment_leg
                          scac_code: XJAE
                          vessel_name: Lenox
                          vessel_imo: IMO9074729
                          voyage_number: 059E
                          container_legs:
                            _object: /api/refs/collection
                            ref_type: /ocean/shipment_container_leg
                            link: >-
                              https://api.flexport.com/ocean/shipment_container_legs?f.shipment_container.id=123
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipment_legs
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /shipment_legs/{id}:
    get:
      tags:
      - ShipmentLeg
      operationId: shipment_leg_show
      summary: Retrieve a shipment route leg
      parameters:
      - in: path
        name: id
        description: The unique id for the ShipmentLeg object to be retrieved
        required: true
        schema:
          type: integer
      - in: query
        name: f.include_deleted
        description: Retrieves the leg even if it was deleted
        required: false
        schema:
          type: boolean
          default: false
        allowEmptyValue: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipment_legs/948211
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/ShipmentLeg'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/shipment_legs/948211
                    version: 2
                    data:
                      _object: /shipment_leg
                      id: 948211
                      shipment:
                        _object: /api/refs/object
                        ref_type: /shipment
                        link: https://api.flexport.com/shipments/123
                        id: 123
                      estimated_arrival_date: '2019-02-06T19:28:25.000+00:00'
                      actual_arrival_date: '2019-02-06T19:28:25.000+00:00'
                      estimated_departure_date: '2019-02-06T19:28:25.000+00:00'
                      actual_departure_date: '2019-02-06T19:28:25.000+00:00'
                      additional_dates:
                        cargo_ready_date: '2019-02-06'
                        delivery_appointment_requested_at_date: '2019-07-09T12:00:00.000+08:00'
                        delivery_appointment_requested_for_date: '2019-07-14T12:00:00.000+08:00'
                        delivery_appointment_scheduled_at_date: '2019-07-11T12:00:00.000+08:00'
                        delivery_appointment_scheduled_for_date: '2019-07-14T12:00:00.000+08:00'
                        loaded_on_truck_date: '2019-07-13T12:00:00.000+08:00'
                        delivery_completed: '2019-07-14T12:00:00.000+08:00'
                      origin:
                        _object: /shipment_node
                        tags:
                        - port_of_loading
                        place:
                          _object: /place
                          name: ORD - Chicago - IL
                          address:
                            _object: /address
                            street_address: 10000 West O'Hare Ave
                            street_address2: PO Box 66142
                            city: Chicago
                            state: IL
                            country: United States of America
                            country_code: US
                            zip: '60666'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                          details:
                          - _object: /air/port
                            port_code: '3901'
                            country_code: US
                            iata_code: ORD
                            icao_code: KORD
                          - _object: /trucking/port
                            port_code: '3901'
                        terminal:
                          _object: /shipment_node/terminal
                          name: Terminal 3
                          address:
                            _object: /address
                            street_address: 1645 Settlers Lane
                            street_address2:
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                      destination:
                        _object: /shipment_node
                        tags:
                        - port_of_loading
                        place:
                          _object: /place
                          name: ORD - Chicago - IL
                          address:
                            _object: /address
                            street_address: 10000 West O'Hare Ave
                            street_address2: PO Box 66142
                            city: Chicago
                            state: IL
                            country: United States of America
                            country_code: US
                            zip: '60666'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                          details:
                          - _object: /air/port
                            port_code: '3901'
                            country_code: US
                            iata_code: ORD
                            icao_code: KORD
                          - _object: /trucking/port
                            port_code: '3901'
                        terminal:
                      transportation_mode: ocean
                      carrier_name: Liberty Carrier
                      air_leg:
                      barge_leg:
                      trucking_leg:
                      rail_leg:
                      ocean_leg:
                        _object: /ocean/shipment_leg
                        scac_code: XJAE
                        vessel_name: Lenox
                        vessel_imo: IMO9074729
                        voyage_number: 059E
                        container_legs:
                          _object: /api/refs/collection
                          ref_type: /ocean/shipment_container_leg
                          link: >-
                            https://api.flexport.com/ocean/shipment_container_legs?f.shipment_container.id=123
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipment_legs/948211
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /shipments:
    get:
      tags:
      - Shipment
      operationId: shipment_index
      summary: List all shipments
      description: Returns a list of shipments.
      parameters:
      - in: query
        name: page
        description: Page number of the page to retrieve
        required: false
        schema:
          type: integer
          example: 1
          minimum: 1
      - in: query
        name: per
        description: >-
          Count of items in each page. Should be between 1 and 100
          (inclusive).
        required: false
        schema:
          type: integer
          example: 20
          minimum: 1
          maximum: 100
      - in: query
        name: sort
        description: Sort results by the specified field.
        required: false
        schema:
          type: string
          default: id
          enum:
          - id
          - transportation_mode
          - status
          - updated_at
          - archived_at
      - in: query
        name: direction
        description: Set sort order. Allows "asc" (ascending) or "desc" (descending).
        required: false
        schema:
          type: string
          default: desc
          enum:
          - asc
          - desc
      - in: query
        name: f.transportation_mode
        description: >-
          Filters the list based on the shipment's `transportation_mode`. One
          of `ocean` or `air`.
        required: false
        schema:
          $ref: '#/components/schemas/TransportationMode'
      - in: query
        name: f.status
        description: >-
          Filters the list based on the shipment's `status`. Cannot be used
          with `f.statuses.any`
        required: false
        schema:
          $ref: '#/components/schemas/ShipmentStatus'
      - in: query
        name: f.statuses.any
        description: >-
          Filters the list for all shipments whose `status` is one of the
          passed in statuses. Can pass in multiple comma-separated statuses.
        required: false
        schema:
          $ref: '#/components/schemas/ShipmentStatus'
      - in: query
        name: f.container_number
        description: >-
          Filters the list for shipments that are associated with a container
          specified by the given container number.
        required: false
        schema:
          type: string
          example: BWSE3982156
      - in: query
        name: f.purchase_order
        description: >-
          Filters the list for shipments that are associated with the given
          purchase order number
        required: false
        schema:
          type: string
          example: PO002811
      - in: query
        name: f.sku
        description: >-
          Filters the list for shipments that are associated a product
          identified by the given SKU.
        required: false
        schema:
          type: string
          example: ASA121
      - in: query
        name: f.updated_at.gt
        description: >-
          DEPRECATED -- Filters the list for shipments that where updated
          after the given time
        required: false
        schema:
          type: string
      - in: query
        name: f.updated_at.lt
        description: >-
          DEPRECATED -- Filters the list for shipments that where updated
          before the given time
        required: false
        schema:
          type: string
      - in: query
        name: f.archived_at.gt
        description: >-
          Filters the list for shipments that where archived after the given
          time
        required: false
        schema:
          type: string
      - in: query
        name: f.archived_at.lt
        description: >-
          Filters the list for shipments that where archived before the given
          time
        required: false
        schema:
          type: string
      - in: query
        name: f.master_bill_number
        description: >-
          Filters the list for shipments that are associated with the given
          master bill number
        required: false
        schema:
          type: string
      - in: query
        name: f.house_bill_number
        description: >-
          Filters the list for shipments that are associated with the given
          house bill number
        required: false
        schema:
          type: string
      - in: query
        name: f.consignee_external_ref
        description: >-
          Filters the list for shipments that have the specified company
          entity (denoted by external ref) as a consignee
        required: false
        schema:
          type: string
      - in: query
        name: f.origin_address_ref
        description: >-
          Filters the list for shipments that have a shipment leg with the
          same origin address ref
        required: false
        schema:
          type: string
      - in: query
        name: f.destination_address_ref
        description: >-
          Filters the list for shipments that have a shipment leg with the
          same destination address ref
        required: false
        schema:
          type: string
      - in: query
        name: f.metadata.YOUR_METADATA_KEY
        description: >
          Filters the list for shipments that have a specific metadata
          key-value pair. Multiple metadata filters can be added to a single
          query. If there are multiple metadata filters each with the same
          metadata key, then the filter will return shipments matching any of
          the specified metadata values for that metadata key. Note that keys
          must be URL encoded; e.g.: `f.metadata.PO #=123` is invalid. It
          should instead be `f.metadata.PO%20%23`
        required: false
        schema:
          type: string
      - in: query
        name: f.wants_freight_management_bco
        description: Filters the list based on shipment's wants_freight_management_bco
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_flexport_freight
        description: Filters the list based on shipment's wants_flexport_freight
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_import_customs_service
        description: Filters the list based on shipment's wants_import_customs_service
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_export_customs_service
        description: Filters the list based on shipment's wants_export_customs_service
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_commercial_invoice_transcription
        description: >-
          Filters the list based on shipment's
          wants_commercial_invoice_transcription
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_flexport_insurance
        description: Filters the list based on shipment's wants_flexport_insurance
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_pickup_service
        description: Filters the list based on shipment's wants_pickup_service
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_trade_declaration_service
        description: Filters the list based on shipment's wants_trade_declaration_service
        required: false
        schema:
          type: boolean
      - in: query
        name: f.visibility_only
        description: Filters the list based on shipment's visibility_only flag
        required: false
        schema:
          type: boolean
      - in: query
        name: f.wants_delivery_service
        description: Filters the list based on shipment's wants_delivery_service flag
        required: false
        schema:
          type: boolean
      - in: query
        name: f.belongs_to_a_buyers_consol
        description: >-
          Filters the list based on whether the shipment belongs to a buyer's
          consolidation
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: collection of shipments
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: >-
                      https://api.flexport.com/shipments?page=1&per=20&sort=id&direction=desc
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /api/collections/paginated
                      prev:
                        type:
                        - string
                        - 'null'
                        example:
                      next:
                        type:
                        - string
                        - 'null'
                        example:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Shipment'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: >-
                      https://api.flexport.com/shipments?page=1&per=20&sort=id&direction=desc
                    version: 2
                    data:
                      _object: /api/collections/paginated
                      prev:
                      next:
                      data:
                      - metadata: {}
                        _object: /shipments
                        id: 2983
                        name: ABC Shipment
                        booking:
                          _object: api/refs/object
                          ref_type: /booking
                          link: https://api.flexport.com/bookings/12345
                          id: 12345
                        transportation_mode: ocean
                        freight_type: door_to_door
                        freight_cost: 512.14
                        incoterm: FOB
                        calculated_weight:
                          _object: /quantity/weight
                          value: 2300.4
                          unit: kg
                        calculated_volume:
                          _object: /quantity/volume
                          value: 472.62
                          unit: cbm
                        pieces: 8372
                        it_number: V12345678
                        created_date: '2019-02-06T19:28:25.741Z'
                        status: in_transit_to_arrival_port
                        priority: high
                        updated_at: '2019-02-06T19:28:25.119Z'
                        estimated_departure_date: '2019-02-06T19:28:25+00:00'
                        actual_departure_date: '2019-02-06T19:28:25+00:00'
                        estimated_arrival_date: '2019-02-06T19:28:25+00:00'
                        actual_arrival_date: '2019-02-06T19:28:25+00:00'
                        estimated_picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                        actual_picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                        estimated_delivered_in_full_date: '2019-02-06T19:28:25+00:00'
                        actual_delivered_in_full_date: '2019-02-06T19:28:25+00:00'
                        cargo_ready_date: '2019-02-06'
                        wants_export_customs_service: true
                        wants_import_customs_service: true
                        air_shipment:
                        wants_freight_management_bco: true
                        wants_flexport_freight: true
                        wants_commercial_invoice_transcription: true
                        wants_flexport_insurance: true
                        wants_pickup_service: false
                        wants_trade_declaration_service: false
                        visibility_only: false
                        wants_delivery_service: false
                        wants_214_filing: false
                        wants_ftz_entry: false
                        belongs_to_a_buyers_consol: false
                        child_shipments:
                        parent_shipment:
                        ocean_shipment:
                          _object: /ocean/shipment
                          is_lcl: false
                          house_bill_number: TUWSANR18658
                          master_bill_number: NEWO697216024
                          carrier_booking_number: '697216024'
                          confirmed_space_released_at: '2021-06-08T06:18:46.299Z'
                          containers:
                            _object: /api/refs/collection
                            ref_type: /ocean/shipment_container
                            link: >-
                              https://api.flexport.com/ocean/shipment_containers?f.shipment.id=123
                        dangerous_goods:
                          review_status: complete
                          classifications: []
                        quoted_transit_time_days_min: 10
                        quoted_transit_time_days_max: 20
                        quoted_delivery_date_from: '2023-01-10T16:00:00.000-08:00'
                        quoted_delivery_date_to: '2023-01-20T16:00:00.000-08:00'
                        detention_free_days: 5
                        shipping_order:
                          si_cutoff: '2025-10-02T16:00:00.000Z'
                          cy_cutoff: '2025-10-03T16:00:00.000Z'
                        shippers:
                        - _object: /company_entity
                          id: 9281
                          name: Zoomit
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                          ref: zoomit_ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 123746396
                        consignees:
                        - _object: /company_entity
                          id: 9281
                          name: Zoomit
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                          ref: zoomit_ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 123746396
                        buyers:
                        - _object: /company_entity
                          id: 9281
                          name: Zoomit
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                          ref: zoomit_ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 123746396
                        sellers:
                        - _object: /company_entity
                          id: 9281
                          name: Zoomit
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                          ref: zoomit_ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 123746396
                        importers_of_record:
                        - _object: /company_entity
                          id: 9281
                          name: Zoomit
                          mailing_address:
                            _object: /address
                            street_address: 1641 Settlers Lane
                            street_address2: STE 2918
                            city: Albany
                            state: MN
                            country: United States of America
                            country_code: US
                            zip: '56307'
                            unlocode: US AL2
                            timezone: America/Chicago
                            ref: address_ref_1
                          ref: zoomit_ref
                          vat_numbers:
                          - _object: company_entity/vat_number
                            country_code: US
                            number: US 123746396
                        items:
                        - _object: /shipment_item
                          id: 29820
                          total_units: 523
                          total_weight:
                            _object: /quantity/weight
                            value: 2300.4
                            unit: kg
                          total_volume:
                            _object: /quantity/volume
                            value: 472.62
                            unit: cbm
                          purchase_order_number: PO002811
                          product:
                            _object: /product
                            id: 84291
                            name: AC Adapter 12V
                            sku: WDVCDFD-RM00472
                        container_load_result:
                          _object: /api/refs/object
                          ref_type: /container_load_result
                          link: >-
                            https://api.flexport.com/container_load_results/123
                          id: 123
                        legs:
                          _object: /api/refs/collection
                          ref_type: /shipment_leg
                          link: >-
                            https://api.flexport.com/shipment_legs?f.shipment.id=123
                        customs_entries:
                          _object: /api/refs/collection
                          ref_type: /customs_entry
                          link: >-
                            https://api.flexport.com/customs_entries?f.shipment.id=2983
                        commercial_invoices:
                          _object: /api/refs/collection
                          ref_type: /commercial_invoice
                          link: >-
                            https://api.flexport.com/commercial_invoices?f.shipment.id=2983
                        documents:
                          _object: /api/refs/collection
                          ref_type: /document
                          link: >-
                            https://api.flexport.com/documents?f.shipment.id=2983
                        departure_date: '2019-02-06T19:28:25+00:00'
                        arrival_date: '2019-02-06T19:28:25+00:00'
                        picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                        delivered_in_full_date: '2019-02-06T19:28:25+00:00'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipments
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /shipments/{id}:
    get:
      tags:
      - Shipment
      operationId: shipment_show
      summary: Retrieve a shipment
      description: |
        Retrieves the details of a single shipment.
      parameters:
      - in: path
        name: id
        description: The unique id for the shipment to be retrieved.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipments/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Shipment'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/shipments/1234
                    version: 2
                    data:
                      metadata: {}
                      _object: /shipments
                      id: 2983
                      name: ABC Shipment
                      booking:
                        _object: api/refs/object
                        ref_type: /booking
                        link: https://api.flexport.com/bookings/12345
                        id: 12345
                      transportation_mode: ocean
                      freight_type: door_to_door
                      freight_cost: 512.14
                      incoterm: FOB
                      calculated_weight:
                        _object: /quantity/weight
                        value: 2300.4
                        unit: kg
                      calculated_volume:
                        _object: /quantity/volume
                        value: 472.62
                        unit: cbm
                      pieces: 8372
                      it_number: V12345678
                      created_date: '2019-02-06T19:28:25.741Z'
                      status: in_transit_to_arrival_port
                      priority: high
                      updated_at: '2019-02-06T19:28:25.119Z'
                      estimated_departure_date: '2019-02-06T19:28:25+00:00'
                      actual_departure_date: '2019-02-06T19:28:25+00:00'
                      estimated_arrival_date: '2019-02-06T19:28:25+00:00'
                      actual_arrival_date: '2019-02-06T19:28:25+00:00'
                      estimated_picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                      actual_picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                      estimated_delivered_in_full_date: '2019-02-06T19:28:25+00:00'
                      actual_delivered_in_full_date: '2019-02-06T19:28:25+00:00'
                      cargo_ready_date: '2019-02-06'
                      wants_export_customs_service: true
                      wants_import_customs_service: true
                      air_shipment:
                      wants_freight_management_bco: true
                      wants_flexport_freight: true
                      visibility_only: false
                      wants_delivery_service: false
                      belongs_to_a_buyers_consol: false
                      child_shipments:
                      parent_shipment:
                      ocean_shipment:
                        _object: /ocean/shipment
                        is_lcl: false
                        house_bill_number: TUWSANR18658
                        master_bill_number: NEWO697216024
                        carrier_booking_number: '697216024'
                        confirmed_space_released_at: '2021-06-08T06:18:46.299Z'
                        containers:
                          _object: /api/refs/collection
                          ref_type: /ocean/shipment_container
                          link: >-
                            https://api.flexport.com/ocean/shipment_containers?f.shipment.id=123
                      dangerous_goods:
                        review_status: complete
                        classifications: []
                      shipping_order:
                        si_cutoff: '2025-10-02T16:00:00.000Z'
                        cy_cutoff: '2025-10-03T16:00:00.000Z'
                      shippers:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      consignees:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      buyers:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      sellers:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      importers_of_record:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      items:
                      - _object: /shipment_item
                        id: 29820
                        total_units: 523
                        total_units_unit_of_measure: yds
                        total_weight:
                          _object: /quantity/weight
                          value: 2300.4
                          unit: kg
                        total_volume:
                          _object: /quantity/volume
                          value: 472.62
                          unit: cbm
                        purchase_order_number: PO002811
                        product:
                          _object: /product
                          id: 84291
                          name: AC Adapter 12V
                          sku: WDVCDFD-RM00472
                        additional_quantity:
                          _object: /quantity/quantity
                          value: 50
                          unit: nyds
                        package_quantity:
                          _object: /quantity/quantity
                          value: 21
                          unit: ctn
                        reference: '1234567890'
                      container_load_result:
                        _object: /api/refs/object
                        ref_type: /container_load_result
                        link: https://api.flexport.com/container_load_results/123
                        id: 123
                      legs:
                        _object: /api/refs/collection
                        ref_type: /shipment_leg
                        link: >-
                          https://api.flexport.com/shipment_legs?f.shipment.id=123
                      customs_entries:
                        _object: /api/refs/collection
                        ref_type: /customs_entry
                        link: >-
                          https://api.flexport.com/customs_entries?f.shipment.id=2983
                      commercial_invoices:
                        _object: /api/refs/collection
                        ref_type: /commercial_invoice
                        link: >-
                          https://api.flexport.com/commercial_invoices?f.shipment.id=2983
                      documents:
                        _object: /api/refs/collection
                        ref_type: /document
                        link: https://api.flexport.com/documents?f.shipment.id=2983
                      departure_date: '2019-02-06T19:28:25+00:00'
                      arrival_date: '2019-02-06T19:28:25+00:00'
                      picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                      delivered_in_full_date: '2019-02-06T19:28:25+00:00'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipments/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
    patch:
      tags:
      - Shipment
      operationId: shipment_update
      summary: Update an existing shipment
      parameters:
      - in: path
        name: id
        description: The unique id for the shipment to be updated
        required: true
        schema:
          type: integer
        example: 12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateShipment'
      responses:
        '200':
          description: The updated shipment
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipments/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    $ref: '#/components/schemas/Shipment'
              examples:
                response:
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/shipments/12345
                    version: 2
                    data:
                      metadata:
                        purchase_order:
                        - '12345'
                      _object: /shipments
                      id: 2983
                      name: ABC Shipment
                      booking:
                        _object: api/refs/object
                        ref_type: /booking
                        link: https://api.flexport.com/bookings/12345
                        id: 12345
                      transportation_mode: ocean
                      freight_type: door_to_door
                      freight_cost: 512.14
                      incoterm: FOB
                      calculated_weight:
                        _object: /quantity/weight
                        value: 2300.4
                        unit: kg
                      calculated_volume:
                        _object: /quantity/volume
                        value: 472.62
                        unit: cbm
                      pieces: 8372
                      it_number: V12345678
                      created_date: '2019-02-06T19:28:25+00:00'
                      status: in_transit_to_arrival_port
                      priority: high
                      updated_at: '2019-02-06T19:28:25.119Z'
                      estimated_departure_date: '2019-02-06T19:28:25+00:00'
                      actual_departure_date: '2019-02-06T19:28:25+00:00'
                      estimated_arrival_date: '2019-02-06T19:28:25+00:00'
                      actual_arrival_date: '2019-02-06T19:28:25+00:00'
                      estimated_picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                      actual_picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                      estimated_delivered_in_full_date: '2019-02-06T19:28:25+00:00'
                      actual_delivered_in_full_date: '2019-02-06T19:28:25+00:00'
                      cargo_ready_date: '2019-02-06'
                      wants_export_customs_service: true
                      wants_import_customs_service: true
                      air_shipment:
                      wants_freight_management_bco: true
                      wants_flexport_freight: true
                      visibility_only: false
                      wants_delivery_service: false
                      wants_214_filing: false
                      wants_ftz_entry: false
                      ocean_shipment:
                        _object: /ocean/shipment
                        is_lcl: false
                        house_bill_number: TUWSANR18658
                        master_bill_number: NEWO697216024
                        carrier_booking_number: '697216024'
                        confirmed_space_released_at: '2021-06-08T06:18:46.299Z'
                        containers:
                          _object: /api/refs/collection
                          ref_type: /ocean/shipment_container
                          link: >-
                            https://api.flexport.com/ocean/shipment_containers?f.shipment.id=123
                      dangerous_goods:
                        review_status: complete
                        classifications: []
                      quoted_transit_time_days_min: 10
                      quoted_transit_time_days_max: 20
                      quoted_delivery_date_from: '2023-01-10T16:00:00.000-08:00'
                      quoted_delivery_date_to: '2023-01-20T16:00:00.000-08:00'
                      detention_free_days: 5
                      shipping_order:
                        si_cutoff: '2025-10-02T16:00:00.000Z'
                        cy_cutoff: '2025-10-03T16:00:00.000Z'
                      shippers:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      consignees:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      buyers:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      sellers:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      importers_of_record:
                      - _object: /company_entity
                        id: 9281
                        name: Zoomit
                        mailing_address:
                          _object: /address
                          street_address: 1641 Settlers Lane
                          street_address2: STE 2918
                          city: Albany
                          state: MN
                          country: United States of America
                          country_code: US
                          zip: '56307'
                          unlocode: US AL2
                          timezone: America/Los_Angeles
                          ref: my-address-ref
                        ref: zoomit_ref
                        vat_numbers:
                        - _object: company_entity/vat_number
                          country_code: US
                          number: US 123746396
                      items:
                      - _object: /shipment_item
                        id: 29820
                        total_units: 523
                        total_units_unit_of_measure: yds
                        total_weight:
                          _object: /quantity/weight
                          value: 2300.4
                          unit: kg
                        total_volume:
                          _object: /quantity/volume
                          value: 472.62
                          unit: cbm
                        purchase_order_number: PO002811
                        product:
                          _object: /product
                          id: 84291
                          name: AC Adapter 12V
                          sku: WDVCDFD-RM00472
                        additional_quantity:
                          _object: /quantity/quantity
                          value: 50
                          unit: nyds
                        package_quantity:
                          _object: /quantity/quantity
                          value: 21
                          unit: ctn
                        reference: '1234567890'
                      legs:
                        _object: /api/refs/collection
                        ref_type: /shipment_leg
                        link: >-
                          https://api.flexport.com/shipment_legs?f.shipment.id=123
                      customs_entries:
                        _object: /api/refs/collection
                        ref_type: /customs_entry
                        link: >-
                          https://api.flexport.com/customs_entries?f.shipment.id=2983
                      commercial_invoices:
                        _object: /api/refs/collection
                        ref_type: /commercial_invoice
                        link: >-
                          https://api.flexport.com/commercial_invoices?f.shipment.id=2983
                      documents:
                        _object: /api/refs/collection
                        ref_type: /document
                        link: https://api.flexport.com/documents?f.shipment.id=2983
                      departure_date: '2019-02-06T19:28:25+00:00'
                      arrival_date: '2019-02-06T19:28:25+00:00'
                      picked_up_in_full_date: '2019-02-06T19:28:25+00:00'
                      delivered_in_full_date: '2019-02-06T19:28:25+00:00'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipments/1234
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
  /shipments_shareable:
    post:
      tags:
      - Shipment
      operationId: shipments_shareable
      summary: Create shareable URLs for shipments
      description: >-
        Returns a list of shipments status shareable url.<br><br> **The
        ShipmentShareable POST endpoint needs special permission to access.
        Please contact your Flexport Sales representative if you are interested
        in using this endpoint.**
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                shipment_ids:
                  type: array
                  description: >-
                    A list (length < 10) of the unique id for the shipment to be
                    retrieved.
                  items:
                    type: integer
                    description: The unique id for the shipment to be retrieved.
                    example: 123
                  example:
                  - 123
                  - 456
            example:
              shipment_ids:
              - 123
              - 456
      responses:
        '200':
          description: collection of shipments shareable status url
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipments_shareable
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    properties:
                      _object:
                        type: string
                        example: /shipments_shareable
                      shipments:
                        type: array
                        items:
                          properties:
                            shipment_id:
                              type: integer
                              example: 123
                            shareable_url:
                              type: string
                              example: >-
                                https://app.flexport.com/track_and_trace/Va0y2ckci5Jk
                            expiration_date:
                              type: string
                              example: '2023-06-05T00:14:50.341Z'
              examples:
                response:
                  summary: Success
                  description: Success
                  value:
                    _object: /api/response
                    self: https://api.flexport.com/shipments_shareable
                    version: 2
                    data:
                      _object: /shipments_shareable
                      shipments:
                      - shipment_id: 123
                        shareable_url: >-
                          https://app.flexport.com/track_and_trace/Va0y2ckci5Jk
                        expiration_date: '2023-06-05T00:14:50.341Z'
                      - shipment_id: 456
                        shareable_url: >-
                          https://app.flexport.com/track_and_trace/Va0y2ckci5Jk
                        expiration_date: '2023-06-05T00:14:50.341Z'
        '400':
          description: error
          content:
            application/json:
              schema:
                type: object
                properties:
                  _object:
                    type: string
                    example: /api/response
                  self:
                    type: string
                    example: https://api.flexport.com/shipments_shareable
                  version:
                    type: integer
                    example: 2
                  data:
                    type: object
                    example:
                  error:
                    $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateContainerCounts:
      type: object
      properties:
        twenty_ft:
          type: integer
          description: Quantity of 20 ft containers requested.
          example: 1
        forty_ft:
          type: integer
          description: Quantity of 40 ft containers requested.
          example: 2
        forty_ft_hc:
          type: integer
          description: Quantity of 40 ft HC containers requested.
          example: 3
        forty_five_ft_hc:
          type: integer
          description: Quantity of 45 ft HC containers requested.
          example: 4
    CreateBookingAmendmentHsCode:
      type: object
      required:
      - description
      - hs_code
      properties:
        description:
          type: string
          description: Always required. English description of product in booking.
          example: Wristwatches
        description_for_export_customs:
          type: string
          description: >-
            Required if booking if origin address or origin port is in Mainland
            China. Chinese description of product in booking.
          example: "\u624B\u8868"
        hs_code:
          type: string
          description: >-
            The six digit code under which the product should be classified for
            export customs.
          example: '9101.01'
    VolumeCreate:
      type: object
      properties:
        value:
          type: number
          description: total volume
          example: 472.62
        unit:
          type: string
          description: unit of measurement. "cbm" for cubic meters. "cbft" for cubic
            feet.
          enum:
          - cbm
          - cbft
    WeightCreate:
      type: object
      properties:
        value:
          type: number
          description: Required. Specifies the weight as a float.
          example: 2300.4
        unit:
          type: string
          description: Required. Unit of measurement. "kg" for kilograms, "lbs" for
            pounds
          enum:
          - kg
          - lbs
    LengthCreate:
      type: object
      properties:
        value:
          type: number
          description: Required. Specifies the length as a float.
          example: 100
        unit:
          type: string
          description: >-
            Required. Unit of measurement. "cm" for centimeters. "in" for
            inches.
          example: cm
          enum:
          - cm
          - in
    ShippingUnitCreate:
      type: object
      description: >-
        For detailed cargo, `shipping_units` is required. For simple cargo,
        `shipping_units` is required, but only one should be specified.
      properties:
        name:
          type: string
          description: Optional. Name of the unit of cargo.
          example: Cellular phones
        volume:
          $ref: '#/components/schemas/VolumeCreate'
        weight:
          $ref: '#/components/schemas/WeightCreate'
        height:
          $ref: '#/components/schemas/LengthCreate'
        length:
          $ref: '#/components/schemas/LengthCreate'
        width:
          $ref: '#/components/schemas/LengthCreate'
        count:
          type: integer
          description: Required. Total number of this shipping unit.
          example: 9
        atomic_count:
          type: integer
          description: >-
            Required if `unit_type` = `pallet`. The number of atomic units, i.e.
            units that will not be unpacked and broken up during shipping,
            contained in each shipping unit.
          example: 9
        unit_type:
          type: string
          description: >-
            Required. Packing method of the shipping. This can be `bag`, `bale`,
            `barrel`, `carton`, `crate`, `package`, `pallet`, or `roll`.
          example: pallet
    CreateCargo:
      type: object
      description: >-
        With cargo you have two options, detailed or simple. These are both
        expressed directly on the cargo object. For detailed cargo,
        `shipping_units` is required, and `weight` and `volume` is required in
        the `cargo` object or the `shipping_units` object. For simple cargo,
        `shipping_units` is required, but only one should be specified, and
        `weight` and `volume` are required in the `cargo` object.
      properties:
        volume:
          $ref: '#/components/schemas/VolumeCreate'
        weight:
          $ref: '#/components/schemas/WeightCreate'
        marks_and_numbers:
          type: string
          description: >-
            Optional. Identifying markings and numbers that are visible on the
            cargo.
          example: Fragile
        shipping_units:
          type: array
          items:
            $ref: '#/components/schemas/ShippingUnitCreate'
          example:
          - name: Cellular phones
            volume:
              value: 10.3
              unit: cbm
            weight:
              value: 2300.4
              unit: kg
            height:
              value: 100
              unit: cm
            length:
              value: 100
              unit: cm
            width:
              value: 100
              unit: cm
            count: 9
            atomic_count: 9
            unit_type: pallet
        contains_hazmat:
          type: boolean
          description: Required. Whether the cargo contains hazardous materials.
          example: false
        contains_magnets:
          type: boolean
          description: Required. Whether the cargo contains magnets.
          example: false
        contains_other_dangerous_goods:
          type: boolean
          description: >-
            Required. Whether the cargo contains other non-hazmat, non-magnet,
            non-battery dangerous goods.
          example: false
        contains_li_ion:
          type: boolean
          description: Required. Whether the cargo contains lithium-ion batteries.
          example: false
        contains_non_li_ion_battery:
          type: boolean
          description: >-
            Required. Whether the cargo contains non-lithium-ion batteries, e.g.
            lithium batteries.
          example: false
        lithium_batteries_packing_types:
          type: array
          description: >-
            Required if `contains_li_ion` is `true`. List of ways in which
            lithium-ion batteries will be packed for this booking. This can be a
            subset of `packed_loose`, `packed_with_equipment`,
            `contained_in_equipment`, and
            `contained_in_battery_powered_vehicle`.
          items:
            enum:
            - packed_loose
            - packed_with_equipment
            - contained_in_equipment
            - contained_in_battery_powered_vehicles
          example:
          - packed_loose
    MetadataCreate:
      description: >-
        Metadata has two allowed formats. Either array format or object format.
        Refer to the metadata section in this documentation for more
        information.
      oneOf:
      - type: object
        description: Object format.
        example: '{color: ["red", "blue"], size: ["large", "medium", "small"]}'
        properties:
          example_key:
            type: array
            items:
              type: string
              example:
              - red
              - blue
      - type: array
        description: Array format.
        example: '[{name: "color", value: ["red", "blue"]}'
        items:
          type: object
          properties:
            name:
              type: string
            value:
              type: array
              items:
                type: string
    CreateBookingAmendment:
      type: object
      required:
      - booking_id
      properties:
        booking_id:
          type: integer
          description: Identifier of the existing booking to be modified
          example: 12345
        new_name:
          type: string
          description: Name of the booking.
          example: Valentine's Day - 2020
        amendment_note:
          type: string
          description: Additional message to Flexport regarding the booking amendment.
          example: >-
            This is an amendment note with useful context to changes made to the
            booking
        new_container_counts:
          $ref: '#/components/schemas/CreateContainerCounts'
        new_wants_pickup_service:
          type: boolean
          example: true
        new_wants_import_customs_service:
          type: boolean
          example: true
        new_wants_flexport_freight:
          type: boolean
          example: true
        new_wants_bco:
          type: boolean
          example: true
        new_wants_214_filing:
          type: boolean
          description: Set 214 filing as an additional service
          example: true
        new_wants_ftz_entry:
          type: boolean
          description: Set FTZ entry as an additional service
          example: true
        new_origin_address_ref:
          type: string
          description: >-
            Customizable reference ID of network location that is the pickup
            location.
          example: id-123456
        new_origin_port_us_cbp_port_code:
          type: string
          description: >-
            At most one of `origin_port_us_cbp_port_code` or  `origin_port_loc_code`
            may be specified. Unique port reference code
            used by US Customs and Border Protection.
          example: '57078'
        new_origin_port_loc_code:
          type: string
          description: >-
            At most one of `origin_port_us_cbp_port_code` or  `origin_port_loc_code`
            may be specified. UN code for the origin
            port.
          example: CNYTN
        new_destination_address_ref:
          type: string
          description: >-
            Customizable reference ID of network location that is the delivery
            location.
          example: id-123456
        new_destination_port_us_cbp_port_code:
          type: string
          description: >-
            At most one of `new_destination_port_us_cbp_port_code` or
            `new_destination_port_loc_code` may be specified. Unique port
            reference code used by US Customs and Border Protection.
          example: '57078'
        new_destination_port_loc_code:
          type: string
          description: >-
            At most one of `new_destination_port_us_cbp_port_code` or
            `new_destination_port_loc_code` may be specified. UN code for the
            destination port.
          example: CNYTN
        new_cargo_ready_date:
          type: string
          description: Date when cargo is ready for pickup at the origin location.
          format: date
          example: '2019-06-30'
        new_delivery_date:
          type: string
          description: >-
            Target date by when cargo must be delivered at the destination
            location.
          format: date
          example: '2019-07-31'
        new_product_descriptions:
          description: New product (HS code) information
          type: array
          items:
            $ref: '#/components/schemas/CreateBookingAmendmentHsCode'
        new_cargo:
          $ref: '#/components/schemas/CreateCargo'
        new_metadata:
          $ref: '#/components/schemas/MetadataCreate'
        new_container_references:
          type: object
          description: >-
            Optional. Container-level references for updating existing container
            reference mappings. Maps container numbers to reference type and
            values provided by the client. Used to update container references
            in the Itinerary after containers have been assigned.
          additionalProperties:
            type: object
            additionalProperties:
              type: array
              items:
                type: string
          example:
            ABCU1234567:
              Transport_Order:
              - TO-001
              - TO-002
              Container_Reference_Number:
              - REF-123
            MSCU9876543:
              Container_Reference_Number:
              - REF-456
    ContainerCounts:
      type: object
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always `/container_counts`
            for this object.
          example: /container_counts
        twenty_ft:
          type: integer
          description: Quantity of 20 ft containers requested.
          example: 1
        forty_ft:
          type: integer
          description: Quantity of 40 ft containers requested.
          example: 2
        forty_ft_hc:
          type: integer
          description: Quantity of 40 ft HC containers requested.
          example: 3
        forty_five_ft_hc:
          type: integer
          description: Quantity of 45 ft HC containers requested.
          example: 4
    Address:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /address
        street_address:
          type: string
          example: 1641 Settlers Lane
        street_address2:
          type:
          - string
          - 'null'
          example: STE 2918
        city:
          type: string
          example: Albany
        state:
          type:
          - string
          - 'null'
          example: MN
        country:
          type: string
          example: United States of America
        country_code:
          type: string
          example: US
        zip:
          type:
          - string
          - 'null'
          example: '56307'
        timezone:
          type: string
          example: America/Los_Angeles
        ref:
          type: string
          example: address_ref_x
        unlocode:
          type:
          - string
          - 'null'
          example: US AL2
    HsCode:
      type: object
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always `/hs_code` for this
            object.
          example: /hs_code
        description:
          type:
          - string
          - 'null'
          description: Description of HS or HTS code classification.
          example: >-
            N-Butyl-2,2,6,6-tetramethylpiperidin-4-amine (CAS No. 36177-92-1)
            (provided for in subheading 2933.39.91)
        code:
          type: string
          description: 6 digit (international HS) or 10 digit (US HTS) code.
          example: '9101.00'
        country_code:
          type: string
          example: US
    BookingAmendmentHsCode:
      type: object
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always
            `/booking_amendment_product_description` for this object.
          example: /booking_amendment_product_description
        description:
          type: string
          description: Always required. English description of product in booking.
          example: Wristwatches
        description_for_export_customs:
          type: string
          description: >-
            Required if booking if origin address or origin port is in Mainland
            China. Chinese description of product in booking.
          example: "\u624B\u8868"
        hs_code:
          $ref: '#/components/schemas/HsCode'
    Volume:
      allOf:
      - type: object
        properties:
          _object:
            type: string
            description: Type of the object
            example: /quantity/volume
      - $ref: '#/components/schemas/VolumeCreate'
    Weight:
      allOf:
      - type: object
        properties:
          _object:
            type: string
            description: >-
              String representing the object’s type. Always `/quantity/weight`
              for this object.
            example: /quantity/weight
      - $ref: '#/components/schemas/WeightCreate'
    Length:
      type: object
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always `/quantity/length` for
            this object.
          example: /quantity/length
        value:
          type: number
          description: Required. Specifies the length as a float.
          example: 100
        unit:
          type: string
          description: >-
            Required. Unit of measurement. "cm" for centimeters. "in" for
            inches.
          example: cm
          enum:
          - cm
          - in
    ShippingUnit:
      type: object
      description: >-
        For detailed cargo, `shipping_units` is required. For simple cargo,
        `shipping_units` is required, but only one should be specified.
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always `/shipping_unit` for
            this object.
          example: /shipping_unit
        name:
          type: string
          description: Optional. Name of the unit of cargo.
          example: Cellular phones
        volume:
          $ref: '#/components/schemas/Volume'
        weight:
          $ref: '#/components/schemas/Weight'
        height:
          $ref: '#/components/schemas/Length'
        length:
          $ref: '#/components/schemas/Length'
        width:
          $ref: '#/components/schemas/Length'
        count:
          type: integer
          description: Required. Total number of this shipping unit.
          example: 9
        atomic_count:
          type: integer
          description: >-
            Required if `unit_type` = `pallet`. The number of atomic units, i.e.
            units that will not be unpacked and broken up during shipping,
            contained in each shipping unit.
          example: 9
        unit_type:
          type: string
          description: >-
            Required. Packing method of the shipping. This can be `bag`, `bale`,
            `barrel`, `carton`, `crate`, `package`, `pallet`, or `roll`.
          example: pallet
    Cargo:
      type: object
      description: >-
        With cargo you have two options, detailed or simple. These are both
        expressed directly on the cargo object. For detailed cargo,
        `shipping_units` is required, and `weight` and `volume` is required in
        the `cargo` object or the `shipping_units` object. For simple cargo,
        `shipping_units` is required, but only one should be specified, and
        `weight` and `volume` are required in the `cargo` object.
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always `/cargo` for this
            object.
          example: /cargo
        volume:
          $ref: '#/components/schemas/Volume'
        weight:
          $ref: '#/components/schemas/Weight'
        marks_and_numbers:
          type: string
          description: >-
            Optional. Identifying markings and numbers that are visible on the
            cargo.
          example: Fragile
        shipping_units:
          type: array
          items:
            $ref: '#/components/schemas/ShippingUnit'
          example:
          - name: Cellular phones
            volume:
              value: 10.3
              unit: cbm
            weight:
              value: 2300.4
              unit: kg
            height:
              value: 100
              unit: cm
            length:
              value: 100
              unit: cm
            width:
              value: 100
              unit: cm
            count: 9
            atomic_count: 9
            unit_type: pallet
        contains_hazmat:
          type: boolean
          description: Required. Whether the cargo contains hazardous materials.
          example: false
        contains_magnets:
          type: boolean
          description: Required. Whether the cargo contains magnets.
          example: false
        contains_other_dangerous_goods:
          type: boolean
          description: >-
            Required. Whether the cargo contains other non-hazmat, non-magnet,
            non-battery dangerous goods.
          example: false
        contains_li_ion:
          type: boolean
          description: Required. Whether the cargo contains lithium-ion batteries.
          example: false
        contains_non_li_ion_battery:
          type: boolean
          description: >-
            Required. Whether the cargo contains non-lithium-ion batteries, e.g.
            lithium batteries.
          example: false
        lithium_batteries_packing_types:
          type: array
          description: >-
            Required if `contains_li_ion` is `true`. List of ways in which
            lithium-ion batteries will be packed for this booking. This can be a
            subset of `packed_loose`, `packed_with_equipment`,
            `contained_in_equipment`, and
            `contained_in_battery_powered_vehicle`.
          items:
            enum:
            - packed_loose
            - packed_with_equipment
            - contained_in_equipment
            - contained_in_battery_powered_vehicles
          example:
          - packed_loose
    Metadata:
      type: object
      description: >
        Set of custom key-values specific to the object. The keys are strings
        and values are arrays of strings. The set of valid keys is always the
        consignee's list of keys, even if call was made by a different party.
      example:
        purchase_order:
        - '12345'
        sku:
        - abc123
    BookingAmendment:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /booking_amendment
        id:
          type: integer
          description: Unique identifier for the booking amendment
          example: 334455
        booking_id:
          type: integer
          description: Unique identifier for the booking that this amendment is for
          example: 2963
        is_pending:
          type: boolean
          description: >-
            Depending on various conditions, the requested booking amendment may
            either be accepted and applied instantly, or it may require Flexport
            approval. 'is_pending' is set to true if approval is required.
          example: false
        new_name:
          type: string
          description: The requested new name of the booking
          example: Valentine's Day - 2020
        new_container_counts:
          description: The requested new container count values
          allOf:
          - $ref: '#/components/schemas/ContainerCounts'
        new_wants_import_customs_service:
          type: boolean
          description: The requested new wants-import-customs-service value
          example: true
        new_wants_pickup_service:
          type: boolean
          description: The requested new wants-pickup value
          example: true
        new_wants_flexport_freight:
          type: boolean
          description: The requested new wants-flexport-freight value
          example: true
        new_wants_bco:
          type: boolean
          description: The requested new wants-bco value
          example: true
        new_origin_address:
          description: The requested new origin address
          allOf:
          - $ref: '#/components/schemas/Address'
        new_port_of_loading:
          description: The requested new origin port (port of loading)
          allOf:
          - $ref: '#/components/schemas/Address'
        new_port_of_unloading:
          description: The requested new destination port (port of unloading)
          allOf:
          - $ref: '#/components/schemas/Address'
        new_cargo_ready_date:
          type: string
          description: The requested new cargo ready date
          format: date
        new_delivery_date:
          type: string
          description: The requested new delivery date
          format: date
        new_product_descriptions:
          description: New product (HS code) information
          type: array
          items:
            $ref: '#/components/schemas/BookingAmendmentHsCode'
        new_cargo:
          description: The requested new cargo, possibly including package details
          allOf:
          - $ref: '#/components/schemas/Cargo'
        new_metadata:
          description: The requested new metadata
          allOf:
          - $ref: '#/components/schemas/Metadata'
        new_container_references:
          type: object
          description: >-
            Optional. Container-level references for updating existing container
            reference mappings. Maps container numbers to reference type and
            values provided by the client. Used to update container references
            in the Itinerary after containers have been assigned.
          additionalProperties:
            type: object
            additionalProperties:
              type: array
              items:
                type: string
          example:
            ABCU1234567:
              Transport_Order:
              - TO-001
              - TO-002
              Container_Reference_Number:
              - REF-123
            MSCU9876543:
              Container_Reference_Number:
              - REF-456
    Error:
      type: object
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always /api/error for this
            object.
          example: /api/error
        status:
          type: integer
          description: >-
            The HTTP status code (client or server error) made available for
            consumption from the body of the response.
          example: 400
        code:
          type: string
          description: Specialized identifier for this type of error in our API
          example: unknown_error
        message:
          type: string
          description: Human readable error message
          example: Please try again later.
    BookingRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/object
        ref_type:
          type: string
          example: /booking
        link:
          type: string
          example: https://api.flexport.com/bookings/123
        id:
          type: integer
          example: 123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    PurchaseOrderLineItemRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/object
        ref_type:
          type: string
          example: /purchase_orders/line_item
        link:
          type: string
          example: https://api.flexport.com/purchase_order_line_items/123
        id:
          type: integer
          example: 123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    BookingLineItem:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /purchase_orders/booking_line_item
        id:
          type: integer
          description: Unique identifier for the booking line item
          example: 1234
        booking:
          $ref: '#/components/schemas/BookingRef'
        purchase_order_line_item:
          $ref: '#/components/schemas/PurchaseOrderLineItemRef'
        units:
          type: integer
          description: Number of units of purchase_order_line_item booked on booking
    CreateBookingLineItem:
      type: object
      required:
      - purchase_order_line_item_id
      - booking_id
      - units
      properties:
        purchase_order_line_item_id:
          type: integer
          description: Always required. The identifier of the PO line item to book
          example: 1234
        booking_id:
          type: integer
          description: >-
            Always required. The identifier of the booking to add the PO line
            item to
          example: 4321
        units:
          type: integer
          description: Always required. Number of units to book
          example: 234
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the booking line item should be
            attributed to as creator. The user must belong to your company. If
            omitted, it defaults to your company's admin.
          example: johndoe@flexport.com
    ShipmentRef:
      type: object
      properties:
        _object:
          type: string
          description: Type of Object Returned. In this case, /api/refs/object.
          example: /api/refs/object
        ref_type:
          type: string
          description: Type of Object Referenced. In this case, /shipment.
          example: /shipment
        link:
          type: string
          description: Link to the shipment
          example: https://api.flexport.com/shipments/123
        id:
          type: integer
          description: Unique identifier for the shipment
          example: 123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    VatNumber:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /company_entity/vat_number
        country_code:
          type: string
          description: ISO 3166 two-letter country code
          example: GB
        number:
          type: string
          example: GB 123456789
    CompanyEntity:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /company_entity
        id:
          type: integer
          example: 9281
        name:
          type: string
          example: Zoomit
        ref:
          type: string
          example: zoomit_ref
        mailing_address:
          $ref: '#/components/schemas/Address'
        vat_numbers:
          type: array
          items:
            $ref: '#/components/schemas/VatNumber'
    TransportationMode:
      type: string
      enum:
      - ocean
      - air
      - barge
      - truck
      - rail
      - unknown_transportation
      - ocean_air
      - truck_intl
      - warehouse_storage
      example: ocean
    Airport:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /air/port
        port_code:
          type: string
          example: '3901'
        country_code:
          type: string
          example: US
        iata_code:
          type: string
          example: LAX
        icao_code:
          type: string
          example: KLAX
    Placeport:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          enum:
          - /ocean/railport
          - /trucking/port
          - /ocean/port
          example: /ocean/railport
        port_code:
          type: string
          example: '3901'
    Manufacturer:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /customs/manufacturer
        manufacturer_code:
          type: string
          example: FRLAVIE243BRE
    Place:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          description: Type of the object
          example: /place
        name:
          type: string
          description: Name of the place
          example: ORD - Chicago - IL
        address:
          $ref: '#/components/schemas/Address'
        details:
          type: array
          items:
            anyOf:
            - $ref: '#/components/schemas/Airport'
            - $ref: '#/components/schemas/Placeport'
            - $ref: '#/components/schemas/Manufacturer'
    BookingHsCode:
      type: object
      properties:
        _object:
          type: string
          description: >-
            String representing the object’s type. Always
            `/product_descriptions` for this object.
          example: /bookings/product_descriptions
        description:
          type: string
          description: Always required. English description of product in booking.
          example: Wristwatches
        description_for_export_customs:
          type: string
          description: >-
            Required if booking if origin address or origin port is in Mainland
            China. Chinese description of product in booking.
          example: "\u624B\u8868"
        description_for_export_customs_locale:
          type: string
          description: >-
            Required if booking if origin address or origin port is in Mainland
            China. Code for the locale for description_for_export_customs.
            Currently only `zh_CN`.
          example: zh_CN
        hs_code:
          $ref: '#/components/schemas/HsCode'
    OceanBookingDetail:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          description: Type of the object
          example: /ocean/booking
        is_lcl:
          type: boolean
          example: true
        container_counts:
          $ref: '#/components/schemas/ContainerCounts'
        incoterm:
          type: string
          enum:
          - EXW
          - FOB
          - FAS
          - FCA
          - CPT
          - CFR
          - CIF
          - CIP
          - DAT
          - DAP
          - DDP
          - DPU
          example: FOB
        wants_pickup_service:
          type: boolean
          example: true
        wants_delivery_service:
          type: boolean
          example: false
        origin_port:
          $ref: '#/components/schemas/Place'
        destination_port:
          $ref: '#/components/schemas/Place'
        product_descriptions:
          type: array
          items:
            $ref: '#/components/schemas/BookingHsCode'
    AirBookingDetail:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          description: Type of the object
          example: /air/booking
        incoterm:
          type: string
          enum:
          - EXW
          - FOB
          - FAS
          - FCA
          - CPT
          - CFR
          - CIF
          - CIP
          - DAT
          - DAP
          - DDP
          - DPU
          example: FOB
        wants_pickup_service:
          type: boolean
          example: true
        wants_delivery_service:
          type: boolean
          example: false
        origin_port:
          $ref: '#/components/schemas/Place'
        destination_port:
          $ref: '#/components/schemas/Place'
        product_descriptions:
          type: array
          items:
            $ref: '#/components/schemas/BookingHsCode'
    TruckingBookingDetail:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          description: Type of the object
          example: /trucking/booking
        is_ftl:
          type: boolean
          example: false
        payment_terms:
          type: string
          enum:
          - collect
          - prepaid
          example: collect
        description_of_products:
          type: string
          example: Wristwatches
    BookingLineItemCollectionRef:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /api/refs/collection
        ref_type:
          type: string
          description: Type of the object in this list.
          example: /purchase_orders/booking_line_item
        link:
          type: string
          description: URL to fetch list of objects.
          example: https://api.flexport.com/booking_line_items?f.booking.id=123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    Booking:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /booking
        id:
          type: integer
          description: Unique identifier for the booking
          example: 2983
        name:
          type: string
          description: The name of the booking
          example: PO 12345
        shipment:
          $ref: '#/components/schemas/ShipmentRef'
        status:
          type: string
          enum:
          - archived
          - draft
          - submitted
          - booked
          - shipment
        quote_status:
          type:
          - string
          - 'null'
          enum:
          - pending_quote
          - sent_quote
          - received_quote
          - shared_quote
          - expired_quote
          - ready_to_share_quote
          - accepted_quote
          - received_quote
          - rejected_quote
          - requoted_quote
          - archived_quote
        shipper_entity:
          $ref: '#/components/schemas/CompanyEntity'
        consignee_entity:
          $ref: '#/components/schemas/CompanyEntity'
        notify_party:
          type:
          - string
          - 'null'
          default:
          example: John Doe | john@example.com | 905-555-1234
        transportation_mode:
          $ref: '#/components/schemas/TransportationMode'
        ocean_booking:
          $ref: '#/components/schemas/OceanBookingDetail'
        air_booking:
          $ref: '#/components/schemas/AirBookingDetail'
        trucking_booking:
          $ref: '#/components/schemas/TruckingBookingDetail'
        origin_address:
          $ref: '#/components/schemas/Address'
        cargo_ready_date:
          type: string
          format: date
        destination_address:
          $ref: '#/components/schemas/Address'
        delivery_date:
          type: string
          format: date
        wants_export_customs_service:
          type: boolean
          description: >-
            Determines if the booking requires Flexport to provide export
            customs services.
          example: true
        wants_import_customs_service:
          type: boolean
          description: >-
            Determines if the booking requires Flexport to provide import
            customs services.
          example: true
        cargo:
          $ref: '#/components/schemas/Cargo'
        special_instructions:
          type: string
          example: This message is written in invisible ink.
        booking_line_items:
          $ref: '#/components/schemas/BookingLineItemCollectionRef'
        user_email:
          type: string
          description: Email of the user who created the booking
          example: john@example.com
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        metadata:
          $ref: '#/components/schemas/Metadata'
    CreateBookingHsCode:
      type: object
      required:
      - description
      - hs_code
      properties:
        description:
          type: string
          description: Always required. English description of product in booking.
          example: Wristwatches
        description_for_export_customs:
          type: string
          description: >-
            Required if booking if origin address or origin port is in Mainland
            China. Chinese description of product in booking.
          example: "\u624B\u8868"
        description_for_export_customs_locale:
          type: string
          description: >-
            Required if booking if origin address or origin port is in Mainland
            China. Code for the locale for description_for_export_customs.
            Currently only `zh_CN`.
          example: zh_CN
        hs_code:
          type: string
          description: >-
            The six digit code under which the product should be classified for
            export customs.
          example: '9101.01'
    CreateOceanBooking:
      type: object
      required:
      - is_lcl
      - container_counts
      - incoterm
      - product_descriptions
      - wants_pickup_service
      properties:
        is_lcl:
          type: boolean
          description: >-
            Always required. Whether the booking is for an LCL shipment. If
            false, the booking is FCL. If true, the booking is LCL.
          example: false
        container_counts:
          $ref: '#/components/schemas/CreateContainerCounts'
        incoterm:
          type: string
          description: Always required. The Incoterm of your shipment
          enum:
          - EXW
          - FOB
          - FAS
          - FCA
          - CPT
          - CFR
          - CIF
          - CIP
          - DAT
          - DAP
          - DDP
          - DPU
          example: FOB
        product_descriptions:
          type: array
          items:
            $ref: '#/components/schemas/CreateBookingHsCode'
          example:
          - description: Wristwatches
            description_for_export_customs: "\u624B\u8868"
            description_for_export_customs_locale: zh_CN
            hs_code: '9101.00'
        wants_pickup_service:
          type: boolean
          description: >-
            Always required. Whether transportation is requested from the origin
            location to the port.
          example: true
        wants_delivery_service:
          type: boolean
          description: >-
            Optional. Whether transportation is requested from the destination
            port to destination address. If unknown, then leave as `null`.
          example: true
        origin_port_us_cbp_port_code:
          type: string
          description: >-
            One of `origin_port_us_cbp_port_code` or  `origin_port_loc_code` is
            required if `pickup_service` = `no`. Unique port reference code used
            by US Customs and Border Protection.
          example: '57078'
        origin_port_loc_code:
          type: string
          description: >-
            One of `origin_port_us_cbp_port_code` or  `origin_port_loc_code` is
            required if `pickup_service` = `no`. Unique port reference code used
            by US CBP.
          example: CNYTN
        destination_port_us_cbp_port_code:
          type: string
          description: >-
            Optional, provide one of `destination_port_us_cbp_port_code` or
            `destination_port_loc_code`. Unique port reference code published in
            the United Nations Code for Trade and Transport Locations
            (UN/LOCODE).
          example: '2704'
        destination_port_loc_code:
          type: string
          description: >-
            Optional, provide one of `destination_port_us_cbp_port_code` or
            `destination_port_loc_code`. Unique port reference code published in
            the United Nations Code for Trade and Transport Locations
            (UN/LOCODE).
          example: USLAX
        container_references:
          type: object
          description: >-
            Optional. Container-level references provided by client before
            actual container numbers are assigned. These references are used
            throughout the shipment lifecycle until actual container numbers are
            available. Maps container size types to arrays of reference objects
            containing client-provided identifiers.
          additionalProperties:
            type: array
            items:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
          example:
            twenty_ft:
            - Transport_Order:
              - Transport Order 1
              - Transport Order 2
              Container_Reference_Number:
              - Container Reference Number 1
              - Container Reference Number 2
              Consignor_Reference_Number:
              - Consignor's reference number 1
              - Consignor's reference number 2
            forty_ft:
            - Transport_Order:
              - Transport Order 1
              - Transport Order 2
              Container_Reference_Number:
              - Container Reference Number 1
              - Container Reference Number 2
    CreateAirBooking:
      type: object
      description: >-
        If a non-null value is passed in for 'air_booking', then the new booking
        will be assumed to be an air booking, even if the 'ocean_booking' or
        'trucking_booking' fields are set.
      required:
      - incoterm
      - product_descriptions
      - wants_pickup_service
      properties:
        incoterm:
          type: string
          enum:
          - EXW
          - FOB
          - FAS
          - FCA
          - CPT
          - CFR
          - CIF
          - CIP
          - DAT
          - DAP
          - DDP
          - DPU
          example: FOB
        product_descriptions:
          type: array
          items:
            $ref: '#/components/schemas/CreateBookingHsCode'
        wants_pickup_service:
          type: boolean
          description: >-
            Always required. Whether transportation is requested from the origin
            location to the port.
          example: true
        wants_delivery_service:
          type: boolean
          description: >-
            Optional. Whether transportation is requested from the destination
            port to destination address. If unknown, then leave as `null`.
          example: true
        origin_port_us_cbp_port_code:
          type: string
          description: >-
            One of `origin_port_us_cbp_port_code`, `origin_port_loc_code`,
            `origin_port_iata_code`, or `origin_port_icao_code` is required if
            `pickup_service` = `no`. Unique port reference code used by US CBP,
            not applicable for non-US airports.
          example:
        origin_port_loc_code:
          type: string
          description: >-
            One of `origin_port_us_cbp_port_code`, `origin_port_loc_code`,
            `origin_port_iata_code`, or `origin_port_icao_code` is required if
            `pickup_service` = `no`. Unique port reference code published in the
            UN/LOCODE.
          example: HKHKG
        origin_port_iata_code:
          type: string
          description: >-
            One of `origin_port_us_cbp_port_code`, `origin_port_loc_code`,
            `origin_port_iata_code`, or `origin_port_icao_code` is required if
            `pickup_service` = `no`. Unique airport reference code used by IATA.
          example: HKG
        origin_port_icao_code:
          type: string
          description: >-
            One of `origin_port_us_cbp_port_code`, `origin_port_loc_code`,
            `origin_port_iata_code`, or `origin_port_icao_code` is required if
            `pickup_service` = `no`. Unique airport reference code used by ICAO.
          example: VHHH
        destination_port_us_cbp_port_code:
          type: string
          description: >-
            Optional, provide one of `destination_port_us_cbp_port_code`,
            `destination_port_loc_code`, `destination_port_iata_code`, or
            `destination_port_icao_code`. Unique port reference code used by US
            CBP, not applicable for non-US airports.
        destination_port_loc_code:
          type: string
          description: >-
            Optional, provide one of `destination_port_us_cbp_port_code`,
            `destination_port_loc_code`, `destination_port_iata_code`, or
            `destination_port_icao_code`. Unique port reference code published
            in the UN/LOCODE.
        destination_port_iata_code:
          type: string
          description: >-
            Optional, provide one of `destination_port_us_cbp_port_code`,
            `destination_port_loc_code`, `destination_port_iata_code`, or
            `destination_port_icao_code`. Unique airport reference code used by
            IATA.
        destination_port_icao_code:
          type: string
          description: >-
            Optional, provide one of `destination_port_us_cbp_port_code`,
            `destination_port_loc_code`, `destination_port_iata_code`, or
            `destination_port_icao_code`. Unique airport reference code used by
            ICAO.
    CreateTruckingBooking:
      type: object
      required:
      - is_ltl
      - payment_terms
      properties:
        is_ltl:
          type: boolean
          description: >-
            Whether the booking is for an LTL shipment. If false, the booking is
            FTL. If true, then the booking is LTL.
          example: true
        payment_terms:
          type: string
          description: >-
            Whether the shipper or consignee is responsible for payment of
            trucking freight. This can be `collect` (consignee) or `prepaid`
            (shipper).
          example: collect
          enum:
          - collect
          - prepaid
        description_of_products:
          type: string
          description: General description of the products in the shipment.
          example: watches
    CreateBooking:
      type: object
      required:
      - name
      - shipper_entity_ref
      - consignee_entity_ref
      - origin_address_ref
      - destination_address_ref
      - cargo_ready_date
      - wants_export_customs_service
      - cargo
      properties:
        name:
          type: string
          description: Always required. Name of the booking.
          example: PO 123
        shipper_entity_ref:
          type: string
          description: >-
            Always required. Customizable reference ID of company entity that is
            the shipper of the booking.
          example: shipper_company_name_ltd
        consignee_entity_ref:
          type: string
          description: >-
            Always required. Customizable reference ID of company entity that is
            the consignee of the booking.
          example: consignee_company_name_llc
        notify_party:
          type:
          - string
          - 'null'
          description: >-
            Optional. Name and address of company that is the notify party of
            the booking. If null, then this is the same as consignee.
          example: John Doe, doe@example.com
        ocean_booking:
          $ref: '#/components/schemas/CreateOceanBooking'
        air_booking:
          $ref: '#/components/schemas/CreateAirBooking'
        trucking_booking:
          $ref: '#/components/schemas/CreateTruckingBooking'
        origin_address_ref:
          type: string
          description: >-
            Always required. Customizable reference ID of network location that
            is the pickup location.
          example: id-123456
        destination_address_ref:
          type: string
          description: >-
            Always required for trucking bookings. Always required for air and
            ocean bookings if `wants_delivery_service` is TRUE. Customizable
            reference ID of network location that is the delivery location.
          example: id-123456
        cargo_ready_date:
          type: string
          description: >-
            Always required. Date when cargo is ready for pickup at the origin
            location.
          format: date
          example: '2019-06-30'
        delivery_date:
          description: Optional. Target date by when cargo must be delivered.
          type: string
          format: date
          example: '2019-07-23'
        wants_export_customs_service:
          description: >-
            Always required. Whether the booking requires Flexport to provide
            export customs services.
          type: boolean
          example: false
        wants_flexport_freight:
          description: >-
            Optional. Whether the booking requires Flexport to provide freight
            services.
          type: boolean
          example: false
        wants_import_customs_service:
          description: >-
            Optional. Whether the booking requires Flexport to provide import
            customs services.
          type: boolean
          example: false
        wants_bco:
          description: >-
            Optional. Whether the booking requires Flexport to provide BCO
            services.
          type: boolean
          example: false
        cargo:
          $ref: '#/components/schemas/CreateCargo'
        special_instructions:
          type: string
          description: Additional instructions not included in rest of booking form.
          example: Please book 40ft reefer container.
        metadata:
          $ref: '#/components/schemas/MetadataCreate'
        declared_as_strategy:
          type: string
          enum:
          - yes
          - no
          - notsure
          example: yes
          description: >-
            Required when origin or destination port is Hong Kong. Does your
            shipment contain goods subject to export control regulations? Export
            Control Regulations include dual use item control, Hong Kong
            strategic commodity control, US and EU export control, etc.
        eccn_codes:
          type: string
          example: 3A001, 5A002
          description: >-
            Required when declared_as_strategy is "yes". Please provide the ECCN
            codes (Export Control Classification Number) of the products subject
            to export control regulations. Make sure you find the right ECCN
            codes in the Commerce Control List. Make sure you provide the
            correct format of the ECCN code (five character alpha-numeric such
            as 3A001, 5A002, etc) seperated by commas. According to the laws,
            providing the wrong ECCN information might cause fines.
        flow_direct:
          type: boolean
          default: false
          description: >-
            Optional. Whether to create Flow Direct Quote for the Booking.
            Currently, only Ocean LCL Booking is supported
          example: true
        user_email:
          type: string
          description: >-
            Optional. Email address of the user who created the booking. If
            omitted, the email of the client's admin will be used by default.
            The email address must belong to a user within the client's
            organization.
          example: john@example.com
    MoneyCreate:
      type: object
      properties:
        amount:
          type: string
          format: decimal
          example: '12.34'
        currency_code:
          type: string
          example: USD
    Money:
      allOf:
      - type:
        - object
        - 'null'
        properties:
          _object:
            type: string
            description: Type of the object. Always /money for this object.
            example: /money
      - $ref: '#/components/schemas/MoneyCreate'
    CommercialInvoiceLineItemContainerNumber:
      type: object
      properties:
        id:
          type: integer
          example: 123
        container_number:
          type: string
          example: ABCD123123
        commercial_invoice_line_item_id:
          type: integer
          example: 123
        deleted_at:
          type:
          - string
          - 'null'
          format: date-time
          example:
        created_at:
          type: string
          format: date-time
          example: '2020-01-01T15:28:03.265Z'
        updated_at:
          type: string
          format: date-time
          example: '2020-01-01T15:28:03.265Z'
    ProductRef:
      type: object
      properties:
        _object:
          type: string
          example: api/refs/object
        ref_type:
          type: string
          example: /product
        link:
          type: string
          example: https://api.flexport.com/products/12345
        id:
          type: integer
          example: 12345
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    CommercialInvoiceLineItem:
      type: object
      properties:
        _object:
          type: string
          description: >-
            Type of the object. Always /commercial_invoice_line_item for this
            object.
          example: /commercial_invoice_line_item
        id:
          type: integer
          example: 12345
        document_line_number:
          type: integer
          example: 4
        price_per_unit:
          $ref: '#/components/schemas/Money'
        first_sale_value:
          $ref: '#/components/schemas/Money'
        value:
          $ref: '#/components/schemas/Money'
        net_value:
          $ref: '#/components/schemas/Money'
        total_units:
          type: integer
          example: 10
        container_number:
          $ref: '#/components/schemas/CommercialInvoiceLineItemContainerNumber'
        purchase_order_number:
          type: string
          example: 9876-ABC
        po_line_item_number:
          type: string
          example: 12
          description: Purchase order line item number
        weight:
          allOf:
          - $ref: '#/components/schemas/Weight'
          description: Weight including any associated packaging (padding, foam, etc).
        volume:
          $ref: '#/components/schemas/Volume'
        net_weight:
          allOf:
          - $ref: '#/components/schemas/Weight'
          description: Weight excluding packaging.
        net_net_weight:
          allOf:
          - $ref: '#/components/schemas/Weight'
          description: Weight excluding packaging, tags, labels, instruction manuals,
            etc.
        manufacturer_address:
          $ref: '#/components/schemas/Address'
        manufacturer_name:
          type: string
          example: Company Name
        product:
          $ref: '#/components/schemas/ProductRef'
        metadata:
          $ref: '#/components/schemas/Metadata'
    CompanyEntityRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/object
        ref_type:
          type: string
          example: /company_entity
        link:
          type: string
          example: https://api.flexport.com/network/company_entities/12345
        id:
          type: integer
          example: 12345
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    CustomsInvolvedParty:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /customs/involved_party
        address:
          $ref: '#/components/schemas/Address'
        company_entity:
          $ref: '#/components/schemas/CompanyEntityRef'
        name:
          type: string
          description: The name of involved party.
          example: The West Coast Company
        type:
          type: string
          description: The type of involved party.
          example: consignee
    CommercialInvoice:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always /commercial_invoice for this object.
          example: /commercial_invoice
        id:
          type: string
          description: Unique identifier for the commercial invoice.
          example: abcxyz-23456-def
        invoice_number:
          type: string
          description: >-
            Invoice number on the commercial invoice, typically used for display
            purposes.
          example: INVOICE-04-05-2020
        digitization_status:
          type:
          - string
          - 'null'
          enum:
          - pending
          - reviewed
          - complete
          description: >-
            Status about if the digitization process for this commercial invoice
            is complete. If it is not complete, then the commercial invoice
            should be considered a draft that can change.
          example: complete
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/CommercialInvoiceLineItem'
        involved_parties:
          type: array
          items:
            $ref: '#/components/schemas/CustomsInvolvedParty'
        is_related_parties:
          type: boolean
          description: Whether there was a related parties transaction as defined
            by CBP.
          example: false
        manufacturer_addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        metadata:
          $ref: '#/components/schemas/Metadata'
        shipment:
          $ref: '#/components/schemas/ShipmentRef'
        total_unit_count:
          type: string
          description: Total units on this commercial invoice.
          example: '123.0'
        total_value:
          $ref: '#/components/schemas/Money'
        total_volume:
          $ref: '#/components/schemas/Volume'
        total_weight:
          $ref: '#/components/schemas/Weight'
        order_number:
          type: string
          description: >-
            Represents the which order the invoice is linked to. This can be
            null.
        currency:
          type: string
          example: USD
        invoice_date:
          type: string
          description: Represents date of the invoice. This can be null.
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
          description: Represents the last time the invoice was updated. This can
            be null.
          example: '2020-01-01T15:28:03.265Z'
    ContainerLoadResultContainerInfo:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /container_load_result_container_info
        container_number:
          type: string
          description: The container number
          example: MAEU123456
        seal_number:
          type: string
          description: The seal number for the container
          example: SEAL123456
        container_size:
          type: string
          description: The size of the container
          example: twenty_ft
          enum:
          - twenty_ft
          - forty_ft
          - forty_ft_hc
          - forty_five_ft
        container_type:
          type: string
          description: The type of container
          example: dry
          enum:
          - dry
          - flat_rack
          - headload
          - open
          - reefer
          - tank
          - ventilated
          - bulk
          - special
    ContainerLoadResultItem:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /container_load_result_item
        units:
          type: string
          description: The number of units of this item that were packed into the
            package
          example: '100.00'
        purchase_order_line_item:
          $ref: '#/components/schemas/PurchaseOrderLineItemRef'
    ContainerLoadResultPackage:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /container_load_result_package
        count:
          type:
          - integer
          - 
          description: The number of packages
          example: 10
        unit_of_measure:
          type:
          - string
          - 
          description: Unit of measure for the packages
          enum:
          - BBL
          - CAR
          - CGM
          - CKG
          - CM
          - CM2
          - CTN
          - CYK
          - DPC
          - DPR
          - DS
          - FBM
          - G
          - GBQ
          - GR
          - GRL
          - HUN
          - IRG
          - JWL
          - K
          - KG
          - KM
          - KM3
          - KWH
          - L
          - LNM
          - M
          - M2
          - M3
          - MBQ
          - NO
          - OSG
          - PCS
          - PDG
          - PFL
          - PK
          - PRS
          - PTG
          - PX
          - RHG
          - RUG
          - T
          - TDWB
          - W
          - X
          example: BBL
        gross_weight_kg:
          type:
          - string
          - 
          description: The gross weight of the package in kilograms
          example: '150.75'
        net_weight_kg:
          type:
          - string
          - 
          description: The net weight of the package in kilograms
          example: '140.50'
        gross_volume_cbm:
          type:
          - string
          - 
          description: The gross volume of the package in cubic meters
          example: '2.5'
        items:
          type: array
          description: A list of items in the package
          items:
            $ref: '#/components/schemas/ContainerLoadResultItem'
    ContainerLoadResultGroup:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /container_load_result_group
        total_packages:
          type:
          - integer
          - 
          description: The total number of packages in the container load result group
          example: 25
        total_packed_units:
          type: string
          description: The total number of packed units in the container load result
            group
          example: '1500'
        total_weight_kg:
          type:
          - string
          - 
          description: The total weight of the container load result group in kilograms
          example: '2500.75'
        total_volume_cbm:
          type:
          - string
          - 
          description: The total volume of the container load result group in cubic
            meters
          example: '45.25'
        container_info:
          $ref: '#/components/schemas/ContainerLoadResultContainerInfo'
          description: >-
            Information about the ocean container used for this container load
            result group. Only included for FCL ocean shipments.
        packages:
          type: array
          description: A list of packages in the container load result group
          items:
            $ref: '#/components/schemas/ContainerLoadResultPackage'
    ContainerLoadResult:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /container_load_result
        id:
          type: integer
          description: A unique identifier for the container load result
          example: 1234
        groups:
          type: array
          description: A list of container load result groups
          items:
            $ref: '#/components/schemas/ContainerLoadResultGroup'
    CustomsEntry:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always /customs_entry for this object.
          example: /customs_entry
        id:
          type: string
          format: string
          description: Unique identifier for the customs entry.
        entry_number:
          type: string
        release_status:
          type: string
          description: The release status for this entry.
          enum:
          - cleared
          - customs_hold
          - pending
        release_date:
          type: string
          format: date
          description: The cargo release date for this entry.
        shipment:
          $ref: '#/components/schemas/ShipmentRef'
    FileMetadata:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always /file_metadata for this object.
          example: /file_metadata
        size:
          type: integer
          description: Size of the file in bytes
          example: 20000
        uploaded_at:
          type: string
          format: string
          description: Date this document was uploaded.
    Document:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always /document for this object.
          example: /document
        id:
          type: string
          format: string
          description: Unique identifier for the document
        file_name:
          type: string
        document_type:
          type: string
          format: string
          description: Type of the document.
        memo:
          type:
          - string
          - 'null'
          description: A short message or description about the document
        file_link:
          type: string
          format: uri
          description: The link that can be used to download the file.
        archived_at:
          type:
          - string
          - 'null'
          format: date-time
          description: >-
            Date-time string when this document was archived. Null if not
            archived.
        file_metadata:
          $ref: '#/components/schemas/FileMetadata'
        shipment:
          $ref: '#/components/schemas/ShipmentRef'
    CreateDocument:
      type: object
      required:
      - file_name
      - mime_type
      - document_type
      - document
      - shipment_id
      properties:
        file_name:
          type: string
          description: Name of the document.
          example: Flexport-Booking.pdf
        mime_type:
          type: string
          description: >-
            A two type descriptor describing the media type associated with the
            document.
          example: application/pdf
        document_type:
          type: string
          description: Type of document.
          example: packing_list
        memo:
          type: string
          description: Document memo or message.
          example:
        document:
          type: string
          description: Document represented in a strict Base64-encoded string.
          example: SGVsbG8sIFdvcmxkIQ==
        user_email:
          type: string
          description: >-
            Email of the user that will be listed as the document's uploader. If
            omitted, it will default to the company's admin.
          example: johndoe@flexport.com
        shipment_id:
          type: integer
          description: Corresponding shipment for the document.
          example: 1234567
    GenericObjectRef:
      type: object
      properties:
        _object:
          type: string
        link:
          type: string
        ref_type:
          type: string
        id:
          oneOf:
          - type: string
          - type: integer
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    FreightType:
      type: string
      enum:
      - port_to_door
      - port_to_port
      - door_to_door
      - door_to_port
      example: port_to_door
    ShipmentStatus:
      type: string
      enum:
      - seller_location
      - origin_stop_off
      - in_transit_to_departure_port
      - departure_port
      - in_transit_to_intermediary_port
      - intermediary_port
      - in_transit_to_arrival_port
      - arrival_port
      - deconsolidation
      - in_transit_to_final_destination
      - destination_stop_off
      - gated_out
      - final_destination
      example: in_transit_to_arrival_port
    ContainerCollectionRef:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /api/refs/collection
        ref_type:
          type: string
          description: Type of the object in this list.
          example: /ocean/shipment_container
        link:
          type: string
          description: URL to fetch list of objects.
          example: https://api.flexport.com/ocean/shipment_containers?f.shipment.id=123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    OceanShipmentDetail:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          description: Type of the object
          example: /ocean/shipment
        is_lcl:
          type: boolean
          example: false
        house_bill_number:
          type: string
          example: TUWSANR18658
        master_bill_number:
          type: string
          example: NEWO697216024
        carrier_booking_number:
          type: string
          example: '697216024'
        confirmed_space_released_at:
          type: string
          format: date-time
          example: '2021-06-08T06:18:46.299Z'
          description: >-
            the date-time at which the carrier confirms space release related to
            the shipping order
        containers:
          $ref: '#/components/schemas/ContainerCollectionRef'
    AirShipmentDetail:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          description: Type of the object
          example: /air/shipment
        house_airway_bill:
          type: string
          example: HWXJKE67732
        master_airway_bill:
          type: string
          example: '22831046871'
        chargeable_weight:
          $ref: '#/components/schemas/Weight'
        chargeable_volume:
          $ref: '#/components/schemas/Volume'
    TruckShipmentDetail:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          description: Type of the object
          example: /trucking/shipment
        house_bill_number:
          type: string
          example: FLXT00001804058A
        master_bill_number:
          type: string
          example: CMDU8847383
    ShipmentDangerousGoods:
      type: object
      properties:
        _object:
          type: string
          description: Type of this object
          example: /shipment/dangerous_goods
        review_status:
          type:
          - string
          - 'null'
          enum:
          - pending
          - in_progress
          - complete
          - denied
          - not_applicable
          - misflagged
          example: pending
        is_dangerous:
          type:
          - string
          enum:
          - yes
          - no
          - not_specified
          example:
          - no
        classifications:
          type: array
          description: >-
            Array of numeric UN codes that combine both the class and the
            division of the dangerous good classification
          items:
            type: string
          example:
          - '1.2'
          - '2'
    ProductProperty:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /product/property
        type:
          type: string
          description: Type of this property
          example: color
        value:
          type: string
          description: Value of this property
          example: blue
    Fee:
      type: object
      description: Fee associated with a classification.
      required:
      - fee_type
      - fee_status
      properties:
        fee_type:
          type: string
          description: Type of fee
          enum:
          - cotton
        fee_status:
          type: string
          description: Status of the fee
          enum:
          - applied
          - pending
          - exempt
    ProductClassification:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /product/classification
        codes:
          type: array
          description: An array of HS codes for this product in the provided region
          items:
            type: string
            example: '0301.00'
        region:
          type: string
          description: >-
            The region for this classification. Currently only 2-character ISO
            codes and "EU" are supported
          example: US
        fees:
          type: array
          description: An array of fees associated with this classification
          items:
            $ref: '#/components/schemas/Fee'
    Product:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /product
        id:
          type: integer
          description: The Flexport id used to refer to the product
          example: 84291
        name:
          type: string
          description: The name of the product
          example: AC Adapter 12V
        sku:
          type: string
          description: The SKU used to refer to the product
          example: WDVCDFD-RM00472
        description:
          type: string
          description: Description of product
          example: The best 12V AC Adapter on the market
        archived_at:
          type:
          - string
          - 'null'
          format: date-time
          description: >-
            If the product has been archived, the time it was archived. If the
            product is still active this will be null.
          example: '2019-01-18T22:08:38.599Z'
        product_category:
          type: string
          description: The category to group this product under
          example: Cosmetics
        country_of_origin:
          type: string
          description: >-
            [DEPRECATED] - Use the country_of_origin on the supplier field. The
            country the product was manufactured
          deprecated: true
          example: China
        client_verified:
          type: boolean
          description: Indicates whether Client has verified this Product.
          example: true
        product_properties:
          type: array
          description: A user defined set of key-value objects to describe the product
          items:
            $ref: '#/components/schemas/ProductProperty'
        hs_codes:
          type: array
          description: DEPRECATED - HS codes can be found in the classifications array
          deprecated: true
          items:
            $ref: '#/components/schemas/HsCode'
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/ProductClassification'
    QuantityCreate:
      type: object
      properties:
        value:
          type: number
          description: quantity
          example: 5
        unit:
          type: string
          description: >-
            unit of measurement. "yds" for yards. "nyds" for net yards. "gyds"
            for gross yards. "sqft" for square feet. "sqm" for square meters.
            "rls" for rolls. "ctn" for cartons. "hds" for hides. "ea" for each.
            "crts" for crates.
          enum:
          - yds
          - nyds
          - gyds
          - sqft
          - sqm
          - rls
          - ctn
          - hds
          - ea
          - crts
    Quantity:
      allOf:
      - type: object
        properties:
          _object:
            type: string
            description: Type of the object
            example: /quantity/quantity
      - $ref: '#/components/schemas/QuantityCreate'
    ShipmentItem:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /shipment_item
        id:
          type: integer
          example: 29820
        total_units:
          type: integer
          example: 523
        total_weight:
          $ref: '#/components/schemas/Weight'
        total_volume:
          $ref: '#/components/schemas/Volume'
        purchase_order_number:
          type: string
          example: PO002811
        product:
          $ref: '#/components/schemas/Product'
        total_units_unit_of_measure:
          type: string
          description: >-
            unit of measurement for total_units. "yds" for yards. "nyds" for net
            yards. "gyds" for gross yards. "sqft" for square feet. "sqm" for
            square meters. "rls" for rolls. "ctn" for cartons. "hds" for hides.
            "ea" for each. "crts" for crates.
          enum:
          - yds
          - nyds
          - gyds
          - sqft
          - sqm
          - rls
          - ctn
          - hds
          - ea
          - crts
        additional_quantity:
          $ref: '#/components/schemas/Quantity'
        package_quantity:
          $ref: '#/components/schemas/Quantity'
        reference:
          type: string
          example: 1234567890
    LegCollectionRef:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /api/refs/collection
        ref_type:
          type: string
          description: Type of the object in this list.
          example: /shipment_leg
        link:
          type: string
          description: URL to fetch list of objects.
          example: https://api.flexport.com/shipment_legs?f.shipment.id=123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    CustomsEntryCollectionRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/collection
        ref_type:
          type: string
          example: /customs_entry
        link:
          type: string
          example: https://api.flexport.com/customs_entries?f.shipment.id=2983
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    CommercialInvoiceCollectionRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/collection
        ref_type:
          type: string
          example: /commercial_invoice
        link:
          type: string
          example: https://api.flexport.com/commercial_invoices?f.shipment.id=2983
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    DocumentCollectionRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/collection
        ref_type:
          type: string
          example: /document
        link:
          type: string
          example: https://api.flexport.com/document?f.shipment.id=2983
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    ContainerLoadResultRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/object
        ref_type:
          type: string
          example: /container_load_plan
        link:
          type: string
          example: https://api.flexport.com/container_load_plans/123
        id:
          type: integer
          example: 123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    Shipment:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/Metadata'
        _object:
          type: string
          description: Type of the object
          example: /shipments
        id:
          type: integer
          description: Unique identifier for the shipment
          example: 2983
        name:
          type: string
          description: The name of the shipment
          example: ABC Shipment
        booking:
          $ref: '#/components/schemas/GenericObjectRef'
        transportation_mode:
          $ref: '#/components/schemas/TransportationMode'
        freight_type:
          $ref: '#/components/schemas/FreightType'
        freight_cost:
          type: string
          description: The dollar amount spent on freight
          example: '512.14'
        incoterm:
          type: string
          enum:
          - EXW
          - FOB
          - FAS
          - FCA
          - CPT
          - CFR
          - CIF
          - CIP
          - DAT
          - DAP
          - DDP
          - DPU
          example: FOB
        calculated_weight:
          $ref: '#/components/schemas/Weight'
        calculated_volume:
          $ref: '#/components/schemas/Volume'
        pieces:
          type: integer
          example: 8372
        it_number:
          type: string
          description: Inbond Transit number used for US Customs
          example: V12345678
        created_date:
          type: string
          description: Date the user confirmed the Flexport quote for this Shipment
          format: date-time
        status:
          $ref: '#/components/schemas/ShipmentStatus'
        priority:
          type: string
          enum:
          - standard
          - high
          example: standard
          description: The level of attention Flexport should give to this shipment
        updated_at:
          type: string
          description: Date when the shipment object was last updated
          format: date-time
        estimated_departure_date:
          type: string
          description: Estimated departure date from the first port of the main voyage
          format: date-time
        actual_departure_date:
          type: string
          description: Actual departure date from the first port of the main voyage
          format: date-time
        estimated_arrival_date:
          type: string
          description: Estimated arrival date to the last port of the main voyage
          format: date-time
        actual_arrival_date:
          type: string
          description: Actual arrival date to the last port of the main voyage
          format: date-time
        cargo_ready_date:
          type: string
          description: Date when cargo is ready for pickup at the origin location
          format: date
        wants_freight_management_bco:
          type: boolean
          description: >-
            Determines if a shipment bypasses a freight forwader and is booked
            directly with a steamship line.
          example: true
        wants_flexport_freight:
          type: boolean
          description: >-
            Determines if a shipment is using Flexport services for a
            combination of import customs clearance or final leg delivery.
          example: true
        wants_commercial_invoice_transcription:
          type: boolean
          description: >-
            Determines if a shipment is using Flexport’s commercial invoice
            transcription service.
          example: true
        wants_flexport_insurance:
          type: boolean
          description: "Determines if a shipment is using Flexport\u2019s insurance\
            \ service."
          example: true
        wants_pickup_service:
          type: boolean
          description: >-
            Determines if a shipment uses Flexport trucking services from origin
            location to port.
          example: true
        wants_trade_declaration_service:
          type: boolean
          description: >-
            Determines if a shipment uses trade declaration service for HK
            exports.
          example: true
        visibility_only:
          type: boolean
          description: >-
            Indicates if a shipment was requested for tracking via the Flexport
            visibility-only service.
          example: true
        wants_delivery_service:
          type: boolean
          description: >-
            Determines if Flexport is responsible for door delivery on a
            shipment.
          example: true
        wants_214_filing:
          type: boolean
          description: Determines if the shipment wants a 214 filing.
          example: true
        wants_ftz_entry:
          type: boolean
          description: Determines if the shipment wants an FTZ entry
          example: true
        belongs_to_a_buyers_consol:
          type: boolean
          description: Indicated whether the shipment is part of a buyer's consol.
        child_shipments:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentRef'
          description: >-
            Links to the child shipments if the shipment is the parent shipment
            in a buyer's consol.
        parent_shipment:
          $ref: '#/components/schemas/ShipmentRef'
          description: >-
            Links to the parent shipment if the shipment is a child shipment in
            a buyer's consol.
        estimated_picked_up_in_full_date:
          type: string
          description: >-
            Estimated pickup date from the origin location. For ocean shipments
            with multiple containers, this is the date of last picked up
            container
          format: date-time
        actual_picked_up_in_full_date:
          type: string
          description: >-
            Actual pickup date from the origin location. For ocean shipments
            with multiple containers, this is the date of last picked up
            container
          format: date-time
        target_delivery_date:
          type: string
          description: >-
            Target date for when the shipment will be fully delivered. This date
            is set when the shipment's booking is confirmed. This value may be
            different from estimated_delivered_in_full_date, which is updated
            when there is new information about the progress of a shipment.
          format: date
        estimated_delivered_in_full_date:
          type: string
          description: >-
            Estimated delivery date to the destination location. For ocean
            shipments with multiple containers, this is the date of last
            delivered container
          format: date-time
        actual_delivered_in_full_date:
          type: string
          description: >-
            Actual delivery date to the destination location. For ocean
            shipments with multiple containers, this is the date of last
            delivered container
          format: date-time
        wants_export_customs_service:
          type: boolean
          description: >-
            Determines if the shipment requires Flexport to provide export
            customs services.
          example: true
        wants_import_customs_service:
          type: boolean
          description: >-
            Determines if the shipment requires Flexport to provide import
            customs services.
          example: true
        ocean_shipment:
          $ref: '#/components/schemas/OceanShipmentDetail'
        air_shipment:
          $ref: '#/components/schemas/AirShipmentDetail'
        truck_shipment:
          $ref: '#/components/schemas/TruckShipmentDetail'
        dangerous_goods:
          $ref: '#/components/schemas/ShipmentDangerousGoods'
        accepted_quote:
          type: object
          description: The accepted quote object associated with the shipment.
          example: '{accepted_quote: {amount: "8.0", currency_code: "USD"}}'
          properties:
            amount:
              type: number
              description: the amount of the accepted quote
            currency_code:
              type: string
              description: the currency code of the accepted quote
        quoted_transit_time_days_min:
          type: number
          description: Minimum transit time for the shipment in days
          example: 10
        quoted_transit_time_days_max:
          type: number
          description: Maximum transit time for the shipment in days
          example: 20
        quoted_delivery_date_from:
          type: string
          description: Earliest delivery date
          format: date-time
        quoted_delivery_date_to:
          type: string
          description: Latest delivery date
          format: date-time
        detention_free_days:
          type: integer
          description: Number of free detention days per last accepted quote
          example: 5
        shipping_order:
          type: object
          description: >-
            Shipping order cutoff dates for ocean FCL and Buyer's consolidation
            shipments. Returns null for LCL shipments or when cutoff dates are
            unavailable.
          properties:
            si_cutoff:
              type: string
              format: date-time
              description: >-
                Shipping Instructions Cutoff (SI) - Date by which the booking
                agent must submit shipping instructions to the ocean carrier in
                order to meet a particular sailing.
              example: '2025-10-02T16:00:00.000Z'
            cy_cutoff:
              type: string
              format: date-time
              description: "Container Yard Cutoff (CY) -\tDate by which the container\
                \ must be delivered to the container yard in order to meet a particular\
                \ sailing."
              example: '2025-10-03T16:00:00.000Z'
        shippers:
          type: array
          items:
            $ref: '#/components/schemas/CompanyEntity'
        consignees:
          type: array
          items:
            $ref: '#/components/schemas/CompanyEntity'
        buyers:
          type: array
          items:
            $ref: '#/components/schemas/CompanyEntity'
        sellers:
          type: array
          items:
            $ref: '#/components/schemas/CompanyEntity'
        importers_of_record:
          type: array
          items:
            $ref: '#/components/schemas/CompanyEntity'
        items:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentItem'
        legs:
          $ref: '#/components/schemas/LegCollectionRef'
        customs_entries:
          $ref: '#/components/schemas/CustomsEntryCollectionRef'
        commercial_invoices:
          $ref: '#/components/schemas/CommercialInvoiceCollectionRef'
        documents:
          $ref: '#/components/schemas/DocumentCollectionRef'
        container_load_result:
          $ref: '#/components/schemas/ContainerLoadResultRef'
        departure_date:
          type: string
          format: date-time
          description: DEPRECATED date field
        arrival_date:
          type: string
          format: date-time
          description: DEPRECATED date field
        picked_up_in_full_date:
          type: string
          format: date-time
          description: DEPRECATED date field
        delivered_in_full_date:
          type: string
          format: date-time
          description: DEPRECATED date field
    AdditionalDates:
      type: object
      properties:
        cargo_ready_date:
          type: string
          format: date
          description: Represents the date when the cargo on the leg is ready for
            pickup.
        delivery_appointment_requested_at_date:
          type: string
          format: date-time
          description: Date at which the appointment was first requested
        delivery_appointment_requested_for_date:
          type: string
          format: date-time
          description: >-
            Date of the actual appointment date that was requested in that
            initial request
        delivery_appointment_scheduled_at_date:
          type: string
          format: date-time
          description: Date at which the appointment was confirmed by the DC
        delivery_appointment_scheduled_for_date:
          type: string
          format: date-time
          description: Date of the actual confirmed appointment
        loaded_on_truck_date:
          type: string
          format: date-time
          description: >-
            Date when the cargo has been transloaded from an ocean container to
            a truck
        delivery_completed:
          type: string
          format: date-time
          description: >-
            Date when the cargo for this leg was unloaded and fully received at
            the final destination
    Terminal:
      type:
      - object
      - 'null'
      description: >-
        Name and address of a specific terminal within a port or airport.  Possibly
        null
      properties:
        _object:
          type: string
          description: Type of the object
          example: /shipment_node/terminal
        name:
          type: string
          description: Name of the terminal
          example: Terminal 3
        firms_code:
          type: string
          description: >-
            Four digit alpha-numeric identifier assigned by U.S. Customs and
            Border Protection to bonded facilities;  available prior to shipment
            arrival at location tagged 'customs_entry'
          example: I092
        address:
          $ref: '#/components/schemas/Address'
    ShipmentNode:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /shipment_node
        tags:
          type: array
          items:
            type: string
            example: port_of_loading
        place:
          $ref: '#/components/schemas/Place'
        terminal:
          $ref: '#/components/schemas/Terminal'
    AirShipmentLeg:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          example: /air/shipment_leg
        iata_code:
          type: string
          example: 2Q
        icao_code:
          type: string
          example: SNC
        flight_number:
          type: string
          example: Y8 1234
    ContainerLegCollectionRef:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /api/refs/collection
        ref_type:
          type: string
          description: Type of the object in this list.
          example: /ocean/shipment_container_leg
        link:
          type: string
          description: URL to fetch list of objects.
          example: >-
            https://api.flexport.com/ocean/shipment_container_legs?f.shipment_container.id=123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    BargeShipmentLeg:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          example: /barge/shipment_leg
        tracking_number:
          type:
          - string
          - 'null'
          example: FBA123456789
        pieces:
          type:
          - integer
          - 'null'
          example: 32
        container_legs:
          $ref: '#/components/schemas/ContainerLegCollectionRef'
    OceanShipmentLeg:
      type: object
      properties:
        _object:
          type: string
          example: /ocean/shipment_leg
        scac_code:
          type: string
          example: XJAE
        vessel_name:
          type: string
          example: Lenox
        vessel_imo:
          type: string
          example: IMO9074729
        voyage_number:
          type: string
          example: 059E
        container_legs:
          $ref: '#/components/schemas/ContainerLegCollectionRef'
    TruckingShipmentLeg:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          example: /trucking/shipment_leg
        tracking_number:
          type:
          - string
          - 'null'
          example: FBA123456789
        service_type:
          type: string
          enum:
          - ltl
          - ftl
          - drayage
          - cartage
        pieces:
          type:
          - integer
          - 'null'
          example: 32
        scac_code:
          type:
          - string
          - 'null'
          example: ABCD
        container_legs:
          $ref: '#/components/schemas/ContainerLegCollectionRef'
    RailShipmentLeg:
      type:
      - object
      - 'null'
      properties:
        _object:
          type: string
          example: /rail/shipment_leg
        container_legs:
          $ref: '#/components/schemas/ContainerLegCollectionRef'
    ShipmentLeg:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /shipment_leg
        id:
          type: integer
          example: 948211
        shipment:
          $ref: '#/components/schemas/ShipmentRef'
        estimated_arrival_date:
          type: string
          format: date-time
        actual_arrival_date:
          type: string
          format: date-time
        estimated_departure_date:
          type: string
          format: date-time
        actual_departure_date:
          type: string
          format: date-time
        deleted_at:
          type:
          - string
          - 'null'
          format: date-time
          description: Date-time string when this leg was deleted. Null if not deleted.
        additional_dates:
          $ref: '#/components/schemas/AdditionalDates'
        origin:
          $ref: '#/components/schemas/ShipmentNode'
        destination:
          $ref: '#/components/schemas/ShipmentNode'
        transportation_mode:
          $ref: '#/components/schemas/TransportationMode'
        carrier_name:
          type: string
          example: Liberty Carrier
        air_leg:
          $ref: '#/components/schemas/AirShipmentLeg'
        barge_leg:
          $ref: '#/components/schemas/BargeShipmentLeg'
        ocean_leg:
          $ref: '#/components/schemas/OceanShipmentLeg'
        trucking_leg:
          $ref: '#/components/schemas/TruckingShipmentLeg'
        rail_leg:
          $ref: '#/components/schemas/RailShipmentLeg'
        cargo_ready_date:
          type: string
          description: '[DEPRECATED] See additional_dates'
          format: date
    ContainerRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/object
        ref_type:
          type: string
          example: /ocean/shipment_container
        link:
          type: string
          example: https://api.flexport.com/ocean/shipment_containers/123
        id:
          type: integer
          example: 123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    LegRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/object
        ref_type:
          type: string
          example: /shipment_leg
        link:
          type: string
          example: https://api.flexport.com/shipment_legs/123
        id:
          type: integer
          example: 123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    OceanShipmentContainerLeg:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /ocean/shipment_container_leg
        shipment_container:
          $ref: '#/components/schemas/ContainerRef'
        leg:
          $ref: '#/components/schemas/LegRef'
        dates:
          type: array
          items:
            type: object
            example:
              actual_loaded_on_board_date: '2019-01-18T22:08:38.599Z'
    ShipmentContainer:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /ocean/shipment_container
        id:
          type: integer
          example: 283910
        metadata:
          $ref: '#/components/schemas/Metadata'
        container_type:
          type: string
          enum:
          - dry
          - flat_rack
          - headload
          - open
          - reefer
          - lcl
          - tank
          - ventilated
          - bulk
          - special
          example: dry
        container_number:
          type: string
          example: BWSE3982156
        reference_code:
          type: string
          example: 19HON037-UK
        container_size:
          type: string
          enum:
          - twenty_ft
          - fourty_ft
          - fourty_ft_hc
          - fourty_five_ft_hc
          - fifty_three_ft
          - fifty_three_ft_hc
          example: fourty_ft
        seal_number:
          type:
          - string
          - 'null'
          example: UE_WQ2934875
        pickup_number:
          type:
          - string
          - 'null'
          example: ABCD1234
        estimated_departure_date:
          type:
          - string
          - 'null'
          format: date-time
        actual_departure_date:
          type:
          - string
          - 'null'
          format: date-time
        estimated_arrival_date:
          type:
          - string
          - 'null'
          format: date-time
        actual_arrival_date:
          type:
          - string
          - 'null'
          format: date-time
        estimated_pickup_date:
          type:
          - string
          - 'null'
          format: date-time
        actual_pickup_date:
          type:
          - string
          - 'null'
          format: date-time
        estimated_delivery_date:
          type:
          - string
          - 'null'
          format: date-time
        actual_delivery_date:
          type:
          - string
          - 'null'
          format: date-time
        last_free_day_date:
          type:
          - string
          - 'null'
          format: date-time
        empty_ready_date:
          type:
          - string
          - 'null'
        empty_returned_date:
          type:
          - string
          - 'null'
          format: date
        cargo_ready_date:
          type:
          - string
          - 'null'
          format: date
        available_for_pickup_date:
          type:
          - string
          - 'null'
          format: date-time
        estimated_available_for_pickup_date:
          type:
          - string
          - 'null'
          format: date-time
        shipment:
          $ref: '#/components/schemas/ShipmentRef'
        container_legs:
          $ref: '#/components/schemas/ContainerLegCollectionRef'
        items:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentItem'
    Exception:
      type: object
      properties:
        _object:
          type: string
        message:
          type: string
          description: Description of the exceptional event.
          example: US Customs Hold
        root_cause_name:
          type: string
          description: The main reason for the exception as human-friendly text.
          example: Government Agency
        root_cause_slug:
          type: string
          description: The main reason for the exception as an identifier.
          example: government_agency
          enum:
          - carrier
          - client
          - consignee
          - destination_agent
          - destination_trucking_carrier
          - export_customs_agent
          - flexport
          - government_agency
          - import_customs_agent
          - natural_event
          - origin_agent
          - origin_trucking_carrier
          - shipper
          - terminal
          - unknown
    ShipmentEventData:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /shipment_event_data
        resource:
          oneOf:
          - $ref: '#/components/schemas/Shipment'
          - $ref: '#/components/schemas/ShipmentLeg'
          - $ref: '#/components/schemas/OceanShipmentContainerLeg'
        shipment:
          $ref: '#/components/schemas/Shipment'
        location:
          allOf:
          - $ref: '#/components/schemas/ShipmentNode'
          description: Possibly null. Location associated with the event.
        containers:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentContainer'
          description: >-
            An array of the containers associated with this event.  Array is
            empty for shipment-level events.
        exception:
          $ref: '#/components/schemas/Exception'
    WebhookEvent:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /event
        id:
          type: integer
          example: 354987
        version:
          type: integer
          example: 2
        created_at:
          type: string
          example: '2019-04-16T18:05:10.964Z'
        occurred_at:
          type: string
          example: '2019-04-16T18:05:10.964Z'
        type:
          type: string
          example: /shipment_leg#departed
        data:
          $ref: '#/components/schemas/ShipmentEventData'
    InvoiceRate:
      description: Describes the rate per unit used to calculate the price of a line
        item
      type: object
      properties:
        _object:
          type: string
          description: The type of the object
          example: /invoice/rate
        value:
          type: string
          format: decimal
          description: numeric value described by qualifier
          example: '2.31'
        qualifier:
          type: string
          example: "'USD', '% Drayage Base'"
          description: describes what the value represents
    InvoiceQuantity:
      description: Describes the number of units used to calculate the price of a
        line item
      type: object
      properties:
        _object:
          type: string
          description: The type of the object
          example: /invoice/quantity
        value:
          type: string
          format: decimal
          description: numeric value described by qualifier
          example: '1000'
        qualifier:
          type: string
          example: "'kg', 'bill of lading', 'USD'"
          description: describes what the value represents
    InvoiceItem:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object.
          example: /invoice_item
        name:
          type: string
          description: Description of charge.
          example: FCL 40' HQ
        slug:
          type: string
          description: Code describing the charge.
          example: fcl_40_hq
        category:
          type: string
          description: Category of the charge.
          enum:
          - freight
          - origin
          - destination
          - customs
          - additional
          - capital
        amount:
          $ref: '#/components/schemas/Money'
        rate:
          $ref: '#/components/schemas/InvoiceRate'
        quantity:
          $ref: '#/components/schemas/InvoiceQuantity'
        container_numbers:
          type: array
          description: Containers this charge is related to
          items:
            type: string
    CreditMemo:
      type: object
      properties:
        _object:
          type: string
          description: The type of the object
          example: /credit_memo
        amount:
          $ref: '#/components/schemas/Money'
        category:
          type: string
          description: DEPRECATED - Not available after v3. Please use `categories`.
          example: additional
        reason:
          type: string
          description: DEPRECATED - Not available after v3. Please use `reasons`.
        credited_at:
          type: string
          format: date-time
          example: '2019-07-12T20:40:11.572Z'
        categories:
          type: array
          items:
            type: string
          description: List of categories of the credited line items
          example:
          - additional
          - freight
        reasons:
          type: array
          items:
            type: string
          description: List of reasons why the credit was applied to the line items
    Invoice:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always '/invoice' for this object.
          example: /invoice
        id:
          type: string
          description: Unique ID for the invoice
          example: gwdpaYrhTI-T1ljn1M7o7w
        name:
          type: string
          description: Unique name for the invoice
          example: FLEX-123456-1
        issued_at:
          type: string
          format: date-time
          description: When the invoice was issued
          example: '2019-05-22T18:39:53.679Z'
        due_date:
          type: string
          format: date
          description: Due date of the invoice
          example: '2019-05-22'
        quote_currency_code:
          type: string
          description: Currency code of the accepted quote
          example: USD
        exchange_rate:
          type: number
          description: >-
            Exchange rate used to convert the quote currency to the invoice
            currency
          example: 1.2543
        invoice_type:
          type: string
          description: The type of charges included on this invoice
          example: customs
        total:
          $ref: '#/components/schemas/Money'
          description: Sum of charges on the invoice
        balance:
          $ref: '#/components/schemas/Money'
          description: Outstanding balance on the invoice
        status:
          type: string
          description: Status of the invoice
          enum:
          - outstanding
          - past_due
          - void
          - paid
          - payment_pending
        type:
          type: string
          description: >-
            What the invoice is being issued for. Shipment related charges are
            type `Shipment` and non-shipment related charges are type `Client`
          enum:
          - Shipment
          - Client
        voided_at:
          type: string
          format: date-time
          description: When the invoice was voided (if applicable)
          example: '2019-05-22T20:49:15.639Z'
        last_updated_at:
          type: string
          format: date-time
          description: Time of the last adjustment to in invoice
          example: '2019-05-22T20:49:15.639Z'
        recipient:
          $ref: '#/components/schemas/CompanyEntity'
          description: Entity receiving the invoice (i.e. the customer)
        issuer:
          $ref: '#/components/schemas/CompanyEntity'
          description: Entity issuing the invoice (i.e. Flexport)
        items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceItem'
        notes:
          type: array
          items:
            type: string
          example:
          - Markdown formatted note 1
          - Markdown formatted note 2
        credit_memos:
          type: array
          description: List of any credits applied to this invoice.
          items:
            $ref: '#/components/schemas/CreditMemo'
        shipments:
          $ref: '#/components/schemas/ShipmentRef'
        service_level:
          type:
          - string
          - 'null'
          description: Service level of the shipment associated with the invoice
          example:
          - standard
          - express
          - deferred
    GenericCollectionRef:
      type: object
      properties:
        _object:
          type: string
        link:
          type: string
        ref_type:
          type: string
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    Company:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always /network/company for this object.
          example: /network/company
        id:
          type: string
          description: Unique identifier for the company
        metadata:
          $ref: '#/components/schemas/Metadata'
        name:
          type: string
        ref:
          type: string
        editable:
          type: boolean
        entities:
          type: array
          items:
            $ref: '#/components/schemas/CompanyEntity'
        locations:
          $ref: '#/components/schemas/GenericCollectionRef'
        contacts:
          $ref: '#/components/schemas/GenericCollectionRef'
    CreateCompany:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          description: Always required. Name of the company.
          example: Zoomit
        ref:
          type: string
          description: Your custom string used to refer to the company
          example: zoomit-ref
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the create should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
    UpdateCompany:
      type: object
      properties:
        name:
          type: string
          description: Updated name of the company.
          example: Updated Zoomit
        ref:
          type: string
          description: Updated ref of the company
          example: zoomit_ref
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the update should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
    AddressForRequestBody:
      type: object
      properties:
        street_address:
          type: string
          example: 1641 Settlers Lane
        street_address2:
          type: string
          example: STE 2918
        city:
          type: string
          example: Albany
        state:
          type: string
          example: MN
        country_code:
          type: string
          example: US
        zip:
          type: string
          example: '56307'
        unlocode:
          type: string
          example: USAL2
    WriteVatNumber:
      type: object
      required:
      - country_code
      - number
      properties:
        country_code:
          type: string
          description: ISO 3166 two-letter country code
          example: GB
        number:
          type: string
          description: Full VAT number, including the country code
          example: GB 123456789
    CreateCompanyEntity:
      type: object
      required:
      - name
      - mailing_address
      properties:
        name:
          type: string
          description: Always required. Legal name of the new company entity
          example: Zoomit
        company_id:
          type: string
          description: >-
            The id of the new company entity's parent company. Either company_id
            or company_ref is required
          example: 2UXaj4xcHoW8nwh9UVOMpw
        company_ref:
          type: string
          description: >-
            The ref of the new company entity's parent company. Either
            company_id or company_ref is required
          example: Zoomit
        mailing_address:
          allOf:
          - $ref: '#/components/schemas/AddressForRequestBody'
          description: >-
            Always Required. The object representing the mailing address of the
            company entity.
        ref:
          type: string
          description: >-
            Not required. The ref that will be created for the new company
            entity
          example: my-zoomit-ref
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the create should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
        vat_numbers:
          type: array
          description: Not required. An array of VAT Numbers for the new company entity.
          items:
            $ref: '#/components/schemas/WriteVatNumber'
    UpdateCompanyEntity:
      type: object
      properties:
        name:
          type: string
          description: The new legal name of the company entity
          example: Zoomit V2
        mailing_address:
          $ref: '#/components/schemas/AddressForRequestBody'
        ref:
          type: string
          description: The new ref that will be used for the company entity
          example: zoomit-us
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the update should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
        vat_numbers:
          type: array
          description: >-
            If a value for vat_numbers is specified, the array specified will
            replace all the existing VAT numbers of the company entity
          items:
            $ref: '#/components/schemas/WriteVatNumber'
    Contact:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always /network/contact for this object.
          example: /network/contact
        id:
          type: string
          format: string
          description: Unique identifier for the contact
        name:
          type: string
        email:
          type: string
        phone_number:
          type: string
        locations:
          $ref: '#/components/schemas/GenericCollectionRef'
        company:
          type: object
          properties:
            _object:
              type: string
              example: /api/refs/object
            ref_type:
              type: string
              example: /company
            link:
              type: string
              example: https://api.flexport.com/network/companies/12345
            id:
              type: string
              example: 2UXaj4xcHoW8nwh9UVOMpw
          description: >-
            [Expandable API
            link.](https://apidocs.flexport.com/v2/tag/Expansion)
    CreateContact:
      type: object
      required:
      - name
      - email
      - phone_number
      properties:
        name:
          type: string
          description: Always required. Name of the new contact.
          example: John Smith
        email:
          type: string
          description: Always required. Email address of the new contact.
          example: john@example.com
        phone_number:
          type: string
          description: Always required. Phone number of the new contact.
          example: 861-555-5555
        company_id:
          type: string
          description: >-
            ID of the new contact's company. If not specified, the contact will
            be created for your company.
          example: 2UXaj4xcHoW8nwh9UVOMpw
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the create should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
    UpdateContact:
      type: object
      properties:
        name:
          type: string
          description: Updated name of the contact.
          example: John Smith
        email:
          type: string
          description: Updated email address of the contact.
          example: john_new_email@example.com
        phone_number:
          type: string
          description: Updated phone number of the contact.
          example: 861-555-7777
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the update should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
    Location:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object. Always /network/location for this object.
          example: /network/location
        id:
          type: string
          format: string
          description: Unique identifier for the location
        metadata:
          $ref: '#/components/schemas/Metadata'
        name:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        editable:
          type: boolean
        company:
          $ref: '#/components/schemas/GenericObjectRef'
        contacts:
          $ref: '#/components/schemas/GenericObjectRef'
        ref:
          type: string
    CreateLocation:
      type: object
      required:
      - name
      - company_id
      - address
      properties:
        name:
          type: string
          description: Name of the location
          example: Zoomit
        company_id:
          type: string
          description: The id of the company entity to create this location for
          example: xyz_123_ABC
        address:
          $ref: '#/components/schemas/AddressForRequestBody'
        contact_ids:
          type: array
          items:
            type: string
          description: Array of contact id's to assign to this location
          example:
          - asdlkfaiowejfa
          - 398qehfiaiurh
          - yfhvalnertughv
        ref:
          type: string
          description: Not required. The ref that will be created for the new location
          example: zoomit-management-co
        metadata:
          type: object
          description: >-
            Optional metadata to add to a location. Keys must be strings and
            values should be arrays of strings.
          example:
            color:
            - blue
            - green
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the create should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
    UpdateLocation:
      type: object
      properties:
        name:
          type: string
          description: New name of the location
          example: Zoomit V2
        address:
          $ref: '#/components/schemas/AddressForRequestBody'
        contact_ids:
          type: array
          items:
            type: string
          description: >-
            If a value for contact_ids is specified, the array specified will
            replace all the existing contacts at the location
          example:
          - asdlkfaiowejfa
          - 398qehfiaiurh
          - yfhvalnertughv
        ref:
          type: string
          description: The new ref for the location
          example: zoomit-management-co
        metadata:
          type: object
          description: >-
            Metadata to replace existing metadata. Keys must be strings and
            values should be arrays.
          example:
            color:
            - blue
            - green
        user_email:
          type: string
          description: >-
            Not required. Email of the user that the update should be attributed
            to in the audit trail. The user must belong to your company. If
            omitted, the action is attributed to a Flexport system user.
          example: johndoe@flexport.com
    WriteProductProperty:
      type: object
      required:
      - type
      - value
      properties:
        type:
          type: string
          description: Always required. User defined type of this property
          example: color
        value:
          type: string
          description: Always required. Value of this property
          example: blue
    EpaVneProductProfileClaim:
      type: object
      required:
      - profile_type
      - commercial_description
      - vehicle_engine_type
      - vehicle_engine_import_code
      description: >-
        Declares the product's EPA VNE (Vehicles and Engines) PGA profile.
        Sourced from customs-product-service's
        EpaVehiclesEnginesClaimProfileInput. This is product-level profile data
        only; per-shipment/per-unit filing data (serial numbers, manufacture
        date, entity contact details, etc.) is submitted separately at filing
        time, not through this API.
      properties:
        profile_type:
          type: string
          enum:
          - claim
          description: Discriminator field identifying this as a claim profile.
        commercial_description:
          type: string
          description: A commercial description of the product.
          example: DIESEL GENERATOR ENGINE
        vehicle_engine_type:
          type: string
          description: >-
            Whether the vehicle or engine is designed for on-road or off-road
            use.
          enum:
          - ORD
          - OFF
          example: ORD
        vehicle_engine_import_code:
          type: string
          description: >-
            Import code for EPA Form 3520-1 (Road vehicles) or Form 3520-21
            (Off-Road vehicles). See the CATAIR EPA Supplemental Guidelines for
            the meaning of each code.
          enum:
          - CODE_1
          - CODE_2
          - CODE_3
          - CODE_4
          - CODE_5
          - CODE_6
          - CODE_7
          - CODE_8
          - CODE_9
          - CODE_10
          - CODE_11
          - CODE_12
          - CODE_13
          - CODE_14
          - CODE_15
          - CODE_16
          - CODE_17
          - CODE_18
          - CODE_19
          - CODE_20
          - CODE_21
          - CODE_22
          - CODE_23
          - CODE_24
          - CODE_25
          - CODE_A
          - CODE_B
          - CODE_C
          - CODE_E
          - CODE_EE
          - CODE_F
          - CODE_FF
          - CODE_G
          - CODE_H
          - CODE_I
          - CODE_J
          - CODE_K
          - CODE_L
          - CODE_M
          - CODE_N
          - CODE_O
          - CODE_Q
          - CODE_U
          - CODE_W
          - CODE_Y
          - CODE_Z
          example: CODE_B
        industry_code:
          type: string
          nullable: true
          description: The category of engine or vehicle industry this product belongs
            to.
          enum:
          - A
          - B
          - C
          - D
          - E
          - F
          - G
          - H
          - I
          - J
          example: A
        bond_exemption_status:
          type: string
          nullable: true
          description: >-
            Whether the vehicle or engine is exempt from the EPA import bond
            requirement.
          enum:
          - EXEMPT
          - NOT_EXEMPT
          example: EXEMPT
        bond_policy_number:
          type: string
          nullable: true
          description: >-
            The import bond policy number covering this vehicle or engine.
            Required when bond_exemption_status is NOT_EXEMPT.
        test_group_or_engine_family_name:
          type: string
          nullable: true
          description: >-
            The EPA test group or engine family name the vehicle or engine
            belongs to.
        model:
          type: string
          nullable: true
          description: The model name or number of the vehicle or engine.
          example: DX-450
        origin_of_manufacture:
          type: string
          nullable: true
          description: >-
            Whether this declaration covers the vehicle, the engine, or another
            component.
          enum:
          - VEHICLE
          - ENGINE
          - OTHER
          example: ENGINE
        regulation_cited_for_exemption:
          type: string
          nullable: true
          description: >-
            The CFR regulation cited to support the claimed exemption, if
            applicable.
    EpaVneProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - disclaim_code
      description: >-
        Declares that the product is not subject to the EPA VNE (Vehicles and
        Engines) program, and why. Sourced from customs-product-service's
        EpaVehiclesEnginesDisclaimProfileInput.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as a disclaim profile.
        disclaim_code:
          type: string
          description: The reason the product is not subject to the program.
          enum:
          - A
          - B
          - C
          - D
          example: A
    EpaVneProductProfile:
      oneOf:
      - $ref: '#/components/schemas/EpaVneProductProfileClaim'
      - $ref: '#/components/schemas/EpaVneProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          claim: '#/components/schemas/EpaVneProductProfileClaim'
          disclaim: '#/components/schemas/EpaVneProductProfileDisclaim'
    EpaTscaProductProfileClaim:
      type: object
      required:
      - profile_type
      - commercial_description
      - tsca_certification
      description: >-
        Declares the product's EPA TSCA (Toxic Substances Control Act) PGA
        profile. Sending the same profile again keeps the existing one; sending
        a different one replaces it.
      properties:
        profile_type:
          type: string
          enum:
          - claim
          description: Discriminator field identifying this as a TSCA claim profile.
        commercial_description:
          type: string
          maxLength: 70
          description: >-
            A commercial description of the product. Letters, digits, spaces and
            common punctuation only. Stored in upper case.
          example: SNOWMOBILE ENGINE OIL
        tsca_certification:
          type: string
          description: >-
            The TSCA certification. EP4 is a positive certification (the product
            complies with TSCA), EP5 a negative certification (the product is
            not subject to TSCA).
          enum:
          - EP4
          - EP5
          example: EP4
        certifying_contact:
          type: object
          description: >-
            The person who certifies the TSCA claim. If it is left out, the
            contact of the product's current TSCA claim is kept. If the product
            has no claim, the client's default TSCA certifying contact is used,
            and the request fails if the client has none. If the client already
            has a contact with the same details, that contact is used; otherwise
            a new one is added to the client's contacts (and becomes the default
            if the client has none).
          required:
          - full_name
          - email
          - phone_number
          properties:
            full_name:
              type: string
              maxLength: 23
              description: >-
                Letters, digits, spaces and common punctuation only. Stored in
                upper case.
              example: JANE DOE
            email:
              type: string
              format: email
              maxLength: 254
              example: jane.doe@example.com
            phone_number:
              type: string
              maxLength: 15
              pattern: ^[0-9]+$
              description: Digits only.
              example: '4505550100'
    EpaTscaProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - disclaim_code
      description: >-
        Declares that the product is not subject to EPA TSCA (Toxic Substances
        Control Act), and why. Sending the same disclaim again keeps the
        existing one; sending a different one replaces the product's TSCA
        profile.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as a TSCA disclaim profile.
        disclaim_code:
          type: string
          description: >-
            The reason the product is not subject to TSCA. A: not regulated by
            this agency. B: data not required per agency guidance. C: data filed
            through other agency means. D: data filed through paper.
          enum:
          - A
          - B
          - C
          - D
          example: A
    EpaTscaProductProfile:
      oneOf:
      - $ref: '#/components/schemas/EpaTscaProductProfileClaim'
      - $ref: '#/components/schemas/EpaTscaProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          claim: '#/components/schemas/EpaTscaProductProfileClaim'
          disclaim: '#/components/schemas/EpaTscaProductProfileDisclaim'
    AphisLaceyConstituentElement:
      type: object
      required:
      - constituent_element_name
      description: >-
        One plant material in the product. The Lacey declaration also needs the
        genus, species and countries of harvest, unless the harvest source is
        unknown; any that are left out are completed by the Flexport customs
        broker for each shipment.
      properties:
        constituent_element_name:
          type: string
          description: The name of the plant material.
          example: Oak
        genus_name:
          type: string
          description: The scientific genus of the plant.
          example: Quercus
        species_name:
          type: string
          description: The scientific species of the plant.
          example: alba
        quantity:
          type: number
          minimum: 0
          description: >-
            How much of the plant material the product contains. Requires
            unit_of_measure.
          example: 1.5
        unit_of_measure:
          type: string
          description: >-
            The unit of quantity. Case-insensitive. M3: cubic meters. KG:
            kilograms. M2: square meters. M: meters. G: grams. CG: centigrams.
            CLR: centiliters. CM: centimeters. CM2: square centimeters. CM3:
            cubic centimeters. KL: kiloliters. L: liters. ML: milliliters. MM:
            millimeters. MM2: square millimeters. MM3: cubic millimeters.
          enum:
          - M3
          - KG
          - M2
          - M
          - G
          - CG
          - CLR
          - CM
          - CM2
          - CM3
          - KL
          - L
          - ML
          - MM
          - MM2
          - MM3
          example: KG
        is_per_unit_quantity:
          type: boolean
          description: >-
            true if quantity is per unit of the product, false if it is the
            total for the commercial invoice line.
          example: true
        percent_of_constituent_element:
          type: number
          minimum: 0
          maximum: 100
          description: The percentage of the plant material that is recycled.
          example: 0
        unknown_harvest_source:
          type: boolean
          description: true if the genus, species and countries of harvest are unknown.
          example: false
        countries_of_harvest:
          type: array
          description: >-
            The countries where the plant was harvested, as CBP country codes.
            Case-insensitive. CBP codes are ISO 3166-1 alpha-2 codes with these
            exceptions: Canada is given by province (XA Alberta, XC British
            Columbia, XM Manitoba, XB New Brunswick, XW Newfoundland, XT
            Northwest Territories, XN Nova Scotia, XV Nunavut, XO Ontario, XP
            Prince Edward Island, XQ Quebec, XS Saskatchewan, XY Yukon
            Territory), and Burma is BU instead of MM. Use ZZ if the country is
            unknown or the plant was harvested in international waters, and XZ
            for five or more possible countries.
          items:
            type: string
          example:
          - US
          - XQ
    AphisLaceyProductProfileClaim:
      type: object
      required:
      - profile_type
      - constituent_elements
      description: >-
        Declares the plant material in the product for its APHIS Lacey Act
        declaration. Flexport uses the claim to prefill the Lacey declaration
        for each shipment of the product, and a Flexport customs broker confirms
        the shipment-level details before filing. Sending a claim replaces the
        product's Lacey profile, including any disclaim.
      properties:
        profile_type:
          type: string
          enum:
          - claim
          description: Discriminator field identifying this as a Lacey claim profile.
        constituent_elements:
          type: array
          minItems: 1
          description: The plant materials the product contains, one entry each.
          items:
            $ref: '#/components/schemas/AphisLaceyConstituentElement'
    AphisLaceyProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - disclaim_code
      description: >-
        Declares that the product needs no APHIS Lacey Act declaration, and why.
        Flexport uses the disclaim when filing the product's entry lines, except
        on lines whose HTS code requires a Lacey Act declaration (PGA flag AL2).
        Sending a disclaim replaces the product's Lacey profile, including any
        claim.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as a Lacey disclaim profile.
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no Lacey Act declaration. A: not
            regulated by this agency. B: data not required per agency guidance.
            C: data filed through other agency means. D: data filed through
            paper.
          enum:
          - A
          - B
          - C
          - D
          example: A
    AphisLaceyProductProfile:
      oneOf:
      - $ref: '#/components/schemas/AphisLaceyProductProfileClaim'
      - $ref: '#/components/schemas/AphisLaceyProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          claim: '#/components/schemas/AphisLaceyProductProfileClaim'
          disclaim: '#/components/schemas/AphisLaceyProductProfileDisclaim'
    NhtsaProductProfileClaim:
      type: object
      required:
      - profile_type
      - commercial_description
      - program_code
      - item_type
      - category_code
      - hs7_conformance_declaration
      - hs7_entity_role_code
      description: >-
        Declares that the product is covered by an NHTSA program, and what the
        HS-7 declaration for it says. Flexport uses the claim to prefill the
        NHTSA task for each shipment of the product, and a Flexport customs
        broker confirms the shipment-level details before filing. Sending a
        claim replaces the product's NHTSA profile, including any disclaim.
        Details that belong to one shipment are not part of the product profile
        and are rejected here: send the vehicle units (VIN or serial number,
        manufacture date), supporting documents, and the importer, consignee,
        fabricating manufacturer and retailer or distributor on the commercial
        invoice line.
      properties:
        profile_type:
          type: string
          enum:
          - claim
          description: Discriminator field identifying this as an NHTSA claim profile.
        commercial_description:
          type: string
          description: English description of the commercial product.
          example: Aftermarket brake pads
        program_code:
          type: string
          description: >-
            The NHTSA program the declaration falls under. MVS: motor vehicles.
            REI: regulated motor vehicle equipment subject to the Federal Motor
            Vehicle Safety Standards (FMVSS). TPE: replacement motor vehicle
            equipment subject to the Federal Motor Vehicle Theft Prevention
            Standard (FMVTPS). OEI: other motor vehicle equipment not subject to
            FMVSS or FMVTPS. OFF: vehicles or equipment not for use on public
            roads.
          enum:
          - MVS
          - REI
          - TPE
          - OEI
          - OFF
          example: REI
        item_type:
          type: string
          description: >-
            Whether the declaration covers a finished product or a component of
            one.
          enum:
          - PRODUCT
          - COMPONENT
          example: COMPONENT
        category_type:
          type: string
          description: >-
            The category list category_code is drawn from. Optional: it follows
            from program_code (MVSTYP for MVS, REITYP for REI, TPETYP for TPE,
            OEITYP for OEI, OFFTYPE or OFFTYP for OFF), and a different value is
            rejected. OFFTYP and OFFTYPE are equivalent; both are stored as
            OFFTYPE.
          enum:
          - MVSTYP
          - REITYP
          - TPETYP
          - OEITYP
          - OFFTYPE
          - OFFTYP
          example: REITYP
        category_code:
          type: string
          description: >-
            The category within the program. It must belong to program_code:
            MVS1 to MVS10 for MVS, REI1 to REI13 for REI, TPE1 for TPE, OEI1 for
            OEI, OFF1 for OFF.
          enum:
          - MVS1
          - MVS2
          - MVS3
          - MVS4
          - MVS5
          - MVS6
          - MVS7
          - MVS8
          - MVS9
          - MVS10
          - REI1
          - REI2
          - REI3
          - REI4
          - REI5
          - REI6
          - REI7
          - REI8
          - REI9
          - REI10
          - REI11
          - REI12
          - REI13
          - TPE1
          - OEI1
          - OFF1
          example: REI3
        brand_name:
          type: string
          description: Brand name of the vehicle or equipment. Optional.
          example: Acme
        model:
          type: string
          description: Model name of the vehicle or equipment. Optional.
          example: BP-100
        model_year:
          type: integer
          minimum: 1000
          maximum: 9999
          description: Model year of the vehicle or equipment, as four digits. Optional.
          example: 2024
        hs7_conformance_declaration:
          type: string
          description: >-
            Which box of NHTSA form HS-7 is being declared. BOX_2A and BOX_2B
            are the two variants of box 2; the rest correspond to their box
            number. For the OFF program only BOX_8 is accepted. Every box is
            stored, but the NHTSA task in the Customs app doesn't support boxes
            2B to 7 and 9 to 13 yet, and warns on a shipment that uses one.
          enum:
          - BOX_1
          - BOX_2A
          - BOX_2B
          - BOX_3
          - BOX_4
          - BOX_5
          - BOX_6
          - BOX_7
          - BOX_8
          - BOX_9
          - BOX_10
          - BOX_11
          - BOX_12
          - BOX_13
          example: BOX_2A
        hs7_entity_role_code:
          type: string
          description: The role of the entity signing the HS-7 declaration.
          enum:
          - IMPORTER
          - CONSIGNEE
          - FABRICATING_MANUFACTURER
          - RETAILER_DISTRIBUTOR
          example: IMPORTER
        hs7_signature_date:
          type: string
          format: date
          description: >-
            Date the HS-7 declaration was signed, as YYYY-MM-DD. Optional: the
            shipment supplies it, on the commercial invoice line or entered by a
            Flexport customs broker. A claim without it (omitted, null or empty)
            replaces the product's NHTSA profile with one that has no date, so a
            date stored earlier is cleared.
          example: '2026-10-27'
    NhtsaProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - commercial_description
      - program_code
      - disclaim_code
      description: >-
        Declares that the product needs no NHTSA declaration, and why. Flexport
        uses the disclaim when filing the product's entry lines, except on lines
        whose HTS code requires an NHTSA declaration (PGA flag DT2). Sending a
        disclaim replaces the product's NHTSA profile, including any claim.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as an NHTSA disclaim profile.
        commercial_description:
          type: string
          description: English description of the commercial product.
          example: Seat covers
        program_code:
          type: string
          description: >-
            The NHTSA program being disclaimed. MVS: motor vehicles. REI:
            regulated motor vehicle equipment subject to the Federal Motor
            Vehicle Safety Standards (FMVSS). TPE: replacement motor vehicle
            equipment subject to the Federal Motor Vehicle Theft Prevention
            Standard (FMVTPS). OEI: other motor vehicle equipment not subject to
            FMVSS or FMVTPS. OFF: vehicles or equipment not for use on public
            roads.
          enum:
          - MVS
          - REI
          - TPE
          - OEI
          - OFF
          example: OFF
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no NHTSA declaration. A: not regulated
            by this agency.
          enum:
          - A
          example: A
    NhtsaProductProfile:
      oneOf:
      - $ref: '#/components/schemas/NhtsaProductProfileClaim'
      - $ref: '#/components/schemas/NhtsaProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          claim: '#/components/schemas/NhtsaProductProfileClaim'
          disclaim: '#/components/schemas/NhtsaProductProfileDisclaim'
    AmsProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - program_code
      - processing_code
      - disclaim_code
      description: >-
        Declares that the product needs no AMS (Agricultural Marketing Service)
        declaration, and why. Flexport uses the disclaim when filing the
        product's entry lines. If it differs from the product's stored AMS
        profile, it replaces it; if it is the same, nothing changes.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as an AMS disclaim profile.
        program_code:
          type: string
          description: 'The AMS program being disclaimed. OR: USDA-AMS Organic.'
          enum:
          - OR
          example: OR
        processing_code:
          type: string
          description: >-
            The organic processing code. OR_1: identify certified organic
            products. OR_2: certified organic products, electronic import
            certification.
          enum:
          - OR_1
          - OR_2
          example: OR_1
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no AMS declaration. A: this product is
            not regulated by this agency.
          enum:
          - A
          example: A
        commercial_description:
          type:
          - string
          - 'null'
          maxLength: 70
          description: >-
            English description of the commercial product. Leading and trailing
            spaces are removed, and a blank value is stored as null.
          example: Organic alfalfa sprouts
    AmsProductProfile:
      oneOf:
      - $ref: '#/components/schemas/AmsProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          disclaim: '#/components/schemas/AmsProductProfileDisclaim'
    FdaProductProfileClaim:
      type: object
      additionalProperties: false
      required:
      - profile_type
      - program_code
      - processing_code
      - intended_use_code
      - item_type
      - product_code
      description: >-
        Declares that the product is covered by FDA's medical devices (DEV) or
        radiation-emitting products (RAD) program. Flexport uses the stored
        claim to prefill the FDA task; a customs broker still completes the
        line-level FDA declaration before filing. Sending a different profile
        replaces the product's FDA profile, including any disclaim. Sending the
        same profile again keeps the existing one. String values are
        case-sensitive; leading and trailing whitespace is removed before
        validation. Unsupported fields, including intended_use_description, are
        rejected with 400.
      properties:
        profile_type:
          type: string
          enum:
          - claim
          description: Discriminator field identifying this as an FDA claim profile.
        profile_fid:
          type: 'null'
          description: >-
            Omit this field or send null. An existing profile cannot be selected
            by FID.
        program_code:
          type: string
          description: >-
            The FDA program. DEV: medical devices. RAD: radiation-emitting
            products.
          enum:
          - DEV
          - RAD
          example: RAD
        processing_code:
          type: string
          description: >-
            The ACE processing code for program_code. DEV accepts RED
            (radiation-emitting medical devices) or NED (non-radiation-emitting
            medical devices). RAD accepts REP (non-medical radiation-emitting
            products).
          enum:
          - RED
          - NED
          - REP
          example: REP
        intended_use_code:
          type: string
          description: >-
            The intended use of the product, which must match program_code. DEV
            accepts 081.001, 081.002, 081.003, 081.004, 081.005, 081.006,
            081.007, 081.008, 100.000, 110.000, 140.000, 170.000, 180.010,
            180.014, 180.015, 920.001, 920.002, 940.000, 950.001, 950.002,
            970.000 or 970.001. RAD accepts 085.000, 090.000, 100.000, 110.000,
            120.000, 130.000, 140.000, 150.000, 155.000, 170.000, 180.000,
            970.000 or 980.000.
          enum:
          - '081.001'
          - '081.002'
          - '081.003'
          - '081.004'
          - '081.005'
          - '081.006'
          - '081.007'
          - '081.008'
          - '085.000'
          - '090.000'
          - '100.000'
          - '110.000'
          - '120.000'
          - '130.000'
          - '140.000'
          - '150.000'
          - '155.000'
          - '170.000'
          - '180.000'
          - '180.010'
          - '180.014'
          - '180.015'
          - '920.001'
          - '920.002'
          - '940.000'
          - '950.001'
          - '950.002'
          - '970.000'
          - '970.001'
          - '980.000'
          example: '130.000'
        item_type:
          type: string
          description: P identifies a product. No other item type is accepted.
          enum:
          - P
          example: P
        product_code:
          type: string
          minLength: 7
          maxLength: 7
          pattern: ^[0-9]{2}[A-Za-z0-9][A-Za-z-][A-Za-z-][A-Za-z0-9]{2}$
          description: >-
            The seven-character FDA product code. The first two digits (industry
            code) must be 73 to 92 for DEV, or 94 to 97 for RAD. A well-formed
            code can still be rejected by ACE if it is no longer valid.
          example: 95R--HH
        commercial_description:
          type:
          - string
          - 'null'
          maxLength: 57
          description: >-
            English commercial description of the product. If omitted, null or
            blank, the product's name, truncated to 57 characters, is used.
            Length is checked after leading and trailing whitespace is removed.
          example: LED lamp
        brand_name:
          type:
          - string
          - 'null'
          maxLength: 35
          description: >-
            Brand name of the product. Leading and trailing whitespace is
            removed before checking the length; a missing or blank value is
            stored as null.
          example: Acme
        compliance_codes:
          type:
          - array
          - 'null'
          description: >-
            Accepted, not stored yet. Only the shape is validated: an array of
            objects with nonblank code and qualifier strings. Values are not
            checked against FDA's code list, stored or forwarded for filing.
            Existing broker-entered compliance codes are preserved when a
            profile is replaced.
          items:
            type: object
            additionalProperties: false
            required:
            - code
            - qualifier
            properties:
              code:
                type: string
                minLength: 1
                pattern: \S
                description: FDA affirmation of compliance code.
              qualifier:
                type: string
                minLength: 1
                pattern: \S
                description: Qualifier for the compliance code.
    FdaProductProfileDisclaim:
      type: object
      additionalProperties: false
      required:
      - profile_type
      - disclaim_code
      description: >-
        Declares that the product is not regulated by FDA. This disclaim covers
        FDA as a whole, not a single program. Sending it replaces the product's
        FDA profile, including any claim; sending the same disclaim again keeps
        the existing one. String values are case-sensitive; leading and trailing
        whitespace is removed before validation. Do not send program_code or
        claim fields, including compliance_codes: they are rejected with 400.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as an FDA disclaim profile.
        profile_fid:
          type: 'null'
          description: >-
            Omit this field or send null. An existing profile cannot be selected
            by FID.
        disclaim_code:
          type: string
          description: >-
            A means this product is not regulated by FDA. No other disclaim code
            is accepted.
          enum:
          - A
          example: A
    FdaProductProfile:
      oneOf:
      - $ref: '#/components/schemas/FdaProductProfileClaim'
      - $ref: '#/components/schemas/FdaProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          claim: '#/components/schemas/FdaProductProfileClaim'
          disclaim: '#/components/schemas/FdaProductProfileDisclaim'
    AphisProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - program_code
      - disclaim_code
      description: >-
        Declares that the product needs no declaration for the specified APHIS
        (Animal and Plant Health Inspection Service) program, and why. APHIS
        Lacey Act profiles go under APHIS_LACEY instead.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as an APHIS disclaim profile.
        program_code:
          type: string
          description: >-
            The APHIS program being disclaimed. APQ: plant protection and
            quarantine. AVS: veterinary services.
          enum:
          - APQ
          - AVS
          example: APQ
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no declaration for this APHIS program.
            A: not regulated by this agency. B: data not required per agency
            guidance.
          enum:
          - A
          - B
          example: A
    AphisProductProfile:
      oneOf:
      - $ref: '#/components/schemas/AphisProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          disclaim: '#/components/schemas/AphisProductProfileDisclaim'
    DeaProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - disclaim_code
      description: >-
        Declares that the product needs no DEA (Drug Enforcement Administration)
        declaration for regulated machines (MAC), and why.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as a DEA disclaim profile.
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no DEA declaration. A: not regulated by
            this agency.
          enum:
          - A
          example: A
    DeaProductProfile:
      oneOf:
      - $ref: '#/components/schemas/DeaProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          disclaim: '#/components/schemas/DeaProductProfileDisclaim'
    EpaPesticidesProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - program_code
      - disclaim_code
      description: >-
        Declares that the product needs no declaration for the specified EPA
        (Environmental Protection Agency) pesticides program, and why. Vehicles
        and engines profiles go under EPA, and TSCA profiles under EPA_TSCA.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: >-
            Discriminator field identifying this as an EPA pesticides disclaim
            profile.
        program_code:
          type: string
          description: >-
            The EPA pesticides program being disclaimed. PS1: registered
            pesticides. PS2: pesticide devices.
          enum:
          - PS1
          - PS2
          example: PS1
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no declaration for this EPA pesticides
            program. A: not regulated by this agency. C: data filed through
            other agency means. D: data filed through paper.
          enum:
          - A
          - C
          - D
          example: A
    EpaPesticidesProductProfile:
      oneOf:
      - $ref: '#/components/schemas/EpaPesticidesProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          disclaim: '#/components/schemas/EpaPesticidesProductProfileDisclaim'
    FwsProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - disclaim_code
      description: >-
        Declares that the product needs no FWS (Fish and Wildlife Service)
        declaration, and why. The profile covers all FWS programs.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as an FWS disclaim profile.
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no FWS declaration. C: data filed
            through other agency means. D: data filed through paper. E: product
            does not contain fish or wildlife, including live, dead, parts or
            products thereof, except as specifically exempted from declaration
            requirements under 50 CFR Part 14. For filing, CBP allows code E
            only on HTS lines with PGA flag FW1; FW3 allows only C or D. This
            endpoint stores the selected code without checking it against the
            product's HTS flags.
          enum:
          - C
          - D
          - E
          example: C
    FwsProductProfile:
      oneOf:
      - $ref: '#/components/schemas/FwsProductProfileDisclaim'
      discriminator:
        propertyName: profile_type
        mapping:
          disclaim: '#/components/schemas/FwsProductProfileDisclaim'
    CpscProductProfileDisclaim:
      type: object
      required:
      - profile_type
      - commercial_description
      - disclaim_code
      description: >-
        Declares that the product needs no CPSC certificate, and why. Sending a
        disclaim replaces all of the product's stored CPSC profiles. The mid,
        cpsc_product_id, cpsc_product_version and certifier_id fields belong to
        a claim_reference and are rejected here unless null.
      properties:
        profile_type:
          type: string
          enum:
          - disclaim
          description: Discriminator field identifying this as a CPSC disclaim profile.
        commercial_description:
          type: string
          minLength: 1
          maxLength: 70
          description: English description of the commercial product. Must not be
            blank.
          example: Bicycle helmets
        disclaim_code:
          type: string
          description: >-
            The reason the product needs no CPSC certificate. A: product is not
            regulated by this agency. B: data is not required per agency
            guidance.
          enum:
          - A
          - B
          example: B
        intended_use_code:
          type:
          - string
          - 'null'
          pattern: ^[0-9]{3}\.[0-9]{3}$
          description: >-
            Intended use of the product, in DDD.DDD format. Required for
            disclaim code A. For code B, omit it or send null to use 130.006;
            any other value is rejected. The API checks the format, not whether
            CPSC accepts the code for filing.
          example: '130.006'
        intended_use_description:
          type:
          - string
          - 'null'
          maxLength: 21
          description: >-
            Human-readable description of the intended use. Required and must
            not be blank when intended_use_code is 980.000; otherwise optional.
          example: Other use
    CpscProductProfileClaimReference:
      type: object
      required:
      - profile_type
      - commercial_description
      - cpsc_product_id
      - cpsc_product_version
      - certifier_id
      description: >-
        References a product registration in the CPSC Product Registry. Sending
        a claim reference updates the stored reference with the same mid, or
        adds one if none matches. Other MIDs' references are kept; a stored
        disclaim or claim_full is replaced. The disclaim_code field is rejected
        here unless null.
      properties:
        profile_type:
          type: string
          enum:
          - claim_reference
          description: >-
            Discriminator field identifying this as a CPSC claim reference
            profile.
        commercial_description:
          type: string
          minLength: 1
          maxLength: 70
          description: English description of the commercial product. Must not be
            blank.
          example: Children's toy
        intended_use_code:
          type:
          - string
          - 'null'
          pattern: ^[0-9]{3}\.[0-9]{3}$
          description: >-
            Intended use of the product, in DDD.DDD format. Optional. The API
            checks the format, not whether CPSC accepts the code for filing.
          example: '130.001'
        intended_use_description:
          type:
          - string
          - 'null'
          maxLength: 21
          description: >-
            Human-readable description of the intended use. Required and must
            not be blank when intended_use_code is 980.000; otherwise optional.
          example: Other use
        mid:
          type:
          - string
          - 'null'
          maxLength: 15
          description: >-
            Manufacturer Identification code. Surrounding whitespace is removed
            and the value is converted to uppercase before matching, so krm0001
            and KRM0001 identify the same reference. Omit it, send null or send
            a blank string for the product-wide fallback, used when no reference
            matches the shipment line's manufacturer MID. Only one reference per
            unique mid is allowed, including one without a mid. Without MIDs,
            send one general reference per product; per-manufacturer references
            require mid.
          example: KRM0001
        cpsc_product_id:
          type: string
          minLength: 1
          maxLength: 19
          description: The product ID in the CPSC Product Registry. Must not be blank.
          example: CPSC-1
        cpsc_product_version:
          type: string
          minLength: 1
          maxLength: 19
          description: >-
            Version of the product registration in the CPSC Product Registry.
            Must not be blank.
          example: '2'
        certifier_id:
          type: string
          minLength: 1
          maxLength: 23
          description: >-
            Identifier of the importer, manufacturer or private label that
            certified the product in the CPSC Product Registry. Must not be
            blank.
          example: CERT-1
    CpscProductProfileClaimFull:
      type: object
      required:
      - profile_type
      - commercial_description
      description: >-
        Stores the product's commercial description for a Flexport customs
        broker to complete the full CPSC declaration manually in NetCHB. This
        profile is stored for the broker, not automatically transmitted to CBP.
        Sending it replaces all of the product's stored CPSC profiles. Only
        profile_type and commercial_description are used; non-null
        disclaim_code, mid, cpsc_product_id, cpsc_product_version, certifier_id,
        intended_use_code and intended_use_description fields are rejected.
      properties:
        profile_type:
          type: string
          enum:
          - claim_full
          description: Discriminator field identifying this as a CPSC full claim profile.
        commercial_description:
          type: string
          minLength: 1
          maxLength: 70
          description: English description of the commercial product. Must not be
            blank.
          example: Children's toy
    CpscProductProfile:
      oneOf:
      - $ref: '#/components/schemas/CpscProductProfileDisclaim'
      - $ref: '#/components/schemas/CpscProductProfileClaimReference'
      - $ref: '#/components/schemas/CpscProductProfileClaimFull'
      discriminator:
        propertyName: profile_type
        mapping:
          disclaim: '#/components/schemas/CpscProductProfileDisclaim'
          claim_reference: '#/components/schemas/CpscProductProfileClaimReference'
          claim_full: '#/components/schemas/CpscProductProfileClaimFull'
    WriteProductClassification:
      type: object
      required:
      - codes
      - region
      properties:
        codes:
          type: array
          description: >-
            Always required. An array of HS codes for this product in the
            provided region
          items:
            type: string
          example:
          - '0301.00'
        region:
          type: string
          description: >-
            Always required. The region for this classification. Currently only
            2-character ISO codes and "EU" are supported
          example: US
        fees:
          type: array
          description: An array of fees associated with this classification
          items:
            $ref: '#/components/schemas/Fee'
        pga_profiles:
          type: object
          description: >-
            Partner Government Agency (PGA) profiles for this classification.
            Only applicable when region is US. APHIS, DEA, EPA_PESTICIDES and
            FWS store disclaims only; automatic filing from these profiles is
            not supported. For these four keys, string values are case-sensitive
            and surrounding whitespace is removed before validation. A non-null
            profile_fid is rejected; omit it or send null. Requests replace the
            product's stored disclaim instead. Invalid input returns 400 and
            rejects the entire product create or update.
          properties:
            EPA:
              description: >-
                EPA VNE (Vehicles and Engines) compliance profile for this
                classification. Only applicable when region is US. EPA TSCA
                profiles go under EPA_TSCA. A product can have no EPA VNE
                profile, or a single claim or disclaim profile. Leaving it out
                keeps the product's existing EPA VNE profile.
              $ref: '#/components/schemas/EpaVneProductProfile'
            EPA_TSCA:
              description: >-
                EPA TSCA (Toxic Substances Control Act) profiles for this
                classification. Only applicable when region is US. A product can
                have no EPA TSCA profile, or a single claim or disclaim profile,
                so the array must hold exactly one profile for now; more may be
                accepted later. Sending it replaces the product's EPA TSCA
                profile; leaving it out, or sending null, keeps the existing
                one. An empty array is rejected.
              type: array
              minItems: 1
              maxItems: 1
              items:
                $ref: '#/components/schemas/EpaTscaProductProfile'
            APHIS_LACEY:
              description: >-
                APHIS Lacey Act profiles for this classification. Only
                applicable when region is US. A product can have no Lacey
                profile, or a single claim or disclaim profile, so the array
                must hold exactly one profile for now; more may be accepted
                later. Sending it replaces the product's Lacey profile; leaving
                it out, or sending null, keeps the existing one. An empty array
                is rejected. When a Flexport customs broker completes the Lacey
                declaration for a shipment, the answer can update the stored
                profile, and a later request replaces it again.
              type: array
              minItems: 1
              maxItems: 1
              items:
                $ref: '#/components/schemas/AphisLaceyProductProfile'
            NHTSA:
              description: >-
                NHTSA (National Highway Traffic Safety Administration) profiles
                for this classification. Only applicable when region is US. A
                product can have no NHTSA profile, or a single claim or disclaim
                profile, so the array must hold exactly one profile for now;
                more may be accepted later. Sending it replaces the product's
                NHTSA profile; leaving it out, or sending null, keeps the
                existing one. An empty array is rejected. When a Flexport
                customs broker completes the NHTSA declaration for a shipment,
                the answer can update the stored profile, and a later request
                replaces it again.
              type: array
              minItems: 1
              maxItems: 1
              items:
                $ref: '#/components/schemas/NhtsaProductProfile'
            AMS:
              description: >-
                AMS (Agricultural Marketing Service) profiles for this
                classification. Only applicable when region is US. The array
                must hold exactly one disclaim profile. If it differs from the
                product's stored AMS profile, it replaces it; if it is the same,
                nothing changes. Leaving it out, or sending null, keeps the
                stored profile. An empty array is rejected.
              type: array
              minItems: 1
              maxItems: 1
              items:
                $ref: '#/components/schemas/AmsProductProfile'
            FDA:
              description: >-
                FDA (Food and Drug Administration) profiles for this
                classification. Only applicable when region is US. The array
                must hold exactly one DEV or RAD claim, or one FDA-wide
                disclaim. Sending a different profile replaces the product's
                stored FDA profile; sending the same profile again keeps it.
                Leaving the key out, or sending null, keeps the stored profile.
                An empty array is rejected; this API does not delete FDA
                profiles. A non-null profile_fid or an unsupported field is
                rejected. Invalid FDA input returns 400 and rejects the entire
                product create or update.
              type:
              - array
              - 'null'
              minItems: 1
              maxItems: 1
              items:
                $ref: '#/components/schemas/FdaProductProfile'
            APHIS:
              description: >-
                APHIS APQ and AVS disclaim profiles for this classification.
                Only applicable when region is US. The array must hold one or
                two disclaim profiles, at most one per program; repeated
                programs are rejected. Sending a program replaces its stored
                disclaim and leaves the other program unchanged. Leaving the key
                out, or sending null, keeps the stored profiles. An empty array
                is rejected. Lacey Act profiles go under APHIS_LACEY instead.
              type:
              - array
              - 'null'
              minItems: 1
              maxItems: 2
              items:
                $ref: '#/components/schemas/AphisProductProfile'
            DEA:
              description: >-
                DEA regulated machines (MAC) disclaim profiles for this
                classification. Only applicable when region is US. The array
                must hold exactly one disclaim profile. Sending it replaces the
                product's stored DEA disclaim; leaving it out, or sending null,
                keeps the stored profile. An empty array is rejected.
              type:
              - array
              - 'null'
              minItems: 1
              maxItems: 1
              items:
                $ref: '#/components/schemas/DeaProductProfile'
            EPA_PESTICIDES:
              description: >-
                EPA pesticides PS1 and PS2 disclaim profiles for this
                classification. Only applicable when region is US. The array
                must hold one or two disclaim profiles, at most one per program;
                repeated programs are rejected. Sending a program replaces its
                stored disclaim and leaves the other program unchanged. Leaving
                the key out, or sending null, keeps the stored profiles. An
                empty array is rejected. Vehicles and engines profiles go under
                EPA, and TSCA profiles under EPA_TSCA.
              type:
              - array
              - 'null'
              minItems: 1
              maxItems: 2
              items:
                $ref: '#/components/schemas/EpaPesticidesProductProfile'
            FWS:
              description: >-
                FWS disclaim profiles for this classification, covering all FWS
                programs. Only applicable when region is US. The array must hold
                exactly one disclaim profile. Sending it replaces the product's
                stored FWS disclaim; leaving it out, or sending null, keeps the
                stored profile. An empty array is rejected.
              type:
              - array
              - 'null'
              minItems: 1
              maxItems: 1
              items:
                $ref: '#/components/schemas/FwsProductProfile'
            CPSC:
              description: >-
                CPSC (Consumer Product Safety Commission) profiles for this
                classification. Only applicable when region is US. The array
                must hold one disclaim, one claim_full, or one or more
                claim_reference entries unique by mid, including at most one
                without a mid. Mixing profile types or repeating a mid is
                rejected. Claim references are matched by mid and updated; other
                MIDs' references are kept. A claim reference replaces a stored
                disclaim or claim_full. Sending a disclaim or claim_full
                replaces all stored CPSC profiles. Leaving the key out, or
                sending null, keeps the stored profiles; an empty array is
                rejected. Individual claim references cannot be removed through
                this API. String values are trimmed before validation, and blank
                optional strings are treated as missing. The fields profile_type
                and disclaim_code are case-sensitive, and mid is converted to
                uppercase. A non-null profile_fid is rejected; omit it or send
                null. Invalid input returns 400 naming the entry and field and
                rejects the entire product create or update.
              type:
              - array
              - 'null'
              minItems: 1
              items:
                $ref: '#/components/schemas/CpscProductProfile'
              example:
              - profile_type: claim_reference
                commercial_description: Children's toy
                mid: KRM0001
                cpsc_product_id: CPSC-1
                cpsc_product_version: '2'
                certifier_id: CERT-1
              - profile_type: claim_reference
                commercial_description: Children's toy
                mid: XYZ0002
                cpsc_product_id: CPSC-2
                cpsc_product_version: '1'
                certifier_id: CERT-1
    WriteProductSupplier:
      type: object
      required:
      - country_of_origin
      properties:
        id:
          type: integer
          description: The supplier location ID. Either id or ref is required.
          example: 12345
        ref:
          type: string
          description: >-
            Your custom string used to refer to the supplier location. Either id
            or ref is required.
          example: FACTORY-123
        country_of_origin:
          type: string
          description: >-
            Always required. ISO Alpha-2 country in which the product is
            manufactured
          example: CN
    CreateProduct:
      type: object
      required:
      - name
      - sku
      properties:
        name:
          type: string
          description: Always required. Name of product
          example: AC Adapter 12V
        sku:
          type: string
          description: Always required. SKU of product
          example: WDVCDFD-RM00472
        description:
          type: string
          description: Description of product
          example: The best 12V AC Adapter on the market
        product_category:
          type: string
          description: The category of the product
          example: Cosmetics
        country_of_origin:
          type: string
          description: Nation in which the product is manufactured
          example: China
        client_verified:
          type: boolean
          description: Indicates whether Client has verified this Product.
          example: true
          default: false
        product_properties:
          type: array
          items:
            $ref: '#/components/schemas/WriteProductProperty'
          description: >-
            Array of product properties, custom key value pairs that describe
            the product
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/WriteProductClassification'
          description: >-
            Array of product classifications. If a value is specified, the array
            of product classifications will replace the existing set of product
            classifications.
        suppliers:
          type: array
          items:
            $ref: '#/components/schemas/WriteProductSupplier'
          description: >-
            Array of suppliers. If a value is specified, the array of suppliers
            will replace the existing set of suppliers.
    UpdateProduct:
      type: object
      properties:
        name:
          type: string
          description: Name of product
          example: AC Adapter 12V
        sku:
          type: string
          description: SKU of product
          example: WDVCDFD-RM00472
        description:
          type: string
          description: Description of product
          example: The best 12V AC Adapter on the market
        product_category:
          type: string
          description: The category of the product
          example: Cosmetics
        country_of_origin:
          type: string
          description: Nation in which the product is manufactured
          example: China
        client_verified:
          type: boolean
          description: Indicates whether Client has verified this Product.
          example: true
        product_properties:
          type: array
          items:
            $ref: '#/components/schemas/WriteProductProperty'
          description: >-
            Array of product properties, custom key value pairs that describe
            the product
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/WriteProductClassification'
          description: >-
            Array of product classifications. If a value is specified, the array
            of product classifications will replace the existing set of product
            classifications.
        suppliers:
          type: array
          items:
            $ref: '#/components/schemas/WriteProductSupplier'
          description: >-
            Array of suppliers. If a value is specified, the array of suppliers
            will replace the existing set of suppliers.
    PurchaseOrderRef:
      type: object
      properties:
        _object:
          type: string
          example: /api/refs/object
        ref_type:
          type: string
          example: /purchase_order
        link:
          type: string
          example: https://api.flexport.com/purchase_orders/123
        id:
          type: integer
          example: 123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    PurchaseOrderLineItem:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /purchase_orders/line_item
        id:
          type: integer
          description: Unique identifier for the line item on the latest version of
            the PO
          example: 123456
        purchase_order:
          $ref: '#/components/schemas/PurchaseOrderRef'
        line_item_number:
          type: integer
          example: 1
        item_key:
          type: string
          description: Custom identifier for the line item
          example: item1
        product:
          allOf:
          - x-deprecated-after-version: 2
          - $ref: '#/components/schemas/Product'
        units:
          type: integer
        unit_cost:
          $ref: '#/components/schemas/Money'
        booking_line_items:
          $ref: '#/components/schemas/BookingLineItemCollectionRef'
        incoterm:
          type: string
          enum:
          - EXW
          - FOB
          - FAS
          - FCA
          - CPT
          - CFR
          - CIF
          - CIP
          - DAT
          - DAP
          - DDP
          - DPU
          example: FOB
        transportation_mode:
          $ref: '#/components/schemas/TransportationMode'
        unit_of_measure:
          type: string
          enum:
          - BBL
          - CAR
          - CGM
          - CKG
          - CM
          - CM2
          - CTN
          - CYK
          - DPC
          - DPR
          - DS
          - FBM
          - G
          - GBQ
          - GR
          - GRL
          - HUN
          - IRG
          - JWL
          - K
          - KG
          - KM
          - KM3
          - KWH
          - L
          - LNM
          - M
          - M2
          - M3
          - MBQ
          - NO
          - OSG
          - PCS
          - PDG
          - PFL
          - PK
          - PRS
          - PTG
          - PX
          - RHG
          - RUG
          - T
          - TDWB
          - W
          - X
          example: BBL
        cargo_ready_date:
          type: string
          format: date
        must_arrive_date:
          type: string
          format: date
        origin_port:
          $ref: '#/components/schemas/Place'
        origin_address:
          $ref: '#/components/schemas/Address'
        destination_port:
          $ref: '#/components/schemas/Place'
        destination_address:
          x-deprecated-after-version: 2
          $ref: '#/components/schemas/Address'
        hs_codes:
          type: array
          items:
            $ref: '#/components/schemas/HsCode'
        metadata:
          $ref: '#/components/schemas/Metadata'
    DeprecatedCompany:
      type: object
      properties:
        _object:
          type: string
        id:
          type: integer
        name:
          type: string
        ref:
          type: string
    PurchaseOrderLineItemCollectionRef:
      type: object
      properties:
        _object:
          type: string
          description: Type of the object
          example: /api/refs/collection
        ref_type:
          type: string
          description: Type of the object in this list
          example: /purchase_orders/line_item
        link:
          type: string
          description: URL to fetch list of objects
          example: >-
            https://api.flexport.com/purchase_order_line_items?f.purchase_order.id=123
      description: '[Expandable API link.](https://apidocs.flexport.com/v2/tag/Expansion)'
    PurchaseOrder:
      type: object
      properties:
        id:
          type: integer
          description: A unique identifier for the purchase order
          example: 2983
        _object:
          type: string
          description: Type of the object
          example: /booking
        name:
          type: string
          description: The name of the purchase order
          example: PO 12345 - "shipment"
        status:
          type: string
          enum:
          - open
          - closed
          - cancelled
          description: The status of the purchase order
          example: open
        incoterm:
          type: string
          enum:
          - EXW
          - FOB
          - FAS
          - FCA
          - CPT
          - CFR
          - CIF
          - CIP
          - DAT
          - DAP
          - DDP
          - DPU
          example: FOB
        transportation_mode:
          $ref: '#/components/schemas/TransportationMode'
        cargo_ready_date:
          type: string
          format: date
        must_arrive_date:
          type: string
          format: date
        buyer:
          x-deprecated-after-version: 2
          $ref: '#/components/schemas/DeprecatedCompany'
        seller:
          x-deprecated-after-version: 2
          $ref: '#/components/schemas/DeprecatedCompany'
        origin_port:
          $ref: '#/components/schemas/Place'
        origin_address:
          $ref: '#/components/schemas/Address'
        destination_port:
          $ref: '#/components/schemas/Place'
        destination_address:
          x-deprecated-after-version: 2
          $ref: '#/components/schemas/Address'
        memo:
          type: string
          example: This message is written in invisible ink
        archived_at:
          type: string
          format: date_time
        created_at:
          type: string
          format: date_time
        updated_at:
          type: string
          format: date_time
        line_items:
          $ref: '#/components/schemas/PurchaseOrderLineItemCollectionRef'
        metadata:
          $ref: '#/components/schemas/Metadata'
    UpdateShipment:
      type: object
      properties:
        metadata:
          type: object
          description: >-
            Metadata to replace existing metadata. Keys should be strings and
            values should be arrays. All existing metadata will be replaced by
            the passed in object.
          example:
            purchase_order:
            - '12345'
