{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "title": "SOM API",
    "version": "1.0"
  },
  "basePath": "/v1/som",
  "paths": {
    "/bookings.get": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_GetBookingRecord",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "query"
          },
          {
            "type": "string",
            "name": "tracking_number",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetRecordResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/bookings.trigger_pickup": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Manually trigger a BookPickup.",
        "operationId": "Som_TriggerPickup",
        "parameters": [
          {
            "type": "string",
            "name": "site_id",
            "in": "query"
          },
          {
            "type": "string",
            "name": "shipping_method",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/TriggerPickupResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/consolidated_shipments.batchGet": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Batch get Consolidated (also known as Bulk or Mother) shipments.",
        "operationId": "Som_BatchGetConsolidatedShipments",
        "parameters": [
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi",
            "name": "consolidated_shipment_ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/BatchGetConsolidatedShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/consolidated_shipments.book": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Book a Consolidated (also known as Bulk or Mother) shipment with the carrier.",
        "operationId": "Som_BookConsolidatedShipment",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/BookConsolidatedShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/BookConsolidatedShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/consolidated_shipments.get": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Get a Consolidated (also known as Bulk or Mother) shipment.",
        "operationId": "Som_GetConsolidatedShipment",
        "parameters": [
          {
            "type": "string",
            "name": "consolidated_shipment_id",
            "in": "query"
          },
          {
            "enum": [
              "SHIPMENTS_IDS_ONLY",
              "SHIPMENTS_SUMMARY",
              "SHIPMENTS_WITH_PARCELS",
              "SHIPMENTS_WITH_LINE_ITEMS",
              "SHIPMENTS_FULL"
            ],
            "type": "string",
            "default": "SHIPMENTS_IDS_ONLY",
            "description": "control the level of expansion for sub resources\n\n - SHIPMENTS_IDS_ONLY: Don't expand shipments, but include shipment id's in method shipment\n - SHIPMENTS_SUMMARY: Only expand top level fields of the shipments\n - SHIPMENTS_WITH_PARCELS: Expand top level fields and Parcels\n - SHIPMENTS_WITH_LINE_ITEMS: Expand top level fields and Items\n - SHIPMENTS_FULL: Fully expand shipments",
            "name": "export",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetConsolidatedShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/consolidated_shipments.list": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Return a list of consolidated shipments that belong to given order.",
        "operationId": "Som_ListConsolidatedShipments",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ListConsolidatedShipmentsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ListConsolidatedShipmentsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/consolidated_shipments.open": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Open a Consolidated (also known as Bulk or Mother) shipment with the carrier.",
        "operationId": "Som_OpenConsolidatedShipment",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/OpenConsolidatedShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/OpenConsolidatedShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/consolidated_shipments.update": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Updates a consolidated shipment.",
        "operationId": "Som_UpdateConsolidatedShipment",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateConsolidatedShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/UpdateConsolidatedShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/consolidated_shipments:count": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Return counts of consolidated shipments for multiple filtering criteria.",
        "operationId": "Som_CountConsolidatedShipments",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CountConsolidatedShipmentsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CountConsolidatedShipmentsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/custom_booking_methods.deleteDraft": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_DeleteDraftCustomBookingMethods",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/DeleteDraftCustomBookingMethodRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/custom_booking_methods.get": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_GetCustomBookingMethod",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetCustomBookingMethodResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/custom_booking_methods.list": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_ListCustomBookingMethods",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ListCustomBookingMethodsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ListCustomBookingMethodsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/custom_booking_methods.prompt": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_AICreateCustomBookingMethods",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AICreateCustomBookingMethodsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/AICreateCustomBookingMethodsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/custom_booking_methods.publish": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_PublishCustomBookingMethods",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PublishCustomBookingMethodsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/custom_booking_methods.saveDraft": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_SaveDraftCustomBookingMethods",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SaveDraftCustomBookingMethodsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/custom_booking_methods.test": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_TestCustomBookingMethods",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/TestCustomBookingMethodsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/TestCustomBookingMethodsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/customs_declaration.upsert": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Add or update (overwrite if it's already exists) customs declaration to existing, with not booked parcels (see 'Book Parcels'), shipment.",
        "operationId": "Som_UpsertCustomsDeclaration",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpsertCustomsDeclarationRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/UpsertCustomsDeclarationResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/deliveries.bookPickup": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Notify the shipping company about the delivery.",
        "operationId": "Som_BookPickup",
        "parameters": [
          {
            "description": "Book a pickup with the shipping company.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/BookPickupRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/BookPickupResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/deliveries.cancel": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Cancels a delivery by its tracking number.",
        "operationId": "Som_CancelDelivery",
        "parameters": [
          {
            "description": "Request to cancel a delivery if the shipment has not been picked up yet.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CancelDeliveryRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/deliveries.get": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Return a Delivery either by id or tracking number.",
        "operationId": "Som_GetDelivery",
        "parameters": [
          {
            "type": "string",
            "description": "Delivery ID",
            "name": "id",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Delivery tracking number",
            "name": "tracking_number",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetDeliveryResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/fetch_pickup_locations": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Fetch pickup locations for a shipment",
        "operationId": "Som_FetchPickupLocations",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FetchPickupLocationsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/FetchPickupLocationsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/pending_shipments.count": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_CountPendingShipments",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CountPendingShipmentsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CountPendingShipmentsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/pending_shipments.get": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Return the shipment by specifiying a shipmentID or deliveryID of that shipment.",
        "operationId": "Som_GetPendingShipment",
        "parameters": [
          {
            "type": "string",
            "description": "Shipment ID",
            "name": "lookup_id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetPendingShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/pending_shipments.list": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "Som_ListPendingShipments",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ListPendingShipmentsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ListPendingShipmentsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.add_parcel": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Add parcel to existing, not yet booked for pickup, shipment. If the shipment is booked then the\nparcel will be booked as well. If a return shipment is connected with the provided shipment,\nthe parcel will be added to that shipment as well.",
        "operationId": "Som_AddParcel",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AddParcelRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/AddParcelResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.bookParcels": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Create a booking with the shipping company. Tracking\nnumbers, tracking links and shipping labels are generated.",
        "operationId": "Som_BookParcels",
        "parameters": [
          {
            "description": "Perform a booking request to generate tracking numbers, shipping\nlabels and tracking links.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/BookParcelsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/BookParcelsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.book_parcels_bulk": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Same as BookParcels, but for multiple shipment at once.",
        "operationId": "Som_BookParcelsBulk",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/BookParcelsBulkRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/BookParcelsBulkResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.cancel": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Cancels a shipment by its id.\nReturn nothing if canceled successfully. Shipment status will be updated to CANCELED.\nIf we fail to cancel the shipment, an error will be returned.\nIf the carrier denied the cancellation, or we where unable to cancel, the status of the shipment will be updated to FAILED_TO_CANCEL.",
        "operationId": "Som_CancelShipment",
        "parameters": [
          {
            "description": "Request to cancel a shipment if the shipment has not been picked up yet.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CancelShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.create": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Create a Shipment together with parcels and deliveries.",
        "operationId": "Som_CreateCompositeShipment",
        "parameters": [
          {
            "description": "Request object that is used to create a Shipment together with Parcels\nand Deliveries all at once.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.createAndBook": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Create a shipment together with parcels and deliveries, then generate labels and tracking numbers and finally book pickup for all deliveries.",
        "operationId": "Som_CreateAndBookShipment",
        "parameters": [
          {
            "description": "Request object that is used to create a Shipment together with Parcels\nand Deliveries all at once.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.createAndBookFromSession": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Create a shipment together with parcels and deliveries, then generate labels and tracking numbers and finally book pickup for all deliveries based on the information in a cos session and some additional information.",
        "operationId": "Som_CreateAndBookShipmentFromSession",
        "parameters": [
          {
            "description": "Request object that is used to create a Shipment from another source, for example via a COS session.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentFromRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.createFrom": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Create a shipment with parcels and deliveries based on the information in a cos session and some additional information.",
        "operationId": "Som_CreateCompositeShipmentFrom",
        "parameters": [
          {
            "description": "Request object that is used to create a Shipment from another source, for example via a COS session.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentFromRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.createFromOrder": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Deprecated: use CreateCompositeShipment instead.\nCreate a shipment with parcels and deliveries based on the information stored in an order and some additional attributes. [deprecated]",
        "operationId": "Som_CreateCompositeShipmentFromOrder",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentFromOrderRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.get": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Return the shipment by specifiying a shipmentID or deliveryID of that shipment.",
        "operationId": "Som_GetShipment",
        "parameters": [
          {
            "type": "string",
            "description": "Shipment ID",
            "name": "id",
            "in": "query"
          },
          {
            "type": "string",
            "name": "delivery_id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.hydrate": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "HydrateShipment takes a request and runs the manipulations on CreateCompositeShipmentRequest\ndone before the shipment is created. This dry-run is useful when you want to see the result of\nthe manipulations before the shipment is created. Hydrate does not validate the shipment.",
        "operationId": "Som_HydrateShipment",
        "parameters": [
          {
            "description": "Request object that is used to create a Shipment together with Parcels\nand Deliveries all at once.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCompositeShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/HydrateShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.list": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Return a paginated list of shipments matching filters.",
        "operationId": "Som_ListShipments",
        "parameters": [
          {
            "description": "Request for listing shipments matching filter.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ListShipmentsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ListShipmentsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.schedulePickup": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Schedule the shipment for pickup by the carrier service.",
        "operationId": "Som_SchedulePickup",
        "parameters": [
          {
            "description": "Schedule the shipment for pickup by the carrier service.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SchedulePickupRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.send_freight_documents": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Send freight documents for return shipment.",
        "operationId": "Som_SendFreightDocumentsForReturnShipment",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SendFreightDocumentsForReturnShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.totalCount": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Get a total number of shipments.",
        "operationId": "Som_TotalShipmentsCount",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/TotalShipmentsCountResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.update": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Updates a shipment. Parcels and deliveries will also be updated if applicable.",
        "operationId": "Som_UpdateShipment",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateShipmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/UpdateShipmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/shipments.updateNotes": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "Updates the shipment notes.",
        "operationId": "Som_UpdateShipmentNotes",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateShipmentNotesRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/UpdateShipmentNotesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "AICreateCustomBookingMethodsRequest": {
      "type": "object",
      "properties": {
        "prompt_history": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Prompt"
          }
        },
        "raw_custom_booking_methods": {
          "type": "string"
        }
      }
    },
    "AICreateCustomBookingMethodsResponse": {
      "type": "object",
      "properties": {
        "custom_booking_methods": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CustomBookingMethod"
          }
        },
        "response": {
          "$ref": "#/definitions/Prompt"
        }
      }
    },
    "AddParcelRequest": {
      "type": "object",
      "properties": {
        "parcel": {
          "title": "Parcel details contains information about the parcel. If not provided the first existing parcel will be duplicated. [optional]",
          "$ref": "#/definitions/ParcelDetails"
        },
        "shipment_id": {
          "type": "string"
        },
        "site_id": {
          "type": "string"
        }
      }
    },
    "AddParcelResponse": {
      "type": "object",
      "properties": {
        "shipment": {
          "$ref": "#/definitions/Shipment"
        }
      }
    },
    "Addon": {
      "description": "Describes an additional service provided by shipping method.",
      "type": "object",
      "properties": {
        "code": {
          "description": "External code, as defined in carrier's system.",
          "type": "string"
        },
        "data": {
          "description": "Additional data that has to be passed to use the addon.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "description": {
          "description": "Description of the addon.",
          "type": "string"
        },
        "name": {
          "description": "Internal identifier of an addon.",
          "type": "string"
        }
      }
    },
    "Address": {
      "description": "Common address entity that used almost everywhere in Ingrid's API.",
      "type": "object",
      "properties": {
        "address_lines": {
          "type": "array",
          "title": "List of address lines part of address such as street and building number",
          "items": {
            "type": "string"
          }
        },
        "apartment_number": {
          "description": "Number of the apartment.",
          "type": "string"
        },
        "attn": {
          "type": "string",
          "title": "Attention field. Can be used to indicate an employee if the address is a\ncompany address [optional]"
        },
        "building_name": {
          "type": "string",
          "title": "in the UK some buildings do not have a number, only a name"
        },
        "care_of": {
          "type": "string",
          "title": "Care of part of address usually written as `c/o` [optional]"
        },
        "city": {
          "type": "string",
          "title": "Name of the city"
        },
        "coordinates": {
          "description": "Geolocation coordinates of the address. If reverse geolocation lookup of the\naddress was successful this property will be populated. If coordinates are\navailable they will be used to in service point search. In case of\n`search_address` coordinates can also be set by merchant if known.",
          "$ref": "#/definitions/Coordinates"
        },
        "country": {
          "description": "Country should be specified as two uppercase letters (ISO Alpha-2).\nExample `SE` for Sweden, `ES` for Spain.",
          "type": "string"
        },
        "door_code": {
          "type": "string",
          "title": "The door code to the main entrance of the building if applicable [optional]"
        },
        "floor_number": {
          "type": "string",
          "title": "Floor number [optional]"
        },
        "name": {
          "type": "string",
          "title": "Customer or company name"
        },
        "po_box_id": {
          "type": "string",
          "title": "ID of the PO Box [optional]"
        },
        "postal_code": {
          "type": "string",
          "title": "Postal code (or zipcode in US)"
        },
        "region": {
          "type": "string",
          "title": "Region can be a state or a province [optional]"
        },
        "street": {
          "description": "Name of the street.",
          "type": "string"
        },
        "street_number": {
          "description": "Number of the street.",
          "type": "string"
        },
        "subregion": {
          "type": "string",
          "title": "Further division of regions. Example countries are GB, IE, IT, LT, MX\nFor example for The Republic Of Ireland there are 4 provinces (regions),\ne.g. `Connacht` and 26 counties (subregions), e.g. `Galway`\nFormat is ISO 3166 where applicable, exceptions are e.g. Mexico [optional]"
        }
      }
    },
    "Any": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "BatchGetConsolidatedShipmentResponse": {
      "type": "object",
      "properties": {
        "consolidated_shipments": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ConsolidatedShipment"
          }
        }
      }
    },
    "BookConsolidatedShipmentRequest": {
      "type": "object",
      "properties": {
        "consolidated_shipment_id": {
          "description": "[required] Consolidated Shipment ID that is to be booked.",
          "type": "string"
        },
        "customs_declaration": {
          "description": "Holds information about customs declaration for the consolidated shipment.",
          "$ref": "#/definitions/CustomsDeclaration"
        },
        "meta": {
          "description": "[optional] Shipment metadata tags. Any new ones will be added.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "pallets": {
          "description": "[required] Pallets included in the shipment.\nThe length of the array corresponds to the number of pallets.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Pallet"
          }
        }
      }
    },
    "BookConsolidatedShipmentResponse": {
      "type": "object",
      "properties": {
        "consolidated_shipment": {
          "$ref": "#/definitions/ConsolidatedShipment"
        }
      }
    },
    "BookParcelsBulkRequest": {
      "type": "object",
      "required": [
        "shipment_ids"
      ],
      "properties": {
        "shipment_ids": {
          "description": "The IDs of the shipments which parcels should be booked.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "BookParcelsBulkResponse": {
      "type": "object",
      "properties": {
        "failed_shipment_ids": {
          "description": "The IDs of the shipments which parcels failed to book.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "succeeded_shipment_ids": {
          "description": "The IDs of the shipments which parcels successfully booked.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "BookParcelsRequest": {
      "description": "Perform a booking request to generate tracking numbers, shipping\nlabels and tracking links.",
      "type": "object",
      "properties": {
        "shipment_id": {
          "type": "string",
          "title": "The ID of the shipment which parcels should be booked. [required]"
        }
      }
    },
    "BookParcelsResponse": {
      "description": "Returns latest shipment state together with generated shipping\nlabels, tracking numbers and tracking links.",
      "type": "object",
      "properties": {
        "shipment": {
          "title": "Current shipment object state",
          "$ref": "#/definitions/Shipment"
        }
      }
    },
    "BookPickupRequest": {
      "description": "Book a pickup with the shipping company.",
      "type": "object",
      "properties": {
        "tracking_number": {
          "type": "string",
          "title": "Tracking number of the delivery which should be booked. [required]"
        }
      }
    },
    "BookPickupResponse": {
      "description": "Returns the state of the booked delivery.",
      "type": "object",
      "properties": {
        "delivery": {
          "title": "Booked delivery state",
          "$ref": "#/definitions/Delivery"
        }
      }
    },
    "BookingMethodStatus": {
      "type": "string",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "DRAFT",
        "PUBLISHED",
        "ARCHIVED"
      ]
    },
    "BookingRecord": {
      "description": "Represents a delivery that is or has to be booked.",
      "type": "object",
      "properties": {
        "executed_at": {
          "type": "string"
        },
        "ftp_name": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "site_id": {
          "type": "string"
        },
        "strategy": {
          "$ref": "#/definitions/Strategy"
        },
        "tracking_number": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "CancelDeliveryRequest": {
      "description": "Request to cancel a delivery if the shipment has not been picked up yet.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "Delivery ID"
        },
        "tracking_number": {
          "type": "string",
          "title": "Delivery tracking number"
        }
      }
    },
    "CancelShipmentRequest": {
      "description": "Request to cancel a shipment if the shipment has not been picked up yet.",
      "type": "object",
      "properties": {
        "shipment_id": {
          "type": "string",
          "title": "Shipment ID"
        }
      }
    },
    "ConsolidatedShipment": {
      "type": "object",
      "properties": {
        "carrier_contract_id": {
          "description": "[optional] ID of the carrier contract to be used for booking.",
          "type": "string"
        },
        "created_at": {
          "description": "[output] Status of the consolidated shipment.\nStatus status = 14;\n[output] Timestamp when consolidated shipment was created. RFC-3339 format.",
          "type": "string"
        },
        "customs_declaration": {
          "description": "Holds information about customs declaration for the consolidated shipment.",
          "$ref": "#/definitions/CustomsDeclaration"
        },
        "documents": {
          "description": "[output] URL of the consolidated shipment's documents.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ConsolidatedShipmentDocuments"
          }
        },
        "external_id": {
          "description": "[optional] External ID of the shipment. Can be used to store a unique identifier from the merchant.",
          "type": "string"
        },
        "from": {
          "description": "[required] Address where the shipment will be dispatched from. Most often the address of the warehouse.",
          "$ref": "#/definitions/Party"
        },
        "id": {
          "description": "[output] ID of the shipment (uuid).",
          "type": "string"
        },
        "meta": {
          "type": "object",
          "title": "[optional] Shipment metadata tags",
          "additionalProperties": {
            "type": "string"
          }
        },
        "pallets": {
          "type": "array",
          "title": "[required] Pallets included in the shipment. The length of the array corresponds to the number of pallets. Must include at least one pallet",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Pallet"
          }
        },
        "shipment_ids": {
          "type": "array",
          "title": "[output] IDs of the shipments that are part of the consolidated shipment. Shipments are added when booking them",
          "items": {
            "type": "string"
          }
        },
        "shipping_date": {
          "description": "[required] Date when the shipment will most likely be dispatched from the warehouse. RFC-3339 format.",
          "type": "string"
        },
        "shipping_method": {
          "type": "string",
          "title": "[required] Shipping method for the consolidated shipment"
        },
        "site_id": {
          "description": "[output] Site ID to which the shipment belongs to.",
          "type": "string"
        },
        "status": {
          "title": "[output] Status of the shipment",
          "$ref": "#/definitions/ConsolidatedShipmentStatus"
        },
        "to": {
          "description": "[required] Destination address. For example address of the distribution center of the carrier.",
          "$ref": "#/definitions/Party"
        },
        "tracking_number": {
          "description": "[output] Tracking number for the consolidated shipment.",
          "type": "string"
        },
        "transport_payer": {
          "description": "[optional]  Defines who is billed for freight/transport charges.",
          "$ref": "#/definitions/Payer"
        },
        "updated_at": {
          "description": "[output] Timestamp when consolidated shipment was last updated. RFC-3339 format.",
          "type": "string"
        }
      }
    },
    "ConsolidatedShipmentDetails": {
      "description": "ConsolidatedShipmentDetails contains the details of a Consolidated Shipment that this shipment can be a part of.",
      "type": "object",
      "properties": {
        "consolidated_shipment_id": {
          "description": "[Required] ID of the consolidated shipment that this shipment is part of.",
          "type": "string"
        }
      }
    },
    "ConsolidatedShipmentDocuments": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "Id of the document. Might be useful for returning CMR/Waybill number"
        },
        "name": {
          "type": "string",
          "title": "Name of the document"
        },
        "type": {
          "title": "Type of the document",
          "$ref": "#/definitions/ConsolidatedShipmentDocumentsDocumentType"
        },
        "url": {
          "type": "string",
          "title": "The url that points to the document"
        }
      }
    },
    "ConsolidatedShipmentDocumentsDocumentType": {
      "type": "string",
      "default": "DOCUMENT_UNKNOWN",
      "enum": [
        "DOCUMENT_UNKNOWN",
        "INVOICE",
        "CMR",
        "TRANSPORT_LABEL"
      ]
    },
    "ConsolidatedShipmentStatus": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "title": "Used to attach a message to the current status. [optional]"
        },
        "type": {
          "title": "The type of the status. Used to determine the state of the shipment. [required]",
          "$ref": "#/definitions/ConsolidatedShipmentStatusStatusType"
        }
      }
    },
    "ConsolidatedShipmentStatusStatusType": {
      "type": "string",
      "title": "- CREATED: CREATED is the initial state of the consolidated shipment.\n - BOOKED: BOOKED indicates that consolidated shipment has been booked, also known as having a label generated for it.\n - CANCELED: CANCELED indicates that the delivery has been suspended and will not proceed.\n - INVALID_BOOKING: INVALID_BOOKING indicates that a booking failed due to a bad request to the carrier service.\n - CANCEL_FAILED: CANCEL_FAILED indicates that the shipment could not be canceled by the carrier",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "CREATED",
        "BOOKED",
        "CANCELED",
        "INVALID_BOOKING",
        "CANCEL_FAILED"
      ]
    },
    "ConsolidatedShipmentsFiltering": {
      "type": "object",
      "title": "For internal use [internal]",
      "properties": {
        "created_at_range": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "id": {
          "type": "string"
        },
        "shipping_date_range": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "shipping_methods": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "statuses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ConsolidatedShipmentStatusStatusType"
          }
        }
      }
    },
    "Contents": {
      "description": "Contents contains all goods sent in a Shipment or Parcel. Goods can either be\ndefined directly by providing the full details of the goods, it can be\nreferenced by transport order id or an external reference to goods defined by\nan external system.",
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "title": "Description of the contents. [optional]"
        },
        "external_orders": {
          "description": "External orders contained in this shipment.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ExternalOrderContentItem"
          }
        },
        "goods": {
          "description": "Goods a.k.a. line items.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/LineItem"
          }
        },
        "transport_orders": {
          "description": "Transport orders contained in this shipment, so called consolidated shipment.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TransportOrderContentItem"
          }
        }
      }
    },
    "ContentsType": {
      "type": "string",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "DOCUMENTS",
        "GIFT",
        "COMMERCIAL_SAMPLE",
        "SALE",
        "RETURN",
        "OTHER",
        "DANGEROUS_GOODS",
        "HUMANITARIAN_DONATIONS"
      ]
    },
    "Coordinates": {
      "type": "object",
      "title": "Geolocation coordinates",
      "properties": {
        "lat": {
          "type": "number",
          "format": "double",
          "title": "Latitude"
        },
        "lng": {
          "type": "number",
          "format": "double",
          "title": "Longitude"
        }
      }
    },
    "CountConsolidatedShipmentsRequest": {
      "type": "object",
      "title": "For internal use [internal]",
      "properties": {
        "filters": {
          "type": "array",
          "title": "List of filtering criteria to count consolidated shipments for",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ConsolidatedShipmentsFiltering"
          }
        }
      }
    },
    "CountConsolidatedShipmentsResponse": {
      "type": "object",
      "title": "For internal use [internal]",
      "properties": {
        "results": {
          "type": "array",
          "title": "List of count results, one for each filter in the request",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CountConsolidatedShipmentsResponseCountResult"
          }
        }
      }
    },
    "CountConsolidatedShipmentsResponseCountResult": {
      "type": "object",
      "properties": {
        "count": {
          "type": "string",
          "format": "int64",
          "title": "The count of consolidated shipments matching the filter"
        },
        "filter": {
          "title": "The filtering criteria that was applied",
          "$ref": "#/definitions/ConsolidatedShipmentsFiltering"
        }
      }
    },
    "CountPendingShipmentsRequest": {
      "type": "object",
      "properties": {
        "filtering": {
          "$ref": "#/definitions/FilteringPendingShipments"
        }
      }
    },
    "CountPendingShipmentsResponse": {
      "type": "object",
      "properties": {
        "total_count": {
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "CreateCompositeShipmentFromOrderRequest": {
      "type": "object",
      "title": "Request object that is used to create a Shipment from order. [deprecated]",
      "properties": {
        "addons": {
          "description": "List of addons.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Addon"
          }
        },
        "address_return": {
          "description": "Address where deliveries of this shipment should be returned to. [optional]\nA default return address is taken from the sender address (\"address_from\") which is usually the address of the warehouse.",
          "$ref": "#/definitions/Address"
        },
        "carrier_contract_id": {
          "type": "string",
          "title": "ID of the carrier contract to be used for booking. [optional]"
        },
        "contents": {
          "title": "Contents of the shipment",
          "$ref": "#/definitions/Contents"
        },
        "courier_instructions": {
          "description": "Optional instructions to the courier.",
          "type": "string"
        },
        "customs_declaration": {
          "description": "Must be fully specified in case customs declaration should be generated for shipment.",
          "$ref": "#/definitions/CustomsDeclaration"
        },
        "delivery_time": {
          "description": "Time range when the deliveries will most likely be delivered to the customer.",
          "$ref": "#/definitions/DateTimeRange"
        },
        "external_id": {
          "description": "Can be used to store a unique identifier from the merchant. For example\nexternal order ID or external shipment ID.",
          "type": "string"
        },
        "meta": {
          "description": "Generic key-value object that can be used to attach additional\ninformation to the shipment.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "number_of_parcels": {
          "type": "string",
          "format": "uint64",
          "title": "Number of parcels to generate. If supplied it will override the number\nof parcels created for this shipment. Otherwise the number of parcels\nwill default to one"
        },
        "parcel_free_text": {
          "description": "ParcelFreeText is a custom description to be assigned to all parcels in the shipment.",
          "type": "string"
        },
        "shipping_date": {
          "type": "string",
          "title": "The date that the shipment will most likely be dispatched from the warehouse. [required]"
        },
        "shipping_method": {
          "description": "Specific shipping product ID by which the generated parcels should be delivered. If tos_id is provided and the\nreferenced order has field metadata.session.method, this field is optional. Otherwise, it is required.",
          "type": "string"
        },
        "tos_id": {
          "type": "string",
          "title": "TosId is an order ID as given from TOS. [required]"
        }
      }
    },
    "CreateCompositeShipmentFromRequest": {
      "description": "Request object that is used to create a Shipment from another source, for example via a COS session.",
      "type": "object",
      "properties": {
        "address_return": {
          "description": "Address where deliveries of this shipment should be returned to. [optional]\nA default return address is taken from the sender address (\"address_from\") which is usually the address of the warehouse.",
          "$ref": "#/definitions/Address"
        },
        "carrier_contract_id": {
          "type": "string",
          "title": "ID of the carrier contract to be used for booking. [optional]"
        },
        "cos_session_id": {
          "type": "string",
          "title": "CosSessionId a session id as given from COS. [required]"
        },
        "customs_declaration": {
          "description": "Must be fully specified in case customs declaration should be generated for shipment.",
          "$ref": "#/definitions/CustomsDeclaration"
        },
        "number_of_parcels": {
          "description": "Number of parcels to generate. If supplied it will override the number\nof parcels created for this shipment. Otherwise the number of parcels\nwill default to one.",
          "type": "string",
          "format": "uint64"
        },
        "parcel_free_text": {
          "description": "ParcelFreeText is a custom description to be assigned to all parcels in the shipment.\nCannot be used together with parcels.free_text.",
          "type": "string"
        },
        "parcels": {
          "description": "If the parcels element is provided the number_of_parcels field should be set to the length of the\nparcels array or when number_of_parcel value is skipped the number_of_parcel will be calculated\nbased on parcels array length.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ParcelDetails"
          }
        },
        "shipping_date": {
          "type": "string",
          "title": "The date that the shipment will most likely be dispatched from the warehouse. [required]"
        }
      }
    },
    "CreateCompositeShipmentRequest": {
      "description": "Request object that is used to create a Shipment together with Parcels\nand Deliveries all at once.",
      "type": "object",
      "properties": {
        "addons": {
          "description": "Addons that should be used for the shipment.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Addon"
          }
        },
        "address_from": {
          "title": "Address where the shipment will be dispatched from. Most often the\naddress of the warehouse. [required]",
          "$ref": "#/definitions/Address"
        },
        "address_from_location_ref": {
          "description": "ID of the warehouse, from which package will be delivered.",
          "type": "string"
        },
        "address_return": {
          "description": "Address where deliveries of this shipment should be returned to. [optional]\nA default return address is taken from the sender address (\"address_from\") which is usually the address of the warehouse.",
          "$ref": "#/definitions/Address"
        },
        "address_to": {
          "title": "Destination address. For example address of the service point or the click\nand collect store. [required]",
          "$ref": "#/definitions/Address"
        },
        "carrier_contract_id": {
          "type": "string",
          "title": "ID of the carrier contract to be used for booking. [optional]"
        },
        "consolidated_shipment": {
          "description": "[optional] Info on the Consolidated shipment that this shipment is part of.",
          "$ref": "#/definitions/ConsolidatedShipmentDetails"
        },
        "contents": {
          "description": "Contents of shipment. Can be of different types - goods, transport orders and external orders.\nEither contents has to be provided on the shipment or on each parcel, but not both.",
          "$ref": "#/definitions/Contents"
        },
        "courier_instructions": {
          "type": "string",
          "title": "Optional instructions to the courier"
        },
        "customer_info": {
          "description": "Contains the customer information such as name, email, phone and address. This field can be omitted, only if tos_id\nis not empty and the referenced order has enough data to derive customer info from it.",
          "$ref": "#/definitions/CustomerInfo"
        },
        "customs_declaration": {
          "description": "Must be fully specified in case customs declaration should be generated for shipment.",
          "$ref": "#/definitions/CustomsDeclaration"
        },
        "delivery_time": {
          "description": "Time range when the deliveries will most likely be delivered to the customer.",
          "$ref": "#/definitions/DateTimeRange"
        },
        "dimensions": {
          "description": "Dimensions will override the dimensions for each created parcel. Unit is millimeters (mm) [deprecated].",
          "$ref": "#/definitions/Dimensions"
        },
        "direction_type": {
          "title": "DirectionType informs about initial shipment direction. [optional]",
          "$ref": "#/definitions/DirectionType"
        },
        "external_id": {
          "description": "Can be used to store a unique identifier from the merchant. For example\nexternal order ID or external shipment ID.",
          "type": "string"
        },
        "line_items": {
          "type": "array",
          "title": "Use `contents` instead [deprecated]",
          "items": {
            "type": "object",
            "$ref": "#/definitions/LineItem"
          }
        },
        "location_ref": {
          "description": "ID of the pickup location where the parcels should be delivered to.",
          "type": "string"
        },
        "location_type": {
          "title": "Indicates the kind of pickup location [optional]",
          "$ref": "#/definitions/PickupLocationType"
        },
        "meta": {
          "description": "Generic key-value object that can be used to attach additional\ninformation to the shipment.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "number_of_parcels": {
          "description": "Number of parcels to generate if parcel details is not provided. Defaults to 1 if not set. If\nparcel details is used then this should not be set.",
          "type": "string",
          "format": "uint64"
        },
        "outbound_shipment_id": {
          "type": "string",
          "title": "ID of the OUTBOUND shipment (delivered from merchant to customer). Must be used only for the return shipment creation (with direction_type = \"RETURN\"). [optional]"
        },
        "parcel_free_text": {
          "description": "Custom description (notes) that will be assigned to all parcels in the shipment.\nCannot be used together with parcels.free_text.",
          "type": "string"
        },
        "parcels": {
          "description": "If provided, the number_of_parcels field should be set to the length of the parcels array or\nif number_of_parcel is not set it will be calculated based on parcels array length.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ParcelDetails"
          }
        },
        "pending_shipment_id": {
          "description": "ID of the pending shipment that this shipment is based on.",
          "type": "string"
        },
        "shipment_value": {
          "description": "Total value of the shipment including tax. Example 10000 is 100 SEK.",
          "type": "string",
          "format": "uint64"
        },
        "shipping_category_ref": {
          "description": "ID of shipping category that user choice belongs to. It's used to resolve virtual methods connected with ship. category.",
          "type": "string"
        },
        "shipping_date": {
          "type": "string",
          "title": "The date that the shipment will most likely be dispatched from the warehouse. [required]"
        },
        "shipping_method": {
          "type": "string",
          "title": "Specific shipping product ID by which the generated parcels should be delivered. [required]"
        },
        "tos_id": {
          "description": "Order ID from TOS. [optional] If provided, shipment details from the TOS will be used to\npopulate fields not set in the request. Fields provided in the request will override fields\nfrom the TOS.",
          "type": "string"
        },
        "transport_payer": {
          "description": "[optional]  Defines who is billed for freight/transport charges.",
          "$ref": "#/definitions/Payer"
        },
        "weight": {
          "description": "Weight in grams (g). If using parcels instead of number_of_parcels, prefer to set weight\nindividually on each parcel. If not set, the weight will be calculated as the sum of the\nweights of the Contents.Goods (if available).",
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "CreateCompositeShipmentResponse": {
      "description": "Response from the shipment create call. Contains the latest shipment state.",
      "type": "object",
      "properties": {
        "shipment": {
          "title": "Current shipment object state",
          "$ref": "#/definitions/Shipment"
        }
      }
    },
    "CustomBookingMethod": {
      "type": "object",
      "properties": {
        "addresses": {
          "$ref": "#/definitions/CustomBookingMethodAddresses"
        },
        "booking_method": {
          "type": "string"
        },
        "carrier": {
          "description": "Carrier full name.",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "name": {
          "description": "Name of the shipping product.",
          "type": "string"
        },
        "return_booking": {
          "$ref": "#/definitions/CustomBookingMethodReturnBooking"
        },
        "status": {
          "$ref": "#/definitions/BookingMethodStatus"
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CustomBookingMethodStep"
          }
        }
      }
    },
    "CustomBookingMethodAddresses": {
      "type": "object",
      "properties": {
        "return": {
          "$ref": "#/definitions/Address"
        }
      }
    },
    "CustomBookingMethodReturnBooking": {
      "type": "object",
      "properties": {
        "label_consolidation": {
          "type": "boolean"
        },
        "method": {
          "type": "string"
        },
        "use_address_from_as_return": {
          "type": "boolean"
        }
      }
    },
    "CustomBookingMethodStep": {
      "type": "object",
      "properties": {
        "actions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/StepExpression"
          }
        },
        "filters": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/StepExpression"
          }
        },
        "name": {
          "type": "string"
        }
      }
    },
    "CustomBookingMethodTestRunLog": {
      "type": "object",
      "properties": {
        "custom_booking_methods": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/CustomBookingMethod"
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/StepLog"
          }
        }
      }
    },
    "CustomBookingsMethodTestRun": {
      "type": "object",
      "properties": {
        "errors": {
          "description": "Errors produced during preparation of the shipment, or during the CBM engine execution.",
          "type": "string"
        },
        "input_shipment": {
          "$ref": "#/definitions/CreateCompositeShipmentRequest"
        },
        "output_shipment": {
          "$ref": "#/definitions/CreateCompositeShipmentRequest"
        },
        "run_logs": {
          "$ref": "#/definitions/CustomBookingMethodTestRunLog"
        }
      }
    },
    "CustomerInfo": {
      "type": "object",
      "title": "Contains the necessary information about a customer in order to make a delivery",
      "properties": {
        "address": {
          "description": "Customer's home address.",
          "$ref": "#/definitions/Address"
        },
        "email": {
          "description": "Customer's email.",
          "type": "string"
        },
        "national_identification_number": {
          "description": "Customer's national identification number, eg. SSN.",
          "type": "string"
        },
        "phone": {
          "description": "Customer's mobile phone number.",
          "type": "string"
        }
      }
    },
    "Customs": {
      "type": "object",
      "properties": {
        "declaration": {
          "description": "Customs declaration provided in request.",
          "$ref": "#/definitions/CustomsDeclaration"
        },
        "document": {
          "description": "Customs declaration document available after booking the parcel with customs declaration request.",
          "$ref": "#/definitions/CustomsDeclarationDocument"
        }
      }
    },
    "CustomsDeclaration": {
      "type": "object",
      "properties": {
        "cn22": {
          "description": "Deprecated, use GeneralCustomsDeclaration",
          "title": "Use GeneralCustomsDeclaration instead. [deprecated]",
          "$ref": "#/definitions/DeclarationCN"
        },
        "cn23": {
          "description": "Deprecated, use GeneralCustomsDeclaration",
          "title": "Use GeneralCustomsDeclaration instead. [deprecated]",
          "$ref": "#/definitions/DeclarationCN"
        },
        "cp72": {
          "description": "Deprecated, use GeneralCustomsDeclaration",
          "title": "Use GeneralCustomsDeclaration instead. [deprecated]",
          "$ref": "#/definitions/DeclarationCN"
        },
        "electronic_invoice_fedex": {
          "description": "Deprecated, use GeneralCustomsDeclaration",
          "title": "Use GeneralCustomsDeclaration instead. [deprecated]",
          "$ref": "#/definitions/ElectronicInvoiceFedex"
        },
        "electronic_invoice_lotte": {
          "description": "Deprecated, use GeneralCustomsDeclaration",
          "title": "Use GeneralCustomsDeclaration instead. [deprecated]",
          "$ref": "#/definitions/ElectronicInvoiceLotte"
        },
        "electronic_invoice_ups": {
          "description": "Deprecated, use GeneralCustomsDeclaration",
          "title": "Use GeneralCustomsDeclaration instead. [deprecated]",
          "$ref": "#/definitions/ElectronicInvoiceUPS"
        },
        "general_customs_declaration": {
          "$ref": "#/definitions/GeneralCustomsDeclaration"
        }
      }
    },
    "CustomsDeclarationDocument": {
      "type": "object",
      "properties": {
        "format": {
          "description": "File format (ex. \"pdf\", \"png\").",
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/CustomsDeclarationDocumentType"
        },
        "url": {
          "description": "The url where the declaration label is located.",
          "type": "string"
        }
      }
    },
    "CustomsDeclarationDocumentType": {
      "type": "string",
      "default": "TYPE_UNKNOWN",
      "enum": [
        "TYPE_UNKNOWN",
        "TYPE_CN22",
        "TYPE_CN23",
        "TYPE_CP72",
        "TYPE_ELECTRONIC_INVOICE_UPS",
        "TYPE_ELECTRONIC_INVOICE_LOTTE",
        "TYPE_ELECTRONIC_INVOICE_FEDEX",
        "TYPE_ELECTRONIC_INVOICE"
      ]
    },
    "DateTimeRange": {
      "description": "Provides a date interval. Depending on a case, `start` and `end` parts are not guaranteed to be present.",
      "type": "object",
      "properties": {
        "end": {
          "description": "End of the interval. Date is returned in RFC3339 format. Example `2018-09-08T22:47:31Z`.",
          "type": "string"
        },
        "start": {
          "type": "string",
          "title": "Start of the interval. Date is returned in RFC3339 format. Example `2018-09-08T22:47:31Z`"
        }
      }
    },
    "DeclarationCN": {
      "type": "object",
      "properties": {
        "contents_explanation": {
          "description": "Contents explanation - short general description.",
          "type": "string"
        },
        "contents_type": {
          "title": "Content type of goods inside the parcel. For example - Sale, Gift etc. See ContentsType reference for details",
          "$ref": "#/definitions/ContentsType"
        },
        "currency": {
          "description": "Purchase currency.",
          "type": "string"
        },
        "eori_number": {
          "type": "string",
          "title": "EORI number for imports/exports from UK"
        },
        "items": {
          "description": "List of items packed inside parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/DeclarationCNItem"
          }
        },
        "total_gross_weight": {
          "description": "Total gross weight is parcel weight in grams (including packaging).",
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "DeclarationCNItem": {
      "type": "object",
      "properties": {
        "country_of_origin": {
          "description": "Country of origin - country were this item were produced.",
          "type": "string"
        },
        "description": {
          "description": "General description of this item.",
          "type": "string"
        },
        "hs_tariff_number": {
          "description": "Harmonized System tariff number.",
          "type": "string"
        },
        "quantity": {
          "description": "Quantity of this item.",
          "type": "integer",
          "format": "int64"
        },
        "total_net_weight": {
          "description": "Total net weight of the item in grams (for the whole quantity).",
          "type": "integer",
          "format": "int64"
        },
        "total_value": {
          "type": "integer",
          "format": "int64",
          "title": "Total value of this item (for the whole quantity).\nOnly integer values are supported and because of that provided value should always be in smallest currency unit possible (fractional monetary unit)\nFor example, 25.99 USD should be converted to 2599"
        }
      }
    },
    "DeleteDraftCustomBookingMethodRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "Delivery": {
      "description": "Delivery is the parcel with start and end destination. A delivery always\nhas one parcel that it belongs to.",
      "type": "object",
      "properties": {
        "addons": {
          "description": "Addons available for the shipment.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Addon"
          }
        },
        "address_from": {
          "description": "Origin address for this delivery.",
          "$ref": "#/definitions/Address"
        },
        "address_return": {
          "description": "The return address to which a delivery that is returned should be sent.",
          "$ref": "#/definitions/Address"
        },
        "address_to": {
          "description": "Destination address for this delivery.",
          "$ref": "#/definitions/Address"
        },
        "carrier_shipment_id": {
          "description": "CarrierShipmentId is the internal identifier assigned by the carrier to the booked shipment or consignment.\nUnlike the shipment_tracking_number, this value is used for system-to-system communication, support, or referencing\nthe shipment in carrier APIs. It is not visible to the end customer.",
          "type": "string"
        },
        "courier_instructions": {
          "description": "Optional instructions to the courier.",
          "type": "string"
        },
        "created_at": {
          "description": "Timestamp when delivery was created.",
          "type": "string"
        },
        "delivery_status": {
          "description": "State of the delivery. Possible values are 'created','booked','pickup'.",
          "type": "string"
        },
        "delivery_time": {
          "description": "Time range when the deliveries will most likely be delivered to the customer. When time is set\nto 00:00 it means Ingrid has presented a set of days or business days e.g. 2-3 Business days.",
          "$ref": "#/definitions/DateTimeRange"
        },
        "documents": {
          "description": "Documents associated with the delivery.",
          "$ref": "#/definitions/Documents"
        },
        "external_ref": {
          "description": "Additional reference set by carrier which can be used to identify and search delivery.",
          "type": "string"
        },
        "id": {
          "description": "Unique id of the delivery (uuid).",
          "type": "string"
        },
        "label_url": {
          "type": "string",
          "title": "Use documents.label_url instead. [deprecated]"
        },
        "location_ref": {
          "description": "ID of the service point location if applicable.",
          "type": "string"
        },
        "location_type": {
          "title": "Indicates the kind of pickup location",
          "$ref": "#/definitions/PickupLocationType"
        },
        "parcel_id": {
          "description": "ID of the parcel which the delivery belongs to.",
          "type": "string"
        },
        "requested_shipping_method": {
          "description": "Name of a Custom Shipping method used during booking.",
          "type": "string"
        },
        "return_code": {
          "description": "ReturnCode is a code that the end user is supposed to write on the physical package. Used instead of\na label or QR code, if available. Available only when this shipment is outbound and the return delivery is known.",
          "type": "string"
        },
        "return_label_url": {
          "type": "string",
          "title": "Use documents.return_label_url instead. [deprecated]"
        },
        "return_shipping_method": {
          "description": "Shipping product ID for the return delivery. Available only when this shipment is outbound and the return shipment is known.",
          "type": "string"
        },
        "return_tracking_number": {
          "description": "Tracking number for the return delivery. Available only when this shipment is outbound and the return delivery is known.",
          "type": "string"
        },
        "return_tracking_url": {
          "description": "Tracking URL for return delivery. Available only when this shipment is outbound and the return shipment is known.",
          "type": "string"
        },
        "shipment_tracking_number": {
          "description": "Consolidated tracking number for all deliveries in a shipment.",
          "type": "string"
        },
        "shipping_method": {
          "description": "Shipping product ID for the delivery.",
          "type": "string"
        },
        "tracking_number": {
          "description": "Tracking number for the delivery.",
          "type": "string"
        },
        "tracking_url": {
          "description": "Tracking URL for the upcoming delivery if available.",
          "type": "string"
        },
        "transit_time": {
          "description": "Transit time [deprecated].",
          "$ref": "#/definitions/TransitTime"
        },
        "updated_at": {
          "description": "Timestamp when delivery was last updated.",
          "type": "string"
        },
        "weight": {
          "description": "Weight of the delivery in grams.",
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "Dimensions": {
      "description": "Length, height and width in millimeters.",
      "type": "object",
      "properties": {
        "height": {
          "type": "string",
          "format": "uint64",
          "title": "Height in millimeters. For example `50` is 0,05 m"
        },
        "length": {
          "type": "string",
          "format": "uint64",
          "title": "Length in millimeters. For example `140` is 0,14 m"
        },
        "width": {
          "type": "string",
          "format": "uint64",
          "title": "Width in millimeters. For example `20` is 2 cm"
        }
      }
    },
    "DirectionType": {
      "description": "Indicates intended direction of parcel, shipment etc.\n\n - OUTBOUND: From merchant to customer.\n - RETURN: Return from customer to merchant.\n - UNSPECIFIED: Unspecified means we do not know the direction. It is the default state when we do not know any better.",
      "type": "string",
      "default": "UNKNOWN_DIRECTION_TYPE",
      "enum": [
        "UNKNOWN_DIRECTION_TYPE",
        "OUTBOUND",
        "RETURN",
        "UNSPECIFIED"
      ]
    },
    "Documents": {
      "type": "object",
      "properties": {
        "label_url": {
          "description": "URL of the delivery's shipping label.",
          "type": "string"
        },
        "qr_code_url": {
          "description": "QR code URL that can be used instead of the shipping label.",
          "type": "string"
        },
        "return_label_url": {
          "description": "URL of the delivery's return label. Available only when this shipment is outbound and the return delivery is known.",
          "type": "string"
        },
        "return_qr_code_url": {
          "description": "QR code URL that can be used instead of the return shipping label. Available only when this shipment is outbound and the return delivery is known.",
          "type": "string"
        }
      }
    },
    "ElectronicInvoiceFedex": {
      "type": "object",
      "properties": {
        "contents_type": {
          "title": "Content type of goods inside the parcel. For example - Sale, Gift etc. See ContentsType reference for details",
          "$ref": "#/definitions/ContentsType"
        },
        "currency": {
          "type": "string",
          "title": "Purchase currency"
        },
        "declaration_statement": {
          "description": "Statement that provides the legal explanation that customs uses to process your shipment. Needs to meet certain country's law restrictions.",
          "type": "string"
        },
        "incoterms": {
          "description": "International Commercial Terms.",
          "$ref": "#/definitions/InCoTerms"
        },
        "items": {
          "type": "array",
          "title": "List of items packed in the parcel",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ElectronicInvoiceFedexItem"
          }
        }
      }
    },
    "ElectronicInvoiceFedexItem": {
      "type": "object",
      "properties": {
        "country_of_origin": {
          "type": "string",
          "title": "Country where this item was produced"
        },
        "description": {
          "type": "string",
          "title": "General description of this item"
        },
        "hs_tariff_number": {
          "type": "string",
          "title": "Harmonized System tariff number"
        },
        "quantity": {
          "type": "integer",
          "format": "int64",
          "title": "Quantity of this item"
        },
        "quantity_units": {
          "type": "string",
          "title": "Quantity units of this item"
        },
        "total_net_weight": {
          "type": "integer",
          "format": "int64",
          "title": "Total net weight of this item in grams (for the whole quantity)"
        },
        "total_value": {
          "type": "integer",
          "format": "int64",
          "title": "Total value of this item (for the whole quantity)\nOnly integer values are supported and because of that provided value should always be in smallest currency unit possible (fractional monetary unit)\nFor example, 25.99 USD should be converted to 2599"
        },
        "unit_value": {
          "type": "integer",
          "format": "int64",
          "title": "Value per unit of quantity\nOnly integer values are supported and because of that provided value should always be in smallest currency unit possible (fractional monetary unit)\nFor example, 25.99 USD should be converted to 2599"
        }
      }
    },
    "ElectronicInvoiceLotte": {
      "type": "object",
      "properties": {
        "buyer_personal_customs_clearance_number": {
          "description": "Buyer's personal customs clearance number/id.",
          "type": "string"
        },
        "currency": {
          "description": "Purchase currency.",
          "type": "string"
        },
        "invoice_date": {
          "type": "string",
          "title": "Date when the invoice was issued"
        },
        "invoice_number": {
          "type": "string",
          "title": "Unique number that identifies the invoice"
        },
        "items": {
          "description": "List of items packed inside parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ElectronicInvoiceLotteItem"
          }
        },
        "seller_customs_authorization_number": {
          "description": "Seller's Customs Authorization Number. Required for orders above 6000 EUR.",
          "type": "string"
        },
        "sold_to": {
          "description": "SoldTo is the address of the person who paid for the purchase.",
          "$ref": "#/definitions/Address"
        }
      }
    },
    "ElectronicInvoiceLotteItem": {
      "type": "object",
      "properties": {
        "brand": {
          "type": "string",
          "title": "Brand of the item"
        },
        "country_of_origin": {
          "description": "Country of origin - country were this item were produced.",
          "type": "string"
        },
        "description": {
          "description": "General description of this item.",
          "type": "string"
        },
        "hs_tariff_number": {
          "description": "Harmonized System tariff number.",
          "type": "string"
        },
        "quantity": {
          "description": "Quantity of this item.",
          "type": "integer",
          "format": "int64"
        },
        "total_value": {
          "type": "integer",
          "format": "int64",
          "title": "Total value of this item (for the whole quantity).\nOnly integer values are supported and because of that provided value should always be in smallest currency unit possible (fractional monetary unit)\nFor example, 25.99 USD should be converted to 2599"
        }
      }
    },
    "ElectronicInvoiceUPS": {
      "type": "object",
      "properties": {
        "contents_explanation": {
          "description": "Contents explanation - short general description.",
          "type": "string"
        },
        "contents_type": {
          "title": "Content type of goods inside the parcel. For example - Sale, Gift etc. See ContentsType reference for details",
          "$ref": "#/definitions/ContentsType"
        },
        "currency": {
          "description": "Purchase currency.",
          "type": "string"
        },
        "invoice_date": {
          "type": "string",
          "title": "Date when the invoice was issued"
        },
        "invoice_number": {
          "type": "string",
          "title": "Unique number that identifies the invoice"
        },
        "items": {
          "description": "List of items packed inside parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ElectronicInvoiceUPSItem"
          }
        },
        "sold_to": {
          "description": "SoldTo is the address of the person who paid for the purchase.",
          "$ref": "#/definitions/Address"
        },
        "total_gross_weight": {
          "description": "Total gross weight is parcel weight in grams (including packaging).",
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "ElectronicInvoiceUPSItem": {
      "type": "object",
      "properties": {
        "country_of_origin": {
          "description": "Country of origin - country were this item were produced.",
          "type": "string"
        },
        "description": {
          "description": "General description of this item.",
          "type": "string"
        },
        "hs_tariff_number": {
          "description": "Harmonized System tariff number.",
          "type": "string"
        },
        "quantity": {
          "description": "Quantity of this item.",
          "type": "integer",
          "format": "int64"
        },
        "total_value": {
          "type": "integer",
          "format": "int64",
          "title": "Total value of this item (for the whole quantity).\nOnly integer values are supported and because of that provided value should always be in smallest currency unit possible (fractional monetary unit)\nFor example, 25.99 USD should be converted to 2599"
        }
      }
    },
    "ExternalOrderContentItem": {
      "description": "Reference to goods defined by an external system.",
      "type": "object",
      "properties": {
        "external_id": {
          "description": "A reference to an external (merchant) order.",
          "type": "string"
        }
      }
    },
    "FetchPickupLocationsRequest": {
      "type": "object",
      "properties": {
        "address_from": {
          "$ref": "#/definitions/Address"
        },
        "address_to": {
          "$ref": "#/definitions/Address"
        },
        "location_type_filters": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PickupLocationType"
          }
        },
        "pickup_time": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "shipping_method": {
          "type": "string"
        }
      }
    },
    "FetchPickupLocationsResponse": {
      "type": "object",
      "properties": {
        "pickup_locations": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/PickupLocation"
          }
        }
      }
    },
    "FilterCountRange": {
      "description": "Filter for matching a count between max and min.",
      "type": "object",
      "properties": {
        "max": {
          "type": "string",
          "format": "int64"
        },
        "min": {
          "type": "string",
          "format": "int64"
        }
      }
    },
    "Filtering": {
      "description": "Filters for listing shipments.",
      "type": "object",
      "properties": {
        "created_at_range": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "id": {
          "description": "Id will be matched against shipment_id, tos_id and external_id.",
          "type": "string"
        },
        "line_items": {
          "title": "[deprecated]",
          "$ref": "#/definitions/FilterCountRange"
        },
        "shipment_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "shipping_date_range": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "shipping_methods": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "statuses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tos_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "FilteringPendingShipments": {
      "type": "object",
      "properties": {
        "created_at_range": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "id": {
          "type": "string",
          "title": "Id will be matched against:\npending_shipment_id, tos_id and external_id"
        }
      }
    },
    "GeneralCustomsDeclaration": {
      "type": "object",
      "properties": {
        "buyer_contact": {
          "description": "Contact info of a buyer.",
          "$ref": "#/definitions/GeneralCustomsDeclarationContactInfo"
        },
        "buyer_identification_numbers": {
          "description": "A unique identification numbers of a buyer, for instance, EORI, VOEC.",
          "$ref": "#/definitions/TaxIdentificationNumbers"
        },
        "buyer_tax_id_number": {
          "description": "A unique VAT tax identification number of a buyer / importer.\nDeprecated: use `buyer_identification_numbers` instead.",
          "type": "string"
        },
        "contents_explanation": {
          "description": "Contents explanation - short general description.",
          "type": "string"
        },
        "contents_type": {
          "description": "Content type of goods inside the parcel. For example - Sale, Gift etc. See ContentsType reference for details.",
          "$ref": "#/definitions/ContentsType"
        },
        "currency": {
          "description": "Purchase currency.",
          "type": "string"
        },
        "declaration_statement": {
          "description": "Statement that provides the legal explanation that customs uses to process your shipment. Needs to meet certain country's law restrictions.",
          "type": "string"
        },
        "duties_payer": {
          "title": "Billing for import duties and taxes, controls who is billed",
          "$ref": "#/definitions/Payer"
        },
        "importer_of_record": {
          "description": "Information about the importer of record, if other party than the sold_to is used.",
          "$ref": "#/definitions/GeneralCustomsDeclarationImporterOfRecord"
        },
        "incoterms": {
          "description": "International Commercial Terms.",
          "$ref": "#/definitions/InCoTerms"
        },
        "invoice_date": {
          "description": "The date when the invoice was issued.",
          "type": "string"
        },
        "invoice_number": {
          "description": "A unique number that identifies the invoice.",
          "type": "string"
        },
        "items": {
          "description": "List of items packed inside the parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/GeneralCustomsDeclarationItem"
          }
        },
        "place_of_incoterms": {
          "description": "Name of port of departure, shipment or destination as required under the applicable delivery term.",
          "type": "string"
        },
        "seller_address": {
          "description": "The address of a seller / exporter.",
          "$ref": "#/definitions/Address"
        },
        "seller_contact": {
          "title": "Contact info of a seller / exporter",
          "$ref": "#/definitions/GeneralCustomsDeclarationContactInfo"
        },
        "seller_identification_numbers": {
          "description": "A unique identification numbers of a seller / exporter, for instance, EORI, VOEC.",
          "$ref": "#/definitions/TaxIdentificationNumbers"
        },
        "seller_tax_id_number": {
          "description": "A unique VAT tax identification number of a seller / exporter.\nDeprecated: use `seller_identification_numbers` instead.",
          "type": "string"
        },
        "sold_to": {
          "description": "The address of a buyer.",
          "$ref": "#/definitions/Address"
        },
        "special_instructions": {
          "description": "Additional Instructions provided in the customs.",
          "type": "string"
        },
        "total_gross_weight": {
          "description": "Total gross weight of the parcel in grams (including packaging).",
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "GeneralCustomsDeclarationContactInfo": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        }
      }
    },
    "GeneralCustomsDeclarationImporterOfRecord": {
      "type": "object",
      "properties": {
        "account_number": {
          "description": "Optional account number associated with the importer for customs/brokerage context.",
          "type": "string"
        },
        "address": {
          "description": "Importer address, usually in the import country.",
          "$ref": "#/definitions/Address"
        },
        "contact": {
          "description": "Contact used by customs/broker for queries.",
          "$ref": "#/definitions/GeneralCustomsDeclarationContactInfo"
        },
        "identification_numbers": {
          "description": "A unique identification numbers of a importer, for instance, EORI, VOEC.",
          "$ref": "#/definitions/TaxIdentificationNumbers"
        }
      }
    },
    "GeneralCustomsDeclarationItem": {
      "type": "object",
      "properties": {
        "additional_information": {
          "type": "array",
          "title": "Allows for providing one or more lines of additional information as needed such as manufacturer address info. [optional]",
          "items": {
            "type": "string"
          }
        },
        "brand": {
          "description": "Item's brand.",
          "type": "string"
        },
        "category": {
          "description": "Item's commodity category, for example, babies products.",
          "type": "string"
        },
        "country_of_origin": {
          "description": "Country of origin - country were this item were produced.",
          "type": "string"
        },
        "description": {
          "type": "string",
          "title": "Used to describe items such as composition. For example, 50 percent wool and 50 percent leather. [optional]"
        },
        "hs_tariff_number": {
          "description": "Harmonized System tariff number.",
          "type": "string"
        },
        "name": {
          "description": "Name of this item.",
          "type": "string"
        },
        "quantity": {
          "description": "Quantity of this item.",
          "type": "integer",
          "format": "int64"
        },
        "references": {
          "type": "array",
          "title": "Item references can be used to communicate order numbers, make, models, dangerous goods content identifiers, registration numbers and more. [optional]",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ItemReference"
          }
        },
        "sku": {
          "description": "SKU of this item.",
          "type": "string"
        },
        "unit_alternative_value": {
          "type": "integer",
          "format": "int64",
          "title": "Used only for special case scenarios when unit_value should not be used\nsuch as when custom declarations should be using a transfer price for eg. US exports"
        },
        "unit_gross_weight": {
          "description": "Gross weight of the item in grams (including packaging), without taking quantity into account.",
          "type": "integer",
          "format": "int64"
        },
        "unit_net_weight": {
          "description": "Net weight of the item in grams, without taking quantity into account.",
          "type": "integer",
          "format": "int64"
        },
        "unit_value": {
          "description": "Value of the single item, without taking quantity into account.\nOnly integer values are supported and because of that provided value should always be in smallest currency unit possible (fractional monetary unit).\nFor example, 25.99 USD should be converted to 2599.",
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "GetConsolidatedShipmentResponse": {
      "type": "object",
      "properties": {
        "consolidated_shipment": {
          "$ref": "#/definitions/ConsolidatedShipment"
        },
        "shipments": {
          "type": "array",
          "title": "only returned if expand=SHIPMENTS_SUMMARY, expand=SHIPMENTS_WITH_PARCELS, expand=SHIPMENTS_WITH_LINE_ITEMS or expand=SHIPMENTS_FULL is used",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Shipment"
          }
        }
      }
    },
    "GetCustomBookingMethodResponse": {
      "type": "object",
      "properties": {
        "custom_booking_method": {
          "$ref": "#/definitions/CustomBookingMethod"
        }
      }
    },
    "GetDeliveryResponse": {
      "type": "object",
      "title": "Returns a delivery object",
      "properties": {
        "delivery": {
          "title": "Delivery object state",
          "$ref": "#/definitions/Delivery"
        }
      }
    },
    "GetPendingShipmentResponse": {
      "type": "object",
      "title": "Returns a Pending Shipment",
      "properties": {
        "pending_shipment": {
          "title": "Pending Shipment result object",
          "$ref": "#/definitions/PendingShipment"
        }
      }
    },
    "GetRecordResponse": {
      "type": "object",
      "properties": {
        "record": {
          "$ref": "#/definitions/BookingRecord"
        }
      }
    },
    "GetShipmentResponse": {
      "description": "Returns latest shipment state.",
      "type": "object",
      "properties": {
        "shipment": {
          "title": "Current shipment object state",
          "$ref": "#/definitions/Shipment"
        }
      }
    },
    "HydrateShipmentResponse": {
      "type": "object",
      "properties": {
        "shipment": {
          "$ref": "#/definitions/CreateCompositeShipmentRequest"
        }
      }
    },
    "InCoTerms": {
      "description": "International Commercial Terms.\n\n - EXW: Ex Works.\n - FCA: Free Carrier.\n - FAS: Free Alongside Ship.\n - FOB: Free On Board.\n - CFR: Cost And Freight.\n - CIF: Cost, Insurance and Freight.\n - CPT: Carriage Paid To.\n - CIP: Carriage Insurance Paid To.\n - DAT: Delivered At Terminal.\n - DAP: Delivered At Place.\n - DDP: Delivered Duty Paid.\n - DAF: Delivered At Frontier.\n - DDU: Delivery Duty Unpaid.\n - DEQ: Delivered Ex Quay.\n - DES: Delivered Ex Ship.\n - DPU: Delivered at Place Unloaded.",
      "type": "string",
      "default": "INCOTERMS_UNKNOWN",
      "enum": [
        "INCOTERMS_UNKNOWN",
        "EXW",
        "FCA",
        "FAS",
        "FOB",
        "CFR",
        "CIF",
        "CPT",
        "CIP",
        "DAT",
        "DAP",
        "DDP",
        "DAF",
        "DDU",
        "DEQ",
        "DES",
        "DPU"
      ]
    },
    "ItemReference": {
      "type": "object",
      "properties": {
        "code": {
          "description": "The code corresponds to the type. Following the example of using MID as type the MID code should be specified here as a value.",
          "type": "string"
        },
        "type": {
          "description": "The type of code needs to be specified. For example \"MID\" (Manufacturers Identification Code) can be specified as the type.",
          "type": "string"
        }
      }
    },
    "LineItem": {
      "description": "Physical item of the parcel. A parcel can contain many line\nitems. The parameters on the line item are used by the shipping rules\nframework to make better shipping decisions.",
      "type": "object",
      "properties": {
        "currency": {
          "type": "string",
          "title": "Currency of the line item. [optional]"
        },
        "description": {
          "type": "string",
          "title": "Description of the product [optional]"
        },
        "dimensions": {
          "title": "Dimensions of the line item. [optional]",
          "$ref": "#/definitions/Dimensions"
        },
        "hs_tariff_number": {
          "description": "Harmonized System tariff number.",
          "type": "string"
        },
        "name": {
          "type": "string",
          "title": "Product name or title [required]"
        },
        "price": {
          "type": "string",
          "format": "uint64",
          "title": "Price of the line item. [optional]"
        },
        "quantity": {
          "type": "string",
          "format": "uint64",
          "title": "Number of items. [required]"
        },
        "sku": {
          "type": "string",
          "title": "Unique product identifier. [required]"
        },
        "tags": {
          "description": "List of tags or attributes that can be attached to this line item.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "weight": {
          "description": "Weight of the line item in grams. For example `200` is 0,2 kg.",
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "ListConsolidatedShipmentsRequest": {
      "type": "object",
      "title": "For internal use [internal]",
      "properties": {
        "filtering": {
          "$ref": "#/definitions/ConsolidatedShipmentsFiltering"
        },
        "order_by_direction": {
          "$ref": "#/definitions/ListConsolidatedShipmentsRequestOrderDirection"
        },
        "pagination": {
          "$ref": "#/definitions/Pagination"
        }
      }
    },
    "ListConsolidatedShipmentsRequestOrderDirection": {
      "type": "string",
      "default": "DESCENDING",
      "enum": [
        "DESCENDING",
        "ASCENDING"
      ]
    },
    "ListConsolidatedShipmentsResponse": {
      "type": "object",
      "title": "For internal use [internal]",
      "properties": {
        "consolidated_shipments": {
          "description": "List of shipments belonging to an order.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ConsolidatedShipment"
          }
        },
        "count": {
          "type": "string",
          "format": "uint64"
        },
        "more_shipments": {
          "type": "boolean"
        }
      }
    },
    "ListCustomBookingMethodsRequest": {
      "type": "object",
      "properties": {
        "filtering": {
          "$ref": "#/definitions/ListCustomBookingMethodsRequestFiltering"
        },
        "order_by_direction": {
          "$ref": "#/definitions/OrderDirection"
        },
        "pagination": {
          "$ref": "#/definitions/Pagination"
        }
      }
    },
    "ListCustomBookingMethodsRequestFiltering": {
      "type": "object",
      "properties": {
        "booking_methods": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "id": {
          "description": "Id will be matched against Published and Draft custom booking methods.",
          "type": "string"
        },
        "include_statuses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BookingMethodStatus"
          }
        },
        "methods": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "name": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ListCustomBookingMethodsResponse": {
      "type": "object",
      "properties": {
        "custom_booking_methods": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CustomBookingMethod"
          }
        }
      }
    },
    "ListPendingShipmentsRequest": {
      "type": "object",
      "properties": {
        "filtering": {
          "$ref": "#/definitions/FilteringPendingShipments"
        },
        "order_by_direction": {
          "$ref": "#/definitions/OrderDirection"
        },
        "pagination": {
          "$ref": "#/definitions/Pagination"
        }
      }
    },
    "ListPendingShipmentsResponse": {
      "type": "object",
      "properties": {
        "pending_shipments": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/PendingShipment"
          }
        }
      }
    },
    "ListShipmentsRequest": {
      "description": "Request for listing shipments matching filter.",
      "type": "object",
      "properties": {
        "filtering": {
          "description": "Shipments matching all the filters will be returned.",
          "$ref": "#/definitions/Filtering"
        },
        "order_by_direction": {
          "$ref": "#/definitions/ListShipmentsRequestOrderDirection"
        },
        "pagination": {
          "description": "Max page size is 1000, if set higher, it will be capped to 1000.",
          "$ref": "#/definitions/Pagination"
        },
        "tos_id": {
          "description": "Order ID, deprecated use filtering.tos_ids instead [deprecated].",
          "type": "string"
        }
      }
    },
    "ListShipmentsRequestOrderDirection": {
      "type": "string",
      "default": "DESCENDING",
      "enum": [
        "DESCENDING",
        "ASCENDING"
      ]
    },
    "ListShipmentsResponse": {
      "description": "Response for a list shipment request. Contains the shipments matching the request filters and\ninformation about if there are more pages.",
      "type": "object",
      "properties": {
        "count": {
          "description": "The total number of shipments that match the filtering criteria (or 5000 if more than 5000 shipments match).",
          "type": "string",
          "format": "uint64"
        },
        "more_shipments": {
          "type": "boolean"
        },
        "shipments": {
          "description": "List of shipments matching the filtering criteria.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Shipment"
          }
        }
      }
    },
    "OpenConsolidatedShipmentRequest": {
      "type": "object",
      "properties": {
        "carrier_contract_id": {
          "description": "[optional] ID of the carrier contract to be used for booking.",
          "type": "string"
        },
        "customs_declaration": {
          "description": "Holds information about customs declaration for the consolidated shipment.",
          "$ref": "#/definitions/CustomsDeclaration"
        },
        "external_id": {
          "description": "[optional] External ID of the shipment. Can be used to store a unique identifier from the merchant.",
          "type": "string"
        },
        "from": {
          "description": "[required] Address where the shipment will be dispatched from. Most often the address of the warehouse.",
          "$ref": "#/definitions/Party"
        },
        "meta": {
          "type": "object",
          "title": "[optional] Shipment metadata tags",
          "additionalProperties": {
            "type": "string"
          }
        },
        "pallets": {
          "type": "array",
          "title": "[optional] Pallets included in the shipment. The length of the array corresponds to the number of pallets. Must include at least one pallet. if omitted then one applet will be assumed",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Pallet"
          }
        },
        "shipping_date": {
          "description": "[required] Date when the shipment will most likely be dispatched from the warehouse. RFC-3339 format.",
          "type": "string"
        },
        "shipping_method": {
          "type": "string",
          "title": "[required] Shipping method for the Consolidated Shipment"
        },
        "to": {
          "description": "[required] Destination address. For example address of the distribution center of the carrier.",
          "$ref": "#/definitions/Party"
        }
      }
    },
    "OpenConsolidatedShipmentResponse": {
      "type": "object",
      "properties": {
        "consolidated_shipment": {
          "$ref": "#/definitions/ConsolidatedShipment"
        }
      }
    },
    "OrderDirection": {
      "type": "string",
      "default": "DESCENDING",
      "enum": [
        "DESCENDING",
        "ASCENDING"
      ]
    },
    "Pagination": {
      "description": "Pagination filter.",
      "type": "object",
      "properties": {
        "limit": {
          "type": "string",
          "format": "uint64"
        },
        "offset": {
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "Pallet": {
      "type": "object",
      "properties": {
        "created_at": {
          "description": "[output] Timestamp when pallet was created. RFC-3339 format.",
          "type": "string"
        },
        "dimensions": {
          "description": "[optional] Dimensions of the pallet. If provided, this value will be sent to carrier.",
          "$ref": "#/definitions/Dimensions"
        },
        "external_id": {
          "description": "[optional] External ID of the pallet. Can be used to store a unique identifier from the merchant.",
          "type": "string"
        },
        "id": {
          "description": "[output] ID of the pallet (uuid).",
          "type": "string"
        },
        "label_url": {
          "description": "[output] URL of the pallet's shipping label.",
          "type": "string"
        },
        "shipping_methods": {
          "description": "[optional] Shipping methods on the pallet. If provided, this value will be sent to carrier. Required for some carriers.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tracking_number": {
          "description": "[output] Tracking number for the pallet.",
          "type": "string"
        },
        "tracking_url": {
          "description": "[output] URL of the pallet's tracking number.",
          "type": "string"
        },
        "updated_at": {
          "description": "[output] Timestamp when pallet was updated. RFC-3339 format.",
          "type": "string"
        },
        "weight": {
          "description": "[optional] Weight of the pallet in grams. If provided, this value will be sent to carrier. If omitted (or zero),\nthe weight will be summed by the weights of the shipments in the pallet.",
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "Parcel": {
      "description": "Parcel is the physical package. One parcel can have at least one delivery\nat a time.",
      "type": "object",
      "properties": {
        "contents": {
          "description": "Contents of the parcel.",
          "$ref": "#/definitions/Contents"
        },
        "created_at": {
          "description": "Timestamp when parcel was created.",
          "type": "string"
        },
        "deliveries": {
          "description": "Deliveries associated with the parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Delivery"
          }
        },
        "dimensions": {
          "description": "Length, height and width [optional].",
          "$ref": "#/definitions/Dimensions"
        },
        "free_text": {
          "description": "Custom description (notes) of a parcel.",
          "type": "string"
        },
        "id": {
          "description": "Unique ID of the parcel (uuid).",
          "type": "string"
        },
        "label_free_text": {
          "description": "Custom information about parcel visible on a label.",
          "type": "string"
        },
        "line_items": {
          "type": "array",
          "title": "Use `contents` instead [deprecated]",
          "items": {
            "type": "object",
            "$ref": "#/definitions/LineItem"
          }
        },
        "parcel_number": {
          "type": "integer",
          "format": "int64",
          "title": "Index number of the individual parcel in a shipment, i.e parcel 3 of 5. [deprecated]"
        },
        "parcel_total": {
          "description": "Not used [deprecated].",
          "type": "integer",
          "format": "int64"
        },
        "shipment_id": {
          "description": "ID of the shipment that parcel belongs to (uuid).",
          "type": "string"
        },
        "updated_at": {
          "description": "Timestamp when parcel was last updated.",
          "type": "string"
        },
        "weight": {
          "description": "Total weight of the parcel in grams.",
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "ParcelDetails": {
      "description": "ParcelDetails contains additional information about parcels. Represents the non-output-only\nsubset of Shipment Parcels.",
      "type": "object",
      "properties": {
        "contents": {
          "title": "Parcel contents",
          "$ref": "#/definitions/Contents"
        },
        "dimensions": {
          "title": "Parcel dimensions",
          "$ref": "#/definitions/Dimensions"
        },
        "free_text": {
          "description": "Custom description (notes) of a parcel.",
          "type": "string"
        },
        "label_free_text": {
          "type": "string"
        },
        "weight": {
          "type": "string",
          "format": "uint64",
          "title": "Weight in grams"
        }
      }
    },
    "Party": {
      "type": "object",
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "email": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        }
      }
    },
    "Payer": {
      "type": "object",
      "properties": {
        "account": {
          "description": "Optional carrier account used to settle this charge (if supported by the carrier).",
          "type": "string"
        },
        "address": {
          "description": "Required when type is THIRD_PARTY.",
          "$ref": "#/definitions/Address"
        },
        "type": {
          "description": "Specifies who is billed for this specific charge (transport or duties) relative to shipment parties.\nThis does NOT describe the legal role in customs; it only indicates who pays this charge.",
          "$ref": "#/definitions/PayerPayerType"
        }
      }
    },
    "PayerPayerType": {
      "description": " - PAYER_TYPE_UNSPECIFIED: Unspecified payer.\n - SENDER: Sender/shipper pays the charge.\n - RECIPIENT: Recipient/consignee pays the charge.\n - THIRD_PARTY: Third-party pays the charge.",
      "type": "string",
      "default": "PAYER_TYPE_UNSPECIFIED",
      "enum": [
        "PAYER_TYPE_UNSPECIFIED",
        "SENDER",
        "RECIPIENT",
        "THIRD_PARTY"
      ]
    },
    "PendingShipment": {
      "type": "object",
      "title": "Pending shipment that has generated an error in the creation process and\ntherefore is in an invalid state and needs modifying.\nThis is an opt in feature for merchants",
      "properties": {
        "created_at": {
          "description": "Timestamp when shipment was received.",
          "type": "string"
        },
        "expires_at": {
          "description": "Timestamp of when the pending shipment be deleted.",
          "type": "string"
        },
        "id": {
          "description": "ID of the shipment (uuid).",
          "type": "string"
        },
        "lookup_id": {
          "description": "Lookup ID of the shipment. This is a shorter version of the id that can be used to reference\nthe shipment.",
          "type": "string"
        },
        "payload": {
          "description": "Shipment request that caused the error. Includes the errornous part of the request.",
          "type": "string"
        },
        "raw_error_message": {
          "description": "Error message recieved during create (and/or) booking of shipment.",
          "type": "string"
        }
      }
    },
    "PickupDistances": {
      "type": "object",
      "properties": {
        "drive_distance": {
          "type": "integer",
          "format": "int64"
        },
        "drive_time": {
          "type": "integer",
          "format": "int64"
        },
        "walk_distance": {
          "type": "integer",
          "format": "int64"
        },
        "walk_time": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "PickupLocation": {
      "type": "object",
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "distances": {
          "$ref": "#/definitions/PickupDistances"
        },
        "location_ref": {
          "type": "string"
        },
        "location_type": {
          "$ref": "#/definitions/PickupLocationType"
        },
        "meta": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "name": {
          "type": "string"
        },
        "shipping_method": {
          "type": "string"
        }
      }
    },
    "PickupLocationType": {
      "description": "- UNKNOWN_PICKUP_LOCATION_TYPE: Location type is not known for some reason\n - LOCKER: Locker location type. Example Instabox or a DHL locker\n - STORE: Can be a merchant's store or any other store that handles logistics\n - POSTOFFICE: Postal office\n - MANNED: A manned service point",
      "type": "string",
      "title": "Indicates the kind of pickup location",
      "default": "UNKNOWN_PICKUP_LOCATION_TYPE",
      "enum": [
        "UNKNOWN_PICKUP_LOCATION_TYPE",
        "LOCKER",
        "STORE",
        "POSTOFFICE",
        "MANNED"
      ]
    },
    "Prompt": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "role": {
          "$ref": "#/definitions/PromptRole"
        },
        "timestamp": {
          "description": "Timestamp of the prompt in RFC-3339 format.",
          "type": "string"
        }
      }
    },
    "PromptRole": {
      "type": "string",
      "default": "USER",
      "enum": [
        "USER",
        "ASSISTANT"
      ]
    },
    "PublishCustomBookingMethodsRequest": {
      "type": "object",
      "properties": {
        "custom_booking_methods": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CustomBookingMethod"
          }
        }
      }
    },
    "SaveDraftCustomBookingMethodsRequest": {
      "type": "object",
      "properties": {
        "custom_booking_methods": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CustomBookingMethod"
          }
        }
      }
    },
    "SchedulePickupRequest": {
      "description": "Schedule the shipment for pickup by the carrier service.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "Shipment ID"
        }
      }
    },
    "SendFreightDocumentsForReturnShipmentRequest": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "return_shipment_id": {
          "type": "string"
        },
        "site_id": {
          "type": "string"
        }
      }
    },
    "Shipment": {
      "description": "Shipment is the top level object in SOM. A shipment can be composed of\nmultiple parcels and each parcel can contain many deliveries. Only one\ndelivery can be active at a time.",
      "type": "object",
      "properties": {
        "addons": {
          "description": "Addons that should be used for the shipment.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Addon"
          }
        },
        "address_from": {
          "description": "Address where the shipment will be dispatched from. Most often the\naddress of the warehouse [required].",
          "$ref": "#/definitions/Address"
        },
        "address_return": {
          "description": "Address where deliveries of this shipment should be returned to.",
          "$ref": "#/definitions/Address"
        },
        "address_to": {
          "description": "Destination address. For example address of the service point or the click\nand collect store [required].",
          "$ref": "#/definitions/Address"
        },
        "carrier_contract_id": {
          "description": "ID of the carrier contract to be used for booking.",
          "type": "string"
        },
        "consolidated_shipment_details": {
          "description": "If the shipment is part of a consolidated shipment, this field will contain the details.",
          "$ref": "#/definitions/ConsolidatedShipmentDetails"
        },
        "contents": {
          "description": "Contents of shipment. Can be of different types - goods, transport orders and external orders.",
          "$ref": "#/definitions/Contents"
        },
        "created_at": {
          "description": "Timestamp when shipment was created.",
          "type": "string"
        },
        "customer_info": {
          "description": "Contains the customer information such as name, email, phone and address [required].",
          "$ref": "#/definitions/CustomerInfo"
        },
        "customs": {
          "description": "Holds information about customs for the shipment.",
          "$ref": "#/definitions/Customs"
        },
        "direction_type": {
          "description": "DirectionType informs about initial shipment direction.",
          "$ref": "#/definitions/DirectionType"
        },
        "external_id": {
          "description": "Can be used to store a unique identifier from the merchant. For example\nexternal order ID or external shipment ID.",
          "type": "string"
        },
        "id": {
          "description": "ID of the shipment (uuid).",
          "type": "string"
        },
        "line_items": {
          "type": "array",
          "title": "Use contents instead [deprecated]",
          "items": {
            "type": "object",
            "$ref": "#/definitions/LineItem"
          }
        },
        "meta": {
          "description": "Generic key-value object that can be used to attach additional\ninformation to the shipment.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "outbound_shipment_id": {
          "description": "If the shipment is a return shipment, this field will contain the shipment id of the outbound shipment if it exists.",
          "type": "string"
        },
        "parcels": {
          "description": "Parcels associated with this shipment.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Parcel"
          }
        },
        "return_shipment_id": {
          "description": "If the shipment is an outbound shipment, this field will contain the shipment id of the return shipment if it exists.",
          "type": "string"
        },
        "shipment_value": {
          "description": "Total value of the shipment including tax in cents. Example 10000 is 100 SEK.",
          "type": "string",
          "format": "uint64"
        },
        "shipping_date": {
          "description": "The date that the shipment will most likely be dispatched from the warehouse [required].",
          "type": "string"
        },
        "site_id": {
          "description": "Site ID to which the shipment belongs to [internal].",
          "type": "string"
        },
        "status": {
          "title": "Status of the shipment. Equivalent to the old Delivery.delivery_status. [required]",
          "$ref": "#/definitions/ShipmentStatus"
        },
        "tos_id": {
          "description": "ID of a corresponding order.",
          "type": "string"
        },
        "transport_payer": {
          "description": "[optional]  Defines who is billed for freight/transport charges.",
          "$ref": "#/definitions/Payer"
        },
        "updated_at": {
          "description": "Timestamp when shipment was last updated.",
          "type": "string"
        }
      }
    },
    "ShipmentStatus": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "title": "Used to attach a message to the current status. [optional]"
        },
        "type": {
          "title": "The type of the status. Used to determine the state of the shipment. [required]",
          "$ref": "#/definitions/ShipmentStatusStatusType"
        }
      }
    },
    "ShipmentStatusStatusType": {
      "type": "string",
      "title": "- CREATED: CREATED is the initial state of the shipment.\n - BOOKED: BOOKED indicates that shipment has been booked, also known as having a label generated for it.\n - PICKUP_SCHEDULED: PICKUP_SCHEDULED indicates that shipment has been scheduled for pickup. The intricacies of the pickup is determined by the carrier and the site configuration.\n - CANCELED: CANCELED indicates that the delivery has been suspended and will not proceed.\n - INVALID_BOOKING: INVALID_BOOKING indicates that a booking failed due to a bad request to the carrier service.\n - CANCEL_FAILED: CANCEL_FAILED indicates that the shipment could not be canceled by the carrier",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "CREATED",
        "BOOKED",
        "PICKUP_SCHEDULED",
        "CANCELED",
        "INVALID_BOOKING",
        "CANCEL_FAILED"
      ]
    },
    "StepActionLog": {
      "type": "object",
      "properties": {
        "applied": {
          "type": "boolean"
        },
        "expression": {
          "type": "string"
        },
        "input": {
          "$ref": "#/definitions/CreateCompositeShipmentRequest"
        },
        "output": {
          "$ref": "#/definitions/CreateCompositeShipmentRequest"
        },
        "raw_error": {
          "type": "string"
        }
      }
    },
    "StepExpression": {
      "type": "object",
      "properties": {
        "expression": {
          "type": "string"
        }
      }
    },
    "StepFilterLog": {
      "type": "object",
      "properties": {
        "applied": {
          "type": "boolean"
        },
        "expression": {
          "type": "string"
        },
        "raw_error": {
          "type": "string"
        }
      }
    },
    "StepLog": {
      "type": "object",
      "properties": {
        "actions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/StepActionLog"
          }
        },
        "filters": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/StepFilterLog"
          }
        },
        "name": {
          "type": "string"
        }
      }
    },
    "Strategy": {
      "description": "Represents a booking strategy used by a delivery.",
      "type": "string",
      "default": "STRATEGY_UNKNOWN",
      "enum": [
        "STRATEGY_UNKNOWN",
        "STRATEGY_SCHEDULED",
        "STRATEGY_IMMEDIATE"
      ]
    },
    "TaxIdentificationNumbers": {
      "type": "object",
      "properties": {
        "ein": {
          "description": "Refers to the Employer Identification Number (EIN) for tax identification.",
          "type": "string"
        },
        "eori": {
          "description": "Stands for Economic Operator Registration and Identification (EORI) number.\nThe EORI number is used for customs purposes to identify economic operators involved in the import or\nexport of goods within the European Union.",
          "type": "string"
        },
        "hmrc": {
          "description": "Refers to Their Majesty's Revenue and Customs (HMRC) identification.",
          "type": "string"
        },
        "ioss": {
          "description": "Indicates the Import One-Stop Shop (IOSS) number.",
          "type": "string"
        },
        "pan": {
          "description": "Represents the Permanent Account Number (PAN) used in certain jurisdictions.",
          "type": "string"
        },
        "pccc": {
          "type": "string",
          "title": "Personal Customs Clearance Code : P+12digit number (Ex : P123456789012). Needed for shipments to South Korea"
        },
        "pva": {
          "type": "string",
          "title": "Postponed VAT Accounting"
        },
        "ssn": {
          "description": "Stands for Social Security Number (SSN) used in specific regions.",
          "type": "string"
        },
        "tin": {
          "description": "Signifies the Taxpayer Identification Number (TIN) used for tax purposes.",
          "type": "string"
        },
        "ukims": {
          "type": "string",
          "title": "UK Internal Market Scheme Number (Example: GBUKIMS123456789012202409011000)"
        },
        "vat": {
          "description": "Stands for Value Added Tax (VAT) identification number.",
          "type": "string"
        },
        "voec": {
          "description": "Represents the Value of Exported Commodities (VOEC) number.",
          "type": "string"
        }
      }
    },
    "TestCustomBookingMethodsRequest": {
      "type": "object",
      "properties": {
        "custom_booking_methods": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CustomBookingMethod"
          }
        },
        "shipments": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CreateCompositeShipmentRequest"
          }
        }
      }
    },
    "TestCustomBookingMethodsResponse": {
      "type": "object",
      "properties": {
        "test_run_results": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CustomBookingsMethodTestRun"
          }
        }
      }
    },
    "TotalShipmentsCountResponse": {
      "type": "object",
      "title": "For internal use [internal]",
      "properties": {
        "total_count": {
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "TransitTime": {
      "type": "object",
      "title": "Not used [internal]",
      "properties": {
        "end": {
          "type": "string"
        },
        "start": {
          "type": "string"
        }
      }
    },
    "TransportOrderContentItem": {
      "description": "Reference to goods defined by a transport order.",
      "type": "object",
      "properties": {
        "external_ref": {
          "description": "Additional reference which can be used freely by the client to tie together\na SOM shipment with an internal ID.",
          "type": "string"
        },
        "tos_id": {
          "description": "Transport order id.",
          "type": "string"
        }
      }
    },
    "TriggerPickupResponse": {
      "type": "object",
      "properties": {
        "records": {
          "description": "A list of records that have been succesfully booked.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/BookingRecord"
          }
        }
      }
    },
    "UpdateConsolidatedShipmentRequest": {
      "type": "object",
      "title": "Update a shipment request",
      "properties": {
        "shipment": {
          "title": "Shipment to update, only pallets can be updated",
          "$ref": "#/definitions/ConsolidatedShipment"
        },
        "update_mask": {
          "type": "string",
          "title": "update_mask marks what fields are to be updated. Only"
        }
      }
    },
    "UpdateConsolidatedShipmentResponse": {
      "type": "object",
      "title": "Returns the updated shipment",
      "properties": {
        "shipment": {
          "title": "The updated shipment state",
          "$ref": "#/definitions/ConsolidatedShipment"
        }
      }
    },
    "UpdateShipmentNotesRequest": {
      "type": "object",
      "title": "Update shipment notes request can be sent for a shipment in any state [internal]",
      "properties": {
        "notes": {
          "type": "string"
        },
        "shipment_id": {
          "type": "string"
        }
      }
    },
    "UpdateShipmentNotesResponse": {
      "type": "object",
      "title": "For internal use [internal]",
      "properties": {
        "shipment": {
          "$ref": "#/definitions/Shipment"
        }
      }
    },
    "UpdateShipmentRequest": {
      "type": "object",
      "title": "Update a shipment request",
      "properties": {
        "addons": {
          "description": "List of shipment addons.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Addon"
          }
        },
        "address_from": {
          "title": "Address where the shipment will be dispatched from. Most often the\naddress of the warehouse. [required]",
          "$ref": "#/definitions/Address"
        },
        "address_return": {
          "title": "Address where deliveries of this shipment should be returned to. [optional]",
          "$ref": "#/definitions/Address"
        },
        "address_to": {
          "title": "Destination address. For example address of the service point or the click\nand collect store. [required]",
          "$ref": "#/definitions/Address"
        },
        "carrier_contract_id": {
          "type": "string",
          "title": "ID of the carrier contract to be used for booking. [optional]"
        },
        "courier_instructions": {
          "type": "string",
          "title": "Optional instructions to the courier"
        },
        "customer_info": {
          "description": "Contains the customer information such as name, email, phone and address.",
          "$ref": "#/definitions/CustomerInfo"
        },
        "delivery_time": {
          "description": "Time range when the deliveries will most likely be delivered to the customer.",
          "$ref": "#/definitions/DateTimeRange"
        },
        "external_id": {
          "description": "Can be used to store a unique identifier from the merchant. For example\nexternal order ID or external shipment ID.",
          "type": "string"
        },
        "location_ref": {
          "description": "ID of the pickup location where the parcels should be delivered to.",
          "type": "string"
        },
        "location_type": {
          "title": "Indicates the kind of pickup location [optional]",
          "$ref": "#/definitions/PickupLocationType"
        },
        "meta": {
          "description": "Generic key-value object that can be used to attach additional\ninformation to the shipment.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "parcel_free_text": {
          "description": "Custom description (notes) that will be assigned to all parcels in the shipment.",
          "type": "string"
        },
        "shipment_id": {
          "type": "string",
          "title": "Shipment ID"
        },
        "shipment_value": {
          "description": "Total value of the shipment including tax. Example 10000 is 100 SEK.",
          "type": "string",
          "format": "uint64"
        },
        "shipping_date": {
          "type": "string",
          "title": "The date that the shipment will most likely be dispatched from the warehouse. [required]"
        },
        "shipping_method": {
          "type": "string",
          "title": "Specific shipping product ID by which the generated parcels should be delivered. [required]"
        },
        "weight": {
          "type": "string",
          "format": "uint64",
          "title": "Weight in grams (g). If not set, the total weight of each parcel will be\ncalculated from its line items if that information is available. [deprecated]"
        }
      }
    },
    "UpdateShipmentResponse": {
      "type": "object",
      "title": "Returns the updated shipment",
      "properties": {
        "shipment": {
          "title": "The updated shipment state",
          "$ref": "#/definitions/Shipment"
        }
      }
    },
    "UpsertCustomsDeclarationRequest": {
      "type": "object",
      "required": [
        "site_id",
        "shipment_id"
      ],
      "properties": {
        "customs_declaration": {
          "description": "Customs declaration information that will be upserted to the shipment. If empty field given, information about the customs declaration will be removed from the shipment.",
          "$ref": "#/definitions/GeneralCustomsDeclaration"
        },
        "shipment_id": {
          "description": "The ID of the shipment for which customs declaration upserting.",
          "type": "string"
        },
        "site_id": {
          "description": "The ID of the site to which this request belongs.",
          "type": "string"
        }
      }
    },
    "UpsertCustomsDeclarationResponse": {
      "type": "object",
      "properties": {
        "shipment": {
          "$ref": "#/definitions/Shipment"
        }
      }
    },
    "Error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Any"
          }
        },
        "message": {
          "type": "string"
        }
      }
    }
  },
  "securityDefinitions": {
    "Bearer": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  }
}