openapi: 3.0.3
info:
  version: 1.0.0-pre.1
  title: API specification for QuayConnect
  license:
    name: Proprietary
    url: https://quayconnect.io
  description: >-
    This API specification describes the functionalities for creating EU export
    and UK import customs declarations.
        The main data structure in QuayConnect is a consignment which is the equivalent of a single sales order or invoice.
        Multiple consignment can be linked together through a voyageReference, which can be useful if multiple orders are
        shipped in a single container or trailer. In that case a transport order number, container number or trailer
        licence plate can be provided in the voyageNumber field to link multiple shipments together.
servers:
  - url: https://api.quayconnect.io
    description: Production environment of the QuayConnect platform
  - url: https://api.test.quayconnect.io
    description: Test environment of the QuayConnect platform
  - url: https://api.dev.quayconnect.io
    description: Development environment of the QuayConnect platform
paths:
  /v2/shipments:
    post:
      operationId: createShipmentNative
      summary: Create a new shipment.
      description: >-
        This will automatically trigger the services that are configured for
        this organisation. The service configuration is a one-time setup that
        happens in the QuayConnect web appplication.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewShipmentRequest'
      parameters: []
      responses:
        '201':
          description: Successfully created shipment. Return shipment ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewShipmentResponse'
        '400':
          description: Invalid request. For examples, a required field was not provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Invalid API key or intermediary organisation does not have access to
            the data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '409':
          description: Conflict, anther shipment exists with this exact reference.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-import-dms/cri:
    post:
      operationId: importCRI
      summary: Send a correction message to DMS after a control request.
      description: This will send a CRI correction message to DMS.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportCRIRequest'
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully created shipment. Return shipment ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request. For examples, a required field was not provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Invalid API key or intermediary organisation does not have access to
            the data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-import-dms/documents:
    post:
      operationId: provideDocuments
      summary: Provide supporting documents to DMS after a control request.
      description: >-
        Sends the supporting documents Customs requested for a declaration under
        control (DMS Digitaal Dossier, message IE446 import / NLPRD export).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvideDocumentsRequest'
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Documents accepted for submission to DMS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request. For example, the service is not in the NLRFI state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Invalid API key or intermediary organisation does not have access to
            the data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-import-dms/cancel:
    post:
      operationId: importCancel
      summary: Tries to cancel the nl-import-service.
      description: This will send a IE414 correction message to DMS.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportCancelRequest'
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully sent cancel message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request. For examples, a required field was not provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Invalid API key or intermediary organisation does not have access to
            the data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-transit-dms/presentation:
    post:
      operationId: transitPresentation
      summary: >-
        Notifies Customs that the goods of a pre-lodged transit declaration are
        presented.
      description: >-
        Only for a transit declaration with additionalDeclarationType "D" that
        Customs acknowledged (IE928). This sends the presentation notification
        (IE170) to NCTS; Customs answers with the MRN (IE028) or a rejection
        (IE056).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                shipmentId:
                  type: string
                  minLength: 1
                  description: Unique id of the shipment
              required:
                - shipmentId
              additionalProperties: false
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully sent the presentation notification.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: >-
            Invalid request. For example, the transit declaration already has an
            MRN.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Invalid API key or intermediary organisation does not have access to
            the data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-transit-dms/amend:
    post:
      operationId: transitAmend
      summary: Amends the transit declaration.
      description: >-
        Update the shipment first (PUT /v2/shipments/{uid}), then call this to
        send the amendment (IE013) built from its transit data. Possible while
        Customs has not released the declaration. Customs answers with the
        acceptance (IE004) or a rejection (IE056).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransitAmendRequest'
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully queued the amendment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request, or the shipment is not in a state that allows this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key or the organisation may not do this on the shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-transit-dms/cancel:
    post:
      operationId: transitCancel
      summary: Requests the cancellation of the transit declaration.
      description: >-
        Sends the request to invalidate the declaration (IE014) with the reason.
        Customs answers with its decision (IE009) or a rejection (IE056). The
        status becomes "cancellation requested".
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReasonRequest'
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully queued the cancellation request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request, or the shipment is not in a state that allows this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key or the organisation may not do this on the shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-export-dms/cancel:
    post:
      operationId: exportCancel
      summary: Cancels the DMS export declaration.
      description: >-
        Sends the cancellation of the export declaration with the reason. The
        export needs its MRN. The status becomes "cancellation requested".
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReasonRequest'
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully queued the cancellation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request, or the shipment is not in a state that allows this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key or the organisation may not do this on the shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-import-dms/amend:
    post:
      operationId: importAmend
      summary: Amends the DMS import declaration.
      description: >-
        Update the shipment first (PUT /v2/shipments/{uid}), then call this to
        send the amendment (IE413), the whole declaration again from the
        shipment data. Possible once Customs gave the MRN and until the goods
        are released; goods cannot be added. Customs answers with IE404
        (accepted) or IE456 (refused); the declaration keeps its status either
        way, and amendmentRequestedDate is set until the answer.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                shipmentId:
                  type: string
                  minLength: 1
                  description: Unique id of the shipment
              required:
                - shipmentId
              additionalProperties: false
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully queued the amendment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request, or the shipment is not in a state that allows this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key or the organisation may not do this on the shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/nl-transit-arrival-dms/unloading-remarks:
    post:
      operationId: transitUnloadingRemarks
      summary: Sends the unloading remarks of the transit arrival.
      description: >-
        Once Customs has given the unloading permission (IE043) and the arrival
        is "action-required", this sends the unloading remarks (IE044) from the
        arrival's transitArrival.unloadingRemarks. Customs answers with the
        release (IE025) or a rejection of the remarks (IE057).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                shipmentId:
                  type: string
                  minLength: 1
                  description: Unique id of the shipment
              required:
                - shipmentId
              additionalProperties: false
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '201':
          description: Successfully queued the unloading remarks.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request, or the shipment is not in a state that allows this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key or the organisation may not do this on the shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/partial:
    post:
      operationId: createPartialShipment
      summary: Create a partial shipment.
      description: >-
        This setup will not finalize the shipment nor trigger the services. You
        can do so by calling the following endpoints: 
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewPartialShipmentRequest'
      parameters: []
      responses:
        '201':
          description: Successfully created shipment. Returns shipment ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewShipmentResponse'
        '401':
          description: Not authorised.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: Invalid input.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/SimpleError'
                  - $ref: '#/components/schemas/Error'
        '409':
          description: Shipment alredy exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/documents:
    post:
      operationId: attachSupportingDocuments
      summary: Upload supporting documents to a given shipment.
      description: >-
        Some documents are required by the customs agent to process the. This
        endpoint allows to attach those documents to a previously created
        shipment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRequest'
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '200':
          description: Successfully attach document. Return document ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachDocumentsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: >-
            User doesn't have permissions to acccess the shipment, or it doesn't
            exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{uid}/execute-service:
    post:
      operationId: triggerService
      summary: Trigger service for the given shipment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TriggerServiceRequest'
      parameters:
        - name: uid
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '200':
          description: Successfully triggered the service
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewShipmentResponse'
        '401':
          description: Not authorised.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/shipments/{uid}:
    put:
      operationId: partialShipmentUpdate
      summary: Partially update the exsisting shipment.
      description: >-
        A finalized shipment cannot be updated (405), with three exceptions,
        each before an action on its only service: a DVA departure Customs has
        acknowledged (IE928) and not released, before an amendment; a DVA
        arrival waiting for its unloading remarks; and a DMS import with its MRN
        and not released, before an amendment (nl-import-dms/amend). The
        shipment reference cannot be changed then. transit and transitArrival
        merge with the stored values.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewPartialShipmentRequest'
      parameters:
        - name: uid
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '200':
          description: Successfully updated the shipment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewShipmentResponse'
        '401':
          description: Not authorised.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: Invalid input.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/SimpleError'
                  - $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/contacts:
    post:
      operationId: createContact
      summary: Create a new contact.
      description: >-
        Creates a contact for the organisation. Shipments refer to a contact by
        its code, so the code has to be unique within the organisation.
        Intermediary and service provider organisations can create contacts for
        their customers with the `onBehalf` field.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewContactRequest'
      parameters: []
      responses:
        '201':
          description: Successfully created the contact.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewContactResponse'
        '400':
          description: Invalid request. For example, a required field was not provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Invalid API key or the organisation may not create contacts on
            behalf of the given organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '409':
          description: >-
            Conflict, a contact with this code already exists for the
            organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
    get:
      operationId: getContacts
      summary: >-
        Retrieve a page of contacts of the organisation sorted by the creation
        date
      description: >-
        Query parameters: pageSize (default 25) and page (default 1). Pages
        start at 1, and page 0 gives the first page.
      parameters:
        - name: customerOrg
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          in: query
          required: false
          schema:
            type: number
        - name: page
          in: query
          required: false
          schema:
            type: number
      responses:
        '200':
          description: Array of contacts for the specified page sorted by the creation date
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContactsResponse'
        '401':
          description: Invalid API key or organisation does not have access to the data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/locations:
    post:
      operationId: createLocation
      summary: Create a new location.
      description: >-
        Creates a location for the organisation. Shipments refer to a location
        by its code, so the code has to be unique within the organisation.
        Intermediary and service provider organisations can create locations for
        their customers with the `onBehalf` field.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewLocationRequest'
      parameters: []
      responses:
        '201':
          description: Successfully created the location.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewLocationResponse'
        '400':
          description: Invalid request. For example, a required field was not provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Invalid API key or the organisation may not create locations on
            behalf of the given organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '409':
          description: >-
            Conflict, a location with this code already exists for the
            organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
    get:
      operationId: getLocations
      summary: Lists the locations of the organisation.
      description: >-
        The newest locations first. Query parameters: pageSize (default 25) and
        page (default 1). Pages start at 1, and page 0 gives the first page.
      parameters:
        - name: customerOrg
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          in: query
          required: false
          schema:
            type: number
        - name: page
          in: query
          required: false
          schema:
            type: number
      responses:
        '200':
          description: A page of locations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLocationsResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/contacts/{code}:
    put:
      operationId: updateContact
      summary: Updates a contact.
      description: >-
        Changes the fields that are given; the others stay as they are. The code
        cannot be changed. Shipments that were already created keep the contact
        data they were made with.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactRequest'
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Code of the contact
      responses:
        '200':
          description: The contact as it is now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewContactResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: No contact with this code exists for the organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
    delete:
      operationId: deleteContact
      summary: Deletes a contact.
      description: >-
        Removes the contact of the organisation. Shipments that were already
        created keep the contact data they were made with.
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Code of the contact
        - name: onBehalf
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: The contact was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: No contact with this code exists for the organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/locations/{code}:
    put:
      operationId: updateLocation
      summary: Updates a location.
      description: >-
        Changes the fields that are given; the others stay as they are. The code
        cannot be changed. Shipments that were already created keep the location
        data they were made with.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLocationRequest'
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Code of the location
      responses:
        '200':
          description: The location was updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: No location with this code exists for the organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
    delete:
      operationId: deleteLocation
      summary: Deletes a location.
      description: >-
        Removes the location of the organisation. Shipments that were already
        created keep the location data they were made with.
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Code of the location
        - name: onBehalf
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: The location was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationStatusResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: No location with this code exists for the organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '413':
          description: The request size is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{uid}/simulateUpdate:
    post:
      operationId: simulateUpdate
      summary: >-
        Simulates an update of a shipment's service state, for testing an
        integration. Not available on production.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulateUpdateRequest'
      parameters:
        - name: uid
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '200':
          description: Successfully simulated the update.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    minLength: 1
                required:
                  - message
                additionalProperties: false
        '401':
          description: Not authorised.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}/data:
    get:
      operationId: getShipmentData
      summary: >-
        Retrieve the status of a given shipment together with shipment
        data/details.
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '200':
          description: Import/export and validation status for the given shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentStatusDataResponse'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: >-
            User doesn't have permissions to access the shipment, or it doesn't
            exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
  /v2/shipments/{shipmentId}:
    get:
      operationId: getShipment
      summary: Retrieve the status of a given shipment.
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: Unique id of the shipment
      responses:
        '200':
          description: Import/export and validation status for the given shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentStatusResponse'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '404':
          description: >-
            User doesn't have permissions to access the shipment, or it doesn't
            exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleError'
components:
  schemas:
    DocumentRequest:
      type: object
      properties:
        dataBase64:
          type: string
          minLength: 1
          description: Base64 encoded data of the document.
        filename:
          type: string
          minLength: 1
          description: Name of the file
        documentIdentifier:
          type: string
          minLength: 1
          description: Unique identifier of the document (e.g. invoice number)
        documentType:
          type: string
          enum:
            - bl
            - cmr
            - phyto
            - invoice
            - other
            - P2
            - N00004
            - '0005'
            - '0006'
            - '0010'
            - '0011'
            - '0023'
            - '0027'
            - '0030'
            - '0040'
            - '1119'
            - '1200'
            - '1300'
            - '1500'
            - '1600'
            - '1900'
            - '1998'
            - '1999'
            - '2095'
            - '8002'
            - '8004'
            - '8005'
            - '8006'
            - '8007'
            - '8009'
            - '8016'
            - '8022'
            - '8023'
            - '8025'
            - '8030'
            - '8031'
            - '8032'
            - '9003'
            - '9004'
            - A001
            - A004
            - A007
            - A008
            - A009
            - A010
            - A014
            - A015
            - A016
            - A017
            - A019
            - A022
            - A023
            - A030
            - C001
            - C006
            - C008
            - C013
            - C014
            - C015
            - C017
            - C018
            - C019
            - C026
            - C027
            - C034
            - C039
            - C040
            - C041
            - C042
            - C043
            - C045
            - C046
            - C047
            - C050
            - C052
            - C053
            - C055
            - C056
            - C057
            - C058
            - C060
            - C064
            - C065
            - C067
            - C068
            - C069
            - C070
            - C071
            - C072
            - C073
            - C074
            - C075
            - C076
            - C077
            - C078
            - C079
            - C080
            - C081
            - C082
            - C083
            - C084
            - C085
            - C089
            - C090
            - C091
            - C092
            - C093
            - C094
            - C095
            - C100
            - C119
            - C400
            - C401
            - C402
            - C403
            - C404
            - C405
            - C406
            - C501
            - C502
            - C503
            - C504
            - C505
            - C506
            - C509
            - C512
            - C513
            - C514
            - C516
            - C517
            - C519
            - C526
            - C600
            - C601
            - C602
            - C605
            - C612
            - C613
            - C614
            - C615
            - C616
            - C617
            - C618
            - C619
            - C620
            - C621
            - C622
            - C623
            - C624
            - C625
            - C626
            - C627
            - C631
            - C635
            - C638
            - C639
            - C640
            - C641
            - C644
            - C647
            - C651
            - C652
            - C656
            - C657
            - C658
            - C659
            - C660
            - C664
            - C665
            - C666
            - C667
            - C668
            - C669
            - C670
            - C671
            - C672
            - C673
            - C676
            - C678
            - C679
            - C680
            - C683
            - C684
            - C685
            - C687
            - C688
            - C689
            - C690
            - C692
            - C700
            - C701
            - C710
            - C715
            - C990
            - D005
            - D008
            - D017
            - D018
            - D019
            - D020
            - D021
            - D022
            - D023
            - D024
            - E012
            - E013
            - E014
            - E017
            - E020
            - E990
            - I004
            - K020
            - K022
            - K025
            - K026
            - K027
            - K028
            - K029
            - K030
            - K031
            - L001
            - L079
            - L081
            - L082
            - L100
            - L116
            - L135
            - L136
            - L137
            - L138
            - L139
            - L142
            - L143
            - L144
            - L146
            - L147
            - L838
            - N002
            - N018
            - N235
            - N271
            - N337
            - N355
            - N703
            - N704
            - N705
            - N710
            - N714
            - N720
            - N722
            - N730
            - N740
            - N741
            - N750
            - N760
            - N785
            - N787
            - N820
            - N821
            - N822
            - N825
            - N851
            - N852
            - N853
            - N864
            - N934
            - N935
            - N952
            - N954
            - N955
            - N988
            - N990
            - U004
            - U005
            - U045
            - U048
            - U059
            - U062
            - U063
            - U067
            - U068
            - U069
            - U074
            - U075
            - U076
            - U077
            - U084
            - U088
            - U090
            - U091
            - U099
            - U101
            - U110
            - U111
            - U112
            - U113
            - U114
            - U115
            - U116
            - U117
            - U118
            - U119
            - U120
            - U121
            - U122
            - U161
            - U162
            - U163
            - U164
            - U165
            - U166
            - U167
            - U168
            - U169
            - U170
            - U171
            - U176
            - U177
            - U178
            - X001
            - X035
            - X060
            - X061
            - X062
            - X063
            - X064
            - X065
            - X066
            - X067
            - X068
            - X070
            - X071
            - X072
            - X802
            - X803
            - X804
            - X805
            - X806
            - X807
            - X808
            - X817
            - X819
            - X823
            - X824
            - X830
            - X831
            - X832
            - X834
            - X835
            - X836
            - X837
            - X839
            - X840
            - X842
            - X985
            - X990
            - X991
            - X992
            - X993
            - Y001
            - Y003
            - Y006
            - Y007
            - Y008
            - Y013
            - Y015
            - Y017
            - Y019
            - Y020
            - Y021
            - Y022
            - Y023
            - Y024
            - Y025
            - Y026
            - Y027
            - Y028
            - Y029
            - Y031
            - Y032
            - Y033
            - Y034
            - Y036
            - Y037
            - Y038
            - Y043
            - Y046
            - Y053
            - Y054
            - Y057
            - Y058
            - Y062
            - Y063
            - Y066
            - Y069
            - Y070
            - Y072
            - Y073
            - Y074
            - Y075
            - Y076
            - Y077
            - Y078
            - Y079
            - Y082
            - Y083
            - Y084
            - Y085
            - Y086
            - Y087
            - Y088
            - Y089
            - Y090
            - Y091
            - Y100
            - Y105
            - Y106
            - Y107
            - Y108
            - Y109
            - Y110
            - Y111
            - Y112
            - Y113
            - Y115
            - Y116
            - Y117
            - Y118
            - Y119
            - Y120
            - Y121
            - Y123
            - Y124
            - Y125
            - Y127
            - Y150
            - Y151
            - Y152
            - Y154
            - Y155
            - Y160
            - Y162
            - Y163
            - Y165
            - Y200
            - Y201
            - Y202
            - Y203
            - Y204
            - Y205
            - Y206
            - Y207
            - Y208
            - Y209
            - Y210
            - Y211
            - Y212
            - Y213
            - Y214
            - Y215
            - Y216
            - Y217
            - Y218
            - Y219
            - Y220
            - Y221
            - Y223
            - Y300
            - Y301
            - Y703
            - Y704
            - Y784
            - Y785
            - Y786
            - Y787
            - Y788
            - Y789
            - Y790
            - Y791
            - Y792
            - Y793
            - Y794
            - Y795
            - Y796
            - Y797
            - Y798
            - Y799
            - Y800
            - Y801
            - Y802
            - Y805
            - Y806
            - Y807
            - Y808
            - Y809
            - Y810
            - Y811
            - Y812
            - Y813
            - Y814
            - Y815
            - Y816
            - Y818
            - Y820
            - Y821
            - Y822
            - Y824
            - Y825
            - Y831
            - Y832
            - Y833
            - Y835
            - Y838
            - Y839
            - Y840
            - Y841
            - Y842
            - Y843
            - Y844
            - Y845
            - Y846
            - Y847
            - Y848
            - Y849
            - Y850
            - Y851
            - Y852
            - Y853
            - Y854
            - Y855
            - Y856
            - Y857
            - Y858
            - Y859
            - Y860
            - Y861
            - Y863
            - Y864
            - Y865
            - Y866
            - Y867
            - Y868
            - Y869
            - Y872
            - Y873
            - Y874
            - Y875
            - Y876
            - Y877
            - Y878
            - Y890
            - Y891
            - Y892
            - Y893
            - Y894
            - Y895
            - Y896
            - Y898
            - Y900
            - Y901
            - Y902
            - Y903
            - Y904
            - Y906
            - Y907
            - Y908
            - Y909
            - Y910
            - Y915
            - Y916
            - Y917
            - Y918
            - Y919
            - Y920
            - Y921
            - Y922
            - Y923
            - Y924
            - Y925
            - Y926
            - Y927
            - Y929
            - Y930
            - Y931
            - Y932
            - Y934
            - Y935
            - Y937
            - Y939
            - Y942
            - Y944
            - Y945
            - Y946
            - Y947
            - Y948
            - Y949
            - Y950
            - Y951
            - Y952
            - Y953
            - Y955
            - Y956
            - Y957
            - Y958
            - Y959
            - Y960
            - Y961
            - Y962
            - Y963
            - Y964
            - Y965
            - Y966
            - Y967
            - Y968
            - Y969
            - Y970
            - Y971
            - Y972
            - Y976
            - Y978
            - Y980
            - Y981
            - Y983
            - Y984
            - Y986
            - Y987
            - Y988
            - Y993
            - Y994
            - Y995
            - Y996
            - Y997
            - Y998
            - '2500'
            - '2501'
            - '2550'
            - '2551'
            - '2552'
            - '3000'
            - '3001'
            - '3002'
            - '3003'
            - '3004'
            - '3005'
            - '3006'
            - '3007'
            - '3008'
            - '3009'
            - '3012'
            - '3013'
            - '3014'
            - '3015'
            - '3016'
            - '3017'
            - '3018'
            - '3019'
            - '3020'
            - '3021'
            - '3022'
            - '3023'
            - '3024'
            - '3025'
            - '3026'
            - '3027'
            - '3028'
            - '3030'
            - '3034'
            - '3035'
            - '3036'
            - '3037'
            - '3038'
            - '3042'
            - '3043'
            - '3044'
            - '3045'
            - '3046'
            - '3047'
            - '3048'
            - '3049'
            - '3050'
            - '3051'
            - '3052'
            - '3053'
            - '3055'
            - '3056'
            - '3057'
            - '3058'
            - '3060'
            - '3062'
            - '3064'
            - '3065'
            - '3066'
            - '3067'
            - '3068'
            - '3069'
            - '3070'
            - '3071'
            - '3072'
            - '3073'
            - '3074'
            - '3075'
            - '3076'
            - '3077'
            - '3078'
            - '3079'
            - '3080'
            - '3081'
            - '3082'
            - '3083'
            - '3084'
            - '3085'
            - '3086'
            - '3087'
            - '3088'
            - '3089'
            - '3090'
            - '3091'
            - '3092'
            - '3093'
            - '3101'
            - '3102'
            - '3103'
            - '3104'
            - '3105'
            - '3106'
            - '3107'
            - '3108'
            - '3109'
            - '3110'
            - '3111'
            - '3112'
            - '3113'
            - '3114'
            - '3115'
            - '3116'
            - '3117'
            - '3118'
            - '3119'
            - '3120'
            - '3121'
            - '3122'
            - '3200'
            - '3202'
            - '3203'
            - '3204'
            - '3205'
            - '3249'
            - '3500'
            - '3501'
            - '3601'
            - '3602'
            - '3603'
            - '3999'
            - '4008'
            - '4010'
            - '4011'
            - '4013'
            - '4023'
            - '4040'
            - '4041'
            - '4042'
            - '4043'
            - '4044'
            - '4045'
            - '4046'
            - '4047'
            - '4048'
            - '4049'
            - '4050'
            - '4051'
            - '4052'
            - '4053'
            - '4054'
            - '4055'
            - '4056'
            - '4057'
            - '4058'
            - '4059'
            - '4060'
            - '4061'
            - '4062'
            - '4071'
            - '4098'
            - '4099'
            - '4114'
            - '4115'
            - '4116'
            - '4117'
            - '4118'
            - '4200'
            - '4201'
            - '4202'
            - '4203'
            - '4204'
            - '4205'
            - '4206'
            - '4207'
            - '4208'
            - '4209'
            - '4210'
            - '4211'
            - '4212'
            - '4901'
            - '4999'
            - '8005'
            - '8009'
            - '8042'
            - '8044'
            - '8045'
            - '8046'
            - '8047'
            - '8053'
            - '8054'
            - '8062'
            - '8065'
            - '8066'
            - '8068'
            - '8069'
            - '8071'
            - '8073'
            - '8075'
            - '8078'
            - '8079'
            - '8080'
            - '8081'
            - '8082'
            - '8083'
            - '8084'
            - '8085'
            - '8088'
            - '8091'
            - '8092'
            - '8099'
            - '8107'
            - '8108'
            - '8116'
            - '8117'
            - '8121'
            - '8132'
            - '8142'
            - '8150'
            - '8152'
            - '8160'
            - '8161'
            - '8162'
            - '8163'
            - '8164'
            - '8165'
            - '8172'
            - '8173'
            - '8175'
            - '8176'
            - '8180'
            - '8186'
            - '8190'
            - '8191'
            - '8198'
            - '8199'
            - '8205'
            - '8208'
            - '8209'
            - '8212'
            - '8215'
            - '8216'
            - '8230'
            - '8234'
            - '8237'
            - '8240'
            - '8241'
            - '8243'
            - '8246'
            - '8260'
            - '8277'
            - '8281'
            - '8288'
            - '8296'
            - '8299'
            - '8301'
            - '8305'
            - '8313'
            - '8315'
            - '8318'
            - '8319'
            - '8320'
            - '8326'
            - '8328'
            - '8330'
            - '8399'
            - '8423'
            - '8456'
            - '8463'
            - '8482'
            - '8489'
            - '8490'
            - '8491'
            - '8519'
            - '8522'
            - '8523'
            - '8524'
            - '8550'
            - '8604'
            - '8605'
            - '8609'
            - '8612'
            - '8624'
            - '8646'
            - '8647'
            - '8648'
            - '8649'
            - '8650'
            - '8651'
            - '8652'
            - '8653'
            - '8654'
            - '8682'
            - '8718'
            - '8720'
            - '8721'
            - '8722'
            - '8729'
            - '8730'
            - '8731'
            - '8734'
            - '8748'
            - '8749'
            - '8750'
            - '8767'
            - '8768'
            - '8795'
            - '8796'
            - '8797'
            - '8798'
            - '8799'
            - '8800'
            - '8801'
            - '8807'
            - '8808'
            - '8809'
            - '8810'
            - '8811'
            - '8812'
            - '8813'
            - '8814'
            - '8816'
            - '8817'
            - '8827'
            - '8828'
            - '8829'
            - '8830'
            - '8831'
            - '8832'
            - '8833'
            - '8835'
            - '8836'
            - '8837'
            - '8843'
            - '8846'
            - '8853'
            - '8854'
            - '8855'
            - '8856'
            - '8857'
            - '8858'
            - '8875'
            - '8879'
            - '8882'
            - '8884'
            - '8885'
            - '8886'
            - '8887'
            - '8888'
            - '8889'
            - '8890'
            - '8891'
            - '8894'
            - '8900'
            - '8907'
            - '8909'
            - '8919'
            - '8929'
            - '8930'
            - '8931'
            - '8933'
            - '8934'
            - '8935'
            - '8936'
            - '8943'
            - '8973'
            - '8979'
            - '8981'
            - '8983'
            - '8999'
          description: Type of the suppporting document
        mimeType:
          type: string
          minLength: 1
          description: MIME type of the given document
      required:
        - dataBase64
        - filename
        - documentIdentifier
        - documentType
        - mimeType
      additionalProperties: false
    ServiceDefinition:
      type: object
      properties:
        serviceType:
          type: string
          enum: &ref_1
            - nl-export-declaration
            - nl-import-declaration
            - uk-import-declaration
            - uk-import-cds
            - uk-gvms
            - nl-client-pd
            - nl-transit-t2-declaration
            - nl-transit-declaration
            - nl-transit-arrival
          description: Identifies the type of service to execute on the shipment
        gvms:
          type: boolean
          description: >-
            Used for the uk-import-declaration service, indicates whether gvms
            or inventory linking should be used
        eidr:
          type: boolean
          description: Controls if EIDR is enabled in case GVMS is used
        ipaffs:
          type: boolean
          description: Controls if IPAFFS is enabled for this shipment.
        inspectionDateTime:
          type: string
          description: >-
            In case of Client Request specify the date the container is ready to
            be inspected.
        customsOfficeOfDeparture:
          type: string
          description: Execution option for transit services.
        customsOfficeOfDestination:
          type: string
          description: Execution option for transit services.
        guaranteeType:
          type: string
          description: Execution option for transit services.
        guaranteeReference:
          type: string
          description: Execution option for transit services.
        reducedDatasetIndicator:
          type: string
          description: 'Execution option for transit services: "0" or "1".'
        bindingItinerary:
          type: string
          description: 'Execution option for transit services: "0" or "1".'
        representativeEORI:
          type: string
          description: Execution option for transit services.
        representativeStatus:
          type: string
          description: Execution option for transit services.
        guaranteeAccessCode:
          type: string
          description: Execution option for transit services.
        otherGuaranteeReference:
          type: string
          description: Execution option for transit services.
        declarantEORI:
          type: string
          description: Provider option for customs declaration services.
        declarantIntegrationNumber:
          type: string
          description: Provider option for customs declaration services.
        principalEORI:
          type: string
          description: Provider option for transit services.
        supervisingOffice:
          type: string
          pattern: ^[A-Z]{2}[A-Z0-9]{6}$
          description: >-
            DMS export and import. Supervising customs office (codelist 141),
            only when the declaration is lodged at another office than the one
            in the authorisation.
        presentationDate:
          type: integer
          exclusiveMinimum: true
          minimum: 0
          description: >-
            DMS export only. Date and time the goods are presented to Customs,
            as a UNIX timestamp in milliseconds.
        warehouseType:
          type: string
          pattern: ^[A-Z]$
          description: >-
            DMS export and import. Type of the storage facility (codelist 099).
            Required with warehouseId for customs warehousing (procedure 71, 07,
            45 or 68, or 44 with additional procedure 615).
        warehouseId:
          type: string
          minLength: 1
          maxLength: 35
          description: >-
            DMS export and import. Identification of the storage facility
            (authorisation number of the warehouse).
      required:
        - serviceType
      additionalProperties: false
    KnownLocation:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: >-

            Location reference managed in QuayConnect web application. A
            commonly used

            code is the postal code + house number which is a unique combination
            the

            Netherlands.


            These location codes are managed in QuayConnect.
      required:
        - code
      additionalProperties: false
    Location:
      type: object
      properties:
        unLocode:
          type: string
          minLength: 5
          maxLength: 5
          description: UN/LOCODE of the location
        city:
          type: string
          minLength: 1
          maxLength: 100
          description: City of the location, e.g. Rotterdam
        country:
          type: string
          minLength: 2
          maxLength: 2
          description: UN 2-letter country code of the country of the location, e.g. "NL"
      additionalProperties: false
    VehicleDescription:
      type: object
      properties:
        identity:
          type: string
          description: >-

            Identification number of the type of transport. This can be a
            license plat

            number, flight number, vessel name or something else. See the
            description

            of Transport for more details.
        nationality:
          type: string
          description: >-
            Nationality of the transport, formatted as a UN two letter country
            code.
      required:
        - identity
        - nationality
      additionalProperties: false
    Carrier:
      type: object
      properties:
        scac:
          type: string
          description: SCAC code of the carrier shipping the goods
        name:
          type: string
      additionalProperties: false
    Container:
      type: object
      properties:
        containerNumber:
          type: string
        seals:
          type: array
          items:
            type: string
        goodsItems:
          type: array
          items:
            type: integer
            minimum: 1
          description: >-
            Transit only. The goods in this container, by their position in
            goods (from 1). Without it, the container holds all goods.
      required:
        - containerNumber
      additionalProperties: false
    Voyage:
      type: object
      properties:
        voyageType:
          type: string
          enum:
            - roro
            - roro-eurotunnel
            - ocean
            - air
            - rail
          description: >-

            Describes the combined mode of transport from export to import
            country.

            roro - roro via shortsea vessel (ferry)

            roro-eurotunnel - roro via shortsea vessel (ferry)

            ocean - ocean carrier route

            air - air freight

            rail - rail transport crossing the border
        placeOfLoading:
          $ref: '#/components/schemas/KnownLocation'
        portOfLoading:
          $ref: '#/components/schemas/Location'
        portOfDischarge:
          $ref: '#/components/schemas/Location'
        placeOfDelivery:
          $ref: '#/components/schemas/KnownLocation'
        trailer:
          $ref: '#/components/schemas/VehicleDescription'
        truck:
          $ref: '#/components/schemas/VehicleDescription'
        wagon:
          $ref: '#/components/schemas/VehicleDescription'
        aircraft:
          $ref: '#/components/schemas/VehicleDescription'
        flight:
          $ref: '#/components/schemas/VehicleDescription'
        vessel:
          $ref: '#/components/schemas/VehicleDescription'
        carrier:
          $ref: '#/components/schemas/Carrier'
        transitCustomsOffices:
          type: array
          items:
            type: string
          description: >-
            Customs Office of Transit where products cross the EU border to a
            Customs Office of Destination in a nonEU country member of the
            Common Transit Convention.
        destinationCustomsOffice:
          type: string
          description: ' Customs office of destination in Transit Departure declaration.'
        exitCustomsOffice:
          type: string
          description: >-
            Customs office of exit: where the goods leave the EU (e.g.
            NL000396). Used by DMS export.
        containers:
          type: array
          items:
            $ref: '#/components/schemas/Container'
        eta:
          type: number
          description: >-
            Estimated time of arrival of the shipment (for UK services: at the
            UK border), as a UNIX timestamp in milliseconds (e.g.
            1792557908243). Not sent in the DMS export or import declaration.
      required:
        - voyageType
        - portOfLoading
        - portOfDischarge
        - eta
      additionalProperties: false
    TransitGuaranteeReference:
      type: object
      properties:
        grn:
          type: string
          maxLength: 24
          description: Guarantee Reference Number. Required when type is in codelist 286.
        accessCode:
          type: string
          maxLength: 4
          description: Access code. Required when type is in codelist 286.
        amountCovered:
          type: number
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: ISO currency code (codelist 048).
      additionalProperties: false
    TransitGuarantee:
      type: object
      properties:
        type:
          type: string
          maxLength: 1
          description: >-
            Guarantee type (codelist 251). otherReference is required for "8"
            and optional for "3".
        otherReference:
          type: string
          maxLength: 35
          description: >-
            Only for guarantee types 3 and 8. Required when type is "8",
            optional when "3".
        references:
          type: array
          items:
            $ref: '#/components/schemas/TransitGuaranteeReference'
          maxItems: 99
          description: Guarantee references. Required when type is in codelist 076.
      required:
        - type
      additionalProperties: false
    TransitPlace:
      type: object
      properties:
        unLocode:
          type: string
          maxLength: 17
          description: UN/LOCODE (codelist 244), e.g. "NLRTM".
        country:
          type: string
          enum: &ref_0
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AZ
            - BA
            - BB
            - BI
            - BE
            - BF
            - BG
            - BH
            - BD
            - BJ
            - BM
            - BN
            - BO
            - BR
            - BS
            - BT
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - ST
            - SV
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TM
            - TN
            - TO
            - TL
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
            - XZ
            - RS
            - ME
            - JE
            - GG
            - IM
            - AX
            - CW
            - BQ
            - BL
            - MF
            - SX
            - SS
          description: Required when unLocode is not given.
        location:
          type: string
          maxLength: 35
          description: Location name. Required when unLocode is not given.
      additionalProperties: false
    GoodsLocation:
      type: object
      properties:
        type:
          type: string
          description: NCTS goods location type (CL347).
        code:
          type: string
        address:
          type: object
          properties:
            street:
              type: string
            houseNumber:
              type: string
            houseNumberAddition:
              type: string
            postalCode:
              type: string
            city:
              type: string
            country:
              type: string
              enum: *ref_0
              description: UN 2-letter country code, e.g. "NL".
          required:
            - country
          additionalProperties: false
      required:
        - type
      additionalProperties: false
    TransitDocuments:
      type: object
      properties:
        previousDocuments:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]{4}$
                description: Document type (codelist 214).
              referenceNumber:
                type: string
                minLength: 1
                maxLength: 70
                description: Document number.
              complementOfInformation:
                type: string
                maxLength: 35
                description: Complement of information.
            required:
              - type
              - referenceNumber
            additionalProperties: false
          maxItems: 9999
          description: Previous documents (max 9999).
        supportingDocuments:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]{4}$
                description: Document type (codelist 213).
              referenceNumber:
                type: string
                minLength: 1
                maxLength: 70
                description: Document number.
              documentLineItemNumber:
                type: integer
                minimum: 1
                maximum: 99999
                description: Line number on the document.
              complementOfInformation:
                type: string
                maxLength: 35
                description: Complement of information.
            required:
              - type
              - referenceNumber
            additionalProperties: false
          maxItems: 99
          description: Supporting documents (max 99).
        transportDocuments:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]{4}$
                description: Document type (codelist 754).
              referenceNumber:
                type: string
                minLength: 1
                maxLength: 70
                description: Document number.
            required:
              - type
              - referenceNumber
            additionalProperties: false
          maxItems: 99
          description: Transport documents (max 99).
        additionalReferences:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]{4}$
                description: Document type (codelist 380).
              referenceNumber:
                type: string
                minLength: 1
                maxLength: 70
                description: Reference number.
            required:
              - type
            additionalProperties: false
          maxItems: 99
          description: Additional references (max 99).
        additionalInformation:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                pattern: ^[A-Z0-9]{5}$
                description: Additional information code (codelist 239).
              text:
                type: string
                maxLength: 512
                description: Text.
            required:
              - code
            additionalProperties: false
          maxItems: 99
          description: Additional information (max 99).
      additionalProperties: false
    TransitItemDocuments:
      type: object
      properties:
        previousDocuments:
          type: array
          items:
            type: object
            properties:
              type:
                $ref: >-
                  #/components/schemas/TransitDocuments/properties/previousDocuments/items/properties/type
              referenceNumber:
                $ref: >-
                  #/components/schemas/TransitDocuments/properties/previousDocuments/items/properties/referenceNumber
              complementOfInformation:
                $ref: >-
                  #/components/schemas/TransitDocuments/properties/previousDocuments/items/properties/complementOfInformation
              goodsItemNumber:
                type: integer
                minimum: 1
                maximum: 99999
                description: Goods item number on the previous document.
              typeOfPackages:
                type: string
                minLength: 2
                maxLength: 2
                description: Type of packages (codelist 017).
              numberOfPackages:
                type: integer
                minimum: 0
                maximum: 99999999
                description: Number of packages.
              measurementUnitAndQualifier:
                type: string
                minLength: 1
                maxLength: 4
                description: Measurement unit (codelist 349).
              quantity:
                type: number
                minimum: 0
                description: Quantity.
            required:
              - type
              - referenceNumber
            additionalProperties: false
          maxItems: 9999
          description: Previous documents of this good (max 9999).
        housePreviousDocuments:
          type: array
          items:
            $ref: >-
              #/components/schemas/TransitDocuments/properties/previousDocuments/items
          maxItems: 99
          description: >-
            Previous documents on this good's house consignment (max 99), e.g.
            N830 for the export declaration: Customs refuses N830 on the
            consignment and on the goods line (CL214).
        supportingDocuments:
          $ref: '#/components/schemas/TransitDocuments/properties/supportingDocuments'
        transportDocuments:
          $ref: '#/components/schemas/TransitDocuments/properties/transportDocuments'
        additionalReferences:
          $ref: >-
            #/components/schemas/TransitDocuments/properties/additionalReferences
        additionalInformation:
          $ref: >-
            #/components/schemas/TransitDocuments/properties/additionalInformation
      additionalProperties: false
    TransitParty:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 17
          description: EORI of the party.
        name:
          type: string
          minLength: 1
          maxLength: 70
          description: Name of the party.
        address:
          type: object
          properties:
            streetAndNumber:
              type: string
              minLength: 1
              maxLength: 70
              description: Street and number.
            postcode:
              type: string
              maxLength: 17
              description: Postcode.
            city:
              type: string
              minLength: 1
              maxLength: 35
              description: City.
            country:
              type: string
              minLength: 2
              maxLength: 2
              description: Country (codelist 248).
          required:
            - streetAndNumber
            - city
            - country
          additionalProperties: false
          description: Address of the party.
        contactPerson:
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 70
              description: Name of the contact person.
            phone:
              type: string
              minLength: 1
              maxLength: 35
              description: Phone number.
            email:
              type: string
              maxLength: 256
              description: E-mail address.
          required:
            - name
            - phone
          additionalProperties: false
          description: Contact person.
      additionalProperties: false
    TransitParties:
      type: object
      properties:
        holder:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/TransitParty/properties/id'
            name:
              $ref: '#/components/schemas/TransitParty/properties/name'
            address:
              $ref: '#/components/schemas/TransitParty/properties/address'
            contactPerson:
              $ref: '#/components/schemas/TransitParty/properties/contactPerson'
            tirHolderId:
              type: string
              minLength: 1
              maxLength: 17
              description: TIR holder identification number.
          additionalProperties: false
          description: >-
            Holder of the transit procedure, when it is not the consignor.
            Without it the holder is the consignor.
        carrier:
          type: object
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 17
              description: EORI of the carrier.
            contactPerson:
              $ref: '#/components/schemas/TransitParty/properties/contactPerson'
          required:
            - id
          additionalProperties: false
          description: Carrier. Without it the haulier of the shipment is used.
        representativeContact:
          $ref: '#/components/schemas/TransitParty/properties/contactPerson'
          description: Contact person of the representative.
        consignorContact:
          $ref: '#/components/schemas/TransitParty/properties/contactPerson'
          description: Contact person of the consignor.
        goodsLocationContact:
          $ref: '#/components/schemas/TransitParty/properties/contactPerson'
          description: Contact person at the location of the goods.
      additionalProperties: false
    Transit:
      type: object
      properties:
        declarationType:
          type: string
          enum:
            - T
            - T1
            - T2
            - T2F
            - T2SM
            - TIR
          description: >-
            Type of transit declaration (codelist 231). T - mixed (set per goods
            item), T1 - non-Union goods, T2 - Union goods, T2F - Union goods
            to/from a special fiscal territory, T2SM - San Marino, TIR - under a
            TIR carnet.
        additionalDeclarationType:
          type: string
          enum:
            - A
            - D
          description: >-
            Codelist 042: "A" standard declaration, "D" pre-lodged declaration.
            Defaults to "A".
        security:
          type: string
          description: NCTS CL217 security type. Defaults to "0" (none).
        reducedDatasetIndicator:
          type: boolean
        specificCircumstancesIndicator:
          type: string
          description: NCTS CL296. Required when additionalDeclarationType is "D".
        bindingItinerary:
          type: boolean
        tirCarnet:
          type: string
          description: Required when declarationType is "TIR", and only allowed then.
        limitDate:
          type: number
          description: Date limit for the transit movement, as a UNIX timestamp.
        goodsPresentationDate:
          type: number
          description: Date the goods are presented, as a UNIX timestamp.
        departureLanguage:
          type: string
          enum:
            - en
            - nl
          description: >-
            Language at departure (codelist 192). Fiton accepts only "en" and
            "nl".
        goodsLocation:
          $ref: '#/components/schemas/GoodsLocation'
        loadingPlace:
          $ref: '#/components/schemas/TransitPlace'
        unloadingPlace:
          $ref: '#/components/schemas/TransitPlace'
          description: Not allowed when security is 0.
        authorisations:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                maxLength: 4
                description: Authorisation type (codelist 235), e.g. "C521".
              referenceNumber:
                type: string
                maxLength: 35
            required:
              - type
              - referenceNumber
            additionalProperties: false
          maxItems: 9
          description: Required when reducedDatasetIndicator is true.
        transitOffices:
          type: array
          items:
            type: object
            properties:
              referenceNumber:
                type: string
                minLength: 8
                maxLength: 8
                description: Customs office of transit (codelist 173).
              arrivalDate:
                type: number
                description: >-
                  Expected arrival, as a UNIX timestamp. Required when security
                  is 1 or 3 and the office is in codelist 147.
            required:
              - referenceNumber
            additionalProperties: false
          maxItems: 9
          description: Not allowed on a TIR or T2SM declaration.
        exitOffices:
          type: array
          items:
            type: string
            minLength: 8
            maxLength: 8
            description: Customs office of exit (codelist 175).
          maxItems: 9
        additionalSupplyChainActors:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                maxLength: 3
                description: Role (codelist 704).
              identificationNumber:
                type: string
                maxLength: 17
            required:
              - role
              - identificationNumber
            additionalProperties: false
          maxItems: 99
        guarantees:
          type: array
          items:
            $ref: '#/components/schemas/TransitGuarantee'
          maxItems: 9
          description: >-
            Guarantees covering the declaration. Falls back to the
            nl-transit-dms provider options
            (guaranteeType/guaranteeReference/guaranteeAccessCode) when not
            provided.
        activeBorderTransportMeans:
          type: array
          items:
            type: object
            properties:
              customsOffice:
                type: string
                minLength: 8
                maxLength: 8
                description: Customs office at the border (codelist 141).
              identificationType:
                type: string
                pattern: ^[0-9]{2}$
                description: Type of identification (codelist 219).
              identificationNumber:
                type: string
                maxLength: 35
                description: Identification of the means of transport.
              nationality:
                type: string
                minLength: 2
                maxLength: 2
                description: Nationality (codelist 165).
              conveyanceReferenceNumber:
                type: string
                maxLength: 17
                description: Conveyance reference number.
            additionalProperties: false
          maxItems: 9
          description: Active means of transport crossing the border (max 9).
        transportChargesPaymentMethod:
          type: string
          pattern: ^[A-Z]$
          description: >-
            Transport charges method of payment for the whole consignment
            (codelist 116). Give it here or per good, not both. Not allowed when
            security is 0.
        documents:
          $ref: '#/components/schemas/TransitDocuments'
          description: Documents, references and information for the whole consignment.
        parties:
          $ref: '#/components/schemas/TransitParties'
          description: Holder, carrier and contact persons.
        inlandTransportMode:
          type: string
          pattern: ^[0-9]$
          description: >-
            Mode of inland transport (codelist 218). Without it the mode follows
            from the voyage.
        borderTransportMode:
          type: string
          pattern: ^[0-9]$
          description: >-
            Mode of transport at the border (codelist 218). Without it the mode
            follows from the voyage.
        routingCountries:
          type: array
          items:
            type: string
            minLength: 2
            maxLength: 2
          description: >-
            Countries the goods route through (max 99). Required when
            bindingItinerary is true or security is 1, 2 or 3.
      required:
        - declarationType
      additionalProperties: false
    TransitArrival:
      type: object
      properties:
        mrn:
          type: string
          minLength: 18
          maxLength: 18
          description: MRN of the transit movement that arrived.
        officeOfDestination:
          type: string
          minLength: 8
          maxLength: 8
          description: >-
            Actual customs office of destination (codelist 173). Falls back to
            the customsOfficeOfDestination option of the service.
        arrivalDate:
          type: number
          description: >-
            Arrival notification date and time, as a UNIX timestamp. Defaults to
            the time of sending.
        simplifiedProcedure:
          type: boolean
          description: True when the authorised consignee procedure is used.
        destinationLanguage:
          type: string
          minLength: 2
          maxLength: 2
          description: Language of communication at destination (codelist 192).
        authorisations:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                maxLength: 4
                description: Authorisation type, e.g. "C522" (authorised consignee).
              referenceNumber:
                type: string
                maxLength: 35
            required:
              - type
              - referenceNumber
            additionalProperties: false
          maxItems: 9
        goodsLocation:
          type: object
          properties:
            type:
              type: string
              minLength: 1
              maxLength: 1
              description: Type of location (codelist 347).
            qualifier:
              type: string
              minLength: 1
              maxLength: 1
              description: Qualifier of the identification (codelist 326).
            authorisationNumber:
              type: string
              maxLength: 35
            additionalIdentifier:
              type: string
              maxLength: 4
            unLocode:
              type: string
              maxLength: 17
            customsOffice:
              type: string
              minLength: 8
              maxLength: 8
            eori:
              type: string
              maxLength: 17
            address:
              type: object
              properties:
                street:
                  type: string
                  maxLength: 70
                houseNumber:
                  type: string
                  maxLength: 17
                postalCode:
                  type: string
                  maxLength: 17
                city:
                  type: string
                  maxLength: 35
                country:
                  type: string
                  enum: *ref_0
                  description: UN 2-letter country code, e.g. "NL".
              required:
                - country
              additionalProperties: false
            contactPerson:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 70
                phoneNumber:
                  type: string
                  maxLength: 35
                email:
                  type: string
                  maxLength: 256
              required:
                - name
                - phoneNumber
              additionalProperties: false
          required:
            - type
            - qualifier
          additionalProperties: false
          description: Where the goods can be examined at destination.
        incidents:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                maxLength: 1
                description: Incident code (CL019).
              text:
                type: string
                maxLength: 512
              country:
                type: string
                minLength: 2
                maxLength: 2
              unLocode:
                type: string
                maxLength: 17
              address:
                type: object
                properties:
                  street:
                    $ref: >-
                      #/components/schemas/TransitArrival/properties/goodsLocation/properties/address/properties/street
                  houseNumber:
                    $ref: >-
                      #/components/schemas/TransitArrival/properties/goodsLocation/properties/address/properties/houseNumber
                  postalCode:
                    $ref: >-
                      #/components/schemas/TransitArrival/properties/goodsLocation/properties/address/properties/postalCode
                  city:
                    $ref: >-
                      #/components/schemas/TransitArrival/properties/goodsLocation/properties/address/properties/city
                additionalProperties: false
              endorsement:
                type: object
                properties:
                  date:
                    type: number
                    description: UNIX timestamp.
                  authority:
                    type: string
                    maxLength: 35
                  place:
                    type: string
                    maxLength: 35
                  country:
                    type: string
                    minLength: 2
                    maxLength: 2
                required:
                  - date
                  - authority
                  - place
                  - country
                additionalProperties: false
            required:
              - code
              - text
              - country
            additionalProperties: false
          maxItems: 9
          description: Incidents during the movement.
        unloadingRemarks:
          type: object
          properties:
            conform:
              type: boolean
              description: True when everything is as declared. Defaults to true.
            unloadingCompletion:
              type: boolean
              description: True when the unloading is complete. Defaults to true.
            unloadingDate:
              type: number
              description: UNIX timestamp. Defaults to the time of sending.
            sealsOk:
              type: boolean
              description: True when the seals were found intact.
            remark:
              type: string
              maxLength: 512
            otherThingsToReport:
              type: string
              maxLength: 512
            grossMass:
              type: number
              description: Total gross mass as found, when it differs.
            transportEquipment:
              type: array
              items:
                type: object
                properties:
                  containerIdentificationNumber:
                    type: string
                    maxLength: 17
                  seals:
                    type: array
                    items:
                      type: string
                      maxLength: 20
                    maxItems: 99
                  declarationGoodsItemNumbers:
                    type: array
                    items:
                      type: number
                additionalProperties: false
              description: Containers and seals as found, when they differ.
            items:
              type: array
              items:
                type: object
                properties:
                  houseConsignment:
                    type: number
                  goodsItemNumber:
                    type: number
                  declarationGoodsItemNumber:
                    type: number
                  description:
                    type: string
                    maxLength: 512
                  grossMass:
                    type: number
                  netMass:
                    type: number
                  typeOfPackages:
                    type: string
                    maxLength: 2
                  numberOfPackages:
                    type: number
                required:
                  - houseConsignment
                  - goodsItemNumber
                  - declarationGoodsItemNumber
                additionalProperties: false
              description: >-
                Goods items as found, with only the values that differ from the
                unloading permission (IE043).
          additionalProperties: false
          description: >-
            Unloading remarks (IE044) after the unloading permission (IE043).
            Without findings, everything is reported as declared.
      required:
        - mrn
        - goodsLocation
      additionalProperties: false
    FinancialValue:
      type: object
      properties:
        amount:
          type: number
        currency:
          type: string
      additionalProperties: false
    Valuation:
      type: object
      properties:
        incoterms:
          type: string
          description: >-
            Incoterms agreed for this shipment, as stated on the invoice.
            Required, except for a DMS import where no goods item uses valuation
            method 1 (then no delivery terms are sent). Each service checks it.
        incotermsLocation:
          $ref: '#/components/schemas/Location'
          description: >-
            Location at which the incoterms apply. Required, except for DMS
            export and import with incoterm XXX (Customs rule BC0596). Each
            service checks it.
        airTransportCost:
          $ref: '#/components/schemas/FinancialValue'
        freightCost:
          $ref: '#/components/schemas/FinancialValue'
          description: >-
            Freight cost of the shipment. DMS export and import do not use this:
            give the freight and insurance per goods item in
            goods[].chargeDeduction.
        insuranceCost:
          $ref: '#/components/schemas/FinancialValue'
          description: >-
            Insurance cost of the shipment. DMS export and import do not use
            this: give the freight and insurance per goods item in
            goods[].chargeDeduction.
      additionalProperties: false
    Address:
      type: object
      properties:
        street:
          type: string
        houseNumber:
          type: string
        houseNumberAddition:
          type: string
        postalCode:
          type: string
        city:
          type: string
        country:
          type: string
      additionalProperties: false
    PartyDetails:
      type: object
      properties:
        legalName:
          type: string
          description: Name under which the party is registered
        eori:
          type: string
          description: EORI number assigned to this party in the country of registration.
        vat:
          type: string
          description: VAT number of the party
        address:
          $ref: '#/components/schemas/Address'
      additionalProperties: false
    Party:
      type: object
      properties:
        code:
          type: string
          description: >-
            Unique code assigned to the party in QuayConnect. Parties can be
            added through the UI.
        details:
          $ref: '#/components/schemas/PartyDetails'
          description: >-
            Details of the party. With a code, the fields given here replace the
            ones of the stored party (the address field by field); without, they
            are the party.
      required:
        - code
      additionalProperties: false
    PartyCodeOrDetails:
      allOf:
        - type: object
          properties:
            code:
              $ref: '#/components/schemas/Party/properties/code'
              description: >-
                Unique code assigned to the party in QuayConnect. Parties can be
                added through the UI.
        - type: object
          properties:
            details:
              $ref: '#/components/schemas/Party/properties/details'
              description: >-
                Details of the party. With a code, the fields given here replace
                the ones of the stored party (the address field by field);
                without, they are the party.
    Document:
      type: object
      properties:
        documentType:
          type: string
          enum:
            - bl
            - cmr
            - phyto
            - invoice
            - other
            - P2
            - N00004
            - '0005'
            - '0006'
            - '0010'
            - '0011'
            - '0023'
            - '0027'
            - '0030'
            - '0040'
            - '1119'
            - '1200'
            - '1300'
            - '1500'
            - '1600'
            - '1900'
            - '1998'
            - '1999'
            - '2095'
            - '8002'
            - '8004'
            - '8005'
            - '8006'
            - '8007'
            - '8009'
            - '8016'
            - '8022'
            - '8023'
            - '8025'
            - '8030'
            - '8031'
            - '8032'
            - '9003'
            - '9004'
            - A001
            - A004
            - A007
            - A008
            - A009
            - A010
            - A014
            - A015
            - A016
            - A017
            - A019
            - A022
            - A023
            - A030
            - C001
            - C006
            - C008
            - C013
            - C014
            - C015
            - C017
            - C018
            - C019
            - C026
            - C027
            - C034
            - C039
            - C040
            - C041
            - C042
            - C043
            - C045
            - C046
            - C047
            - C050
            - C052
            - C053
            - C055
            - C056
            - C057
            - C058
            - C060
            - C064
            - C065
            - C067
            - C068
            - C069
            - C070
            - C071
            - C072
            - C073
            - C074
            - C075
            - C076
            - C077
            - C078
            - C079
            - C080
            - C081
            - C082
            - C083
            - C084
            - C085
            - C089
            - C090
            - C091
            - C092
            - C093
            - C094
            - C095
            - C100
            - C119
            - C400
            - C401
            - C402
            - C403
            - C404
            - C405
            - C406
            - C501
            - C502
            - C503
            - C504
            - C505
            - C506
            - C509
            - C512
            - C513
            - C514
            - C516
            - C517
            - C519
            - C526
            - C600
            - C601
            - C602
            - C605
            - C612
            - C613
            - C614
            - C615
            - C616
            - C617
            - C618
            - C619
            - C620
            - C621
            - C622
            - C623
            - C624
            - C625
            - C626
            - C627
            - C631
            - C635
            - C638
            - C639
            - C640
            - C641
            - C644
            - C647
            - C651
            - C652
            - C656
            - C657
            - C658
            - C659
            - C660
            - C664
            - C665
            - C666
            - C667
            - C668
            - C669
            - C670
            - C671
            - C672
            - C673
            - C676
            - C678
            - C679
            - C680
            - C683
            - C684
            - C685
            - C687
            - C688
            - C689
            - C690
            - C692
            - C700
            - C701
            - C710
            - C715
            - C990
            - D005
            - D008
            - D017
            - D018
            - D019
            - D020
            - D021
            - D022
            - D023
            - D024
            - E012
            - E013
            - E014
            - E017
            - E020
            - E990
            - I004
            - K020
            - K022
            - K025
            - K026
            - K027
            - K028
            - K029
            - K030
            - K031
            - L001
            - L079
            - L081
            - L082
            - L100
            - L116
            - L135
            - L136
            - L137
            - L138
            - L139
            - L142
            - L143
            - L144
            - L146
            - L147
            - L838
            - N002
            - N018
            - N235
            - N271
            - N337
            - N355
            - N703
            - N704
            - N705
            - N710
            - N714
            - N720
            - N722
            - N730
            - N740
            - N741
            - N750
            - N760
            - N785
            - N787
            - N820
            - N821
            - N822
            - N825
            - N851
            - N852
            - N853
            - N864
            - N934
            - N935
            - N952
            - N954
            - N955
            - N988
            - N990
            - U004
            - U005
            - U045
            - U048
            - U059
            - U062
            - U063
            - U067
            - U068
            - U069
            - U074
            - U075
            - U076
            - U077
            - U084
            - U088
            - U090
            - U091
            - U099
            - U101
            - U110
            - U111
            - U112
            - U113
            - U114
            - U115
            - U116
            - U117
            - U118
            - U119
            - U120
            - U121
            - U122
            - U161
            - U162
            - U163
            - U164
            - U165
            - U166
            - U167
            - U168
            - U169
            - U170
            - U171
            - U176
            - U177
            - U178
            - X001
            - X035
            - X060
            - X061
            - X062
            - X063
            - X064
            - X065
            - X066
            - X067
            - X068
            - X070
            - X071
            - X072
            - X802
            - X803
            - X804
            - X805
            - X806
            - X807
            - X808
            - X817
            - X819
            - X823
            - X824
            - X830
            - X831
            - X832
            - X834
            - X835
            - X836
            - X837
            - X839
            - X840
            - X842
            - X985
            - X990
            - X991
            - X992
            - X993
            - Y001
            - Y003
            - Y006
            - Y007
            - Y008
            - Y013
            - Y015
            - Y017
            - Y019
            - Y020
            - Y021
            - Y022
            - Y023
            - Y024
            - Y025
            - Y026
            - Y027
            - Y028
            - Y029
            - Y031
            - Y032
            - Y033
            - Y034
            - Y036
            - Y037
            - Y038
            - Y043
            - Y046
            - Y053
            - Y054
            - Y057
            - Y058
            - Y062
            - Y063
            - Y066
            - Y069
            - Y070
            - Y072
            - Y073
            - Y074
            - Y075
            - Y076
            - Y077
            - Y078
            - Y079
            - Y082
            - Y083
            - Y084
            - Y085
            - Y086
            - Y087
            - Y088
            - Y089
            - Y090
            - Y091
            - Y100
            - Y105
            - Y106
            - Y107
            - Y108
            - Y109
            - Y110
            - Y111
            - Y112
            - Y113
            - Y115
            - Y116
            - Y117
            - Y118
            - Y119
            - Y120
            - Y121
            - Y123
            - Y124
            - Y125
            - Y127
            - Y150
            - Y151
            - Y152
            - Y154
            - Y155
            - Y160
            - Y162
            - Y163
            - Y165
            - Y200
            - Y201
            - Y202
            - Y203
            - Y204
            - Y205
            - Y206
            - Y207
            - Y208
            - Y209
            - Y210
            - Y211
            - Y212
            - Y213
            - Y214
            - Y215
            - Y216
            - Y217
            - Y218
            - Y219
            - Y220
            - Y221
            - Y223
            - Y300
            - Y301
            - Y703
            - Y704
            - Y784
            - Y785
            - Y786
            - Y787
            - Y788
            - Y789
            - Y790
            - Y791
            - Y792
            - Y793
            - Y794
            - Y795
            - Y796
            - Y797
            - Y798
            - Y799
            - Y800
            - Y801
            - Y802
            - Y805
            - Y806
            - Y807
            - Y808
            - Y809
            - Y810
            - Y811
            - Y812
            - Y813
            - Y814
            - Y815
            - Y816
            - Y818
            - Y820
            - Y821
            - Y822
            - Y824
            - Y825
            - Y831
            - Y832
            - Y833
            - Y835
            - Y838
            - Y839
            - Y840
            - Y841
            - Y842
            - Y843
            - Y844
            - Y845
            - Y846
            - Y847
            - Y848
            - Y849
            - Y850
            - Y851
            - Y852
            - Y853
            - Y854
            - Y855
            - Y856
            - Y857
            - Y858
            - Y859
            - Y860
            - Y861
            - Y863
            - Y864
            - Y865
            - Y866
            - Y867
            - Y868
            - Y869
            - Y872
            - Y873
            - Y874
            - Y875
            - Y876
            - Y877
            - Y878
            - Y890
            - Y891
            - Y892
            - Y893
            - Y894
            - Y895
            - Y896
            - Y898
            - Y900
            - Y901
            - Y902
            - Y903
            - Y904
            - Y906
            - Y907
            - Y908
            - Y909
            - Y910
            - Y915
            - Y916
            - Y917
            - Y918
            - Y919
            - Y920
            - Y921
            - Y922
            - Y923
            - Y924
            - Y925
            - Y926
            - Y927
            - Y929
            - Y930
            - Y931
            - Y932
            - Y934
            - Y935
            - Y937
            - Y939
            - Y942
            - Y944
            - Y945
            - Y946
            - Y947
            - Y948
            - Y949
            - Y950
            - Y951
            - Y952
            - Y953
            - Y955
            - Y956
            - Y957
            - Y958
            - Y959
            - Y960
            - Y961
            - Y962
            - Y963
            - Y964
            - Y965
            - Y966
            - Y967
            - Y968
            - Y969
            - Y970
            - Y971
            - Y972
            - Y976
            - Y978
            - Y980
            - Y981
            - Y983
            - Y984
            - Y986
            - Y987
            - Y988
            - Y993
            - Y994
            - Y995
            - Y996
            - Y997
            - Y998
            - '2500'
            - '2501'
            - '2550'
            - '2551'
            - '2552'
            - '3000'
            - '3001'
            - '3002'
            - '3003'
            - '3004'
            - '3005'
            - '3006'
            - '3007'
            - '3008'
            - '3009'
            - '3012'
            - '3013'
            - '3014'
            - '3015'
            - '3016'
            - '3017'
            - '3018'
            - '3019'
            - '3020'
            - '3021'
            - '3022'
            - '3023'
            - '3024'
            - '3025'
            - '3026'
            - '3027'
            - '3028'
            - '3030'
            - '3034'
            - '3035'
            - '3036'
            - '3037'
            - '3038'
            - '3042'
            - '3043'
            - '3044'
            - '3045'
            - '3046'
            - '3047'
            - '3048'
            - '3049'
            - '3050'
            - '3051'
            - '3052'
            - '3053'
            - '3055'
            - '3056'
            - '3057'
            - '3058'
            - '3060'
            - '3062'
            - '3064'
            - '3065'
            - '3066'
            - '3067'
            - '3068'
            - '3069'
            - '3070'
            - '3071'
            - '3072'
            - '3073'
            - '3074'
            - '3075'
            - '3076'
            - '3077'
            - '3078'
            - '3079'
            - '3080'
            - '3081'
            - '3082'
            - '3083'
            - '3084'
            - '3085'
            - '3086'
            - '3087'
            - '3088'
            - '3089'
            - '3090'
            - '3091'
            - '3092'
            - '3093'
            - '3101'
            - '3102'
            - '3103'
            - '3104'
            - '3105'
            - '3106'
            - '3107'
            - '3108'
            - '3109'
            - '3110'
            - '3111'
            - '3112'
            - '3113'
            - '3114'
            - '3115'
            - '3116'
            - '3117'
            - '3118'
            - '3119'
            - '3120'
            - '3121'
            - '3122'
            - '3200'
            - '3202'
            - '3203'
            - '3204'
            - '3205'
            - '3249'
            - '3500'
            - '3501'
            - '3601'
            - '3602'
            - '3603'
            - '3999'
            - '4008'
            - '4010'
            - '4011'
            - '4013'
            - '4023'
            - '4040'
            - '4041'
            - '4042'
            - '4043'
            - '4044'
            - '4045'
            - '4046'
            - '4047'
            - '4048'
            - '4049'
            - '4050'
            - '4051'
            - '4052'
            - '4053'
            - '4054'
            - '4055'
            - '4056'
            - '4057'
            - '4058'
            - '4059'
            - '4060'
            - '4061'
            - '4062'
            - '4071'
            - '4098'
            - '4099'
            - '4114'
            - '4115'
            - '4116'
            - '4117'
            - '4118'
            - '4200'
            - '4201'
            - '4202'
            - '4203'
            - '4204'
            - '4205'
            - '4206'
            - '4207'
            - '4208'
            - '4209'
            - '4210'
            - '4211'
            - '4212'
            - '4901'
            - '4999'
            - '8005'
            - '8009'
            - '8042'
            - '8044'
            - '8045'
            - '8046'
            - '8047'
            - '8053'
            - '8054'
            - '8062'
            - '8065'
            - '8066'
            - '8068'
            - '8069'
            - '8071'
            - '8073'
            - '8075'
            - '8078'
            - '8079'
            - '8080'
            - '8081'
            - '8082'
            - '8083'
            - '8084'
            - '8085'
            - '8088'
            - '8091'
            - '8092'
            - '8099'
            - '8107'
            - '8108'
            - '8116'
            - '8117'
            - '8121'
            - '8132'
            - '8142'
            - '8150'
            - '8152'
            - '8160'
            - '8161'
            - '8162'
            - '8163'
            - '8164'
            - '8165'
            - '8172'
            - '8173'
            - '8175'
            - '8176'
            - '8180'
            - '8186'
            - '8190'
            - '8191'
            - '8198'
            - '8199'
            - '8205'
            - '8208'
            - '8209'
            - '8212'
            - '8215'
            - '8216'
            - '8230'
            - '8234'
            - '8237'
            - '8240'
            - '8241'
            - '8243'
            - '8246'
            - '8260'
            - '8277'
            - '8281'
            - '8288'
            - '8296'
            - '8299'
            - '8301'
            - '8305'
            - '8313'
            - '8315'
            - '8318'
            - '8319'
            - '8320'
            - '8326'
            - '8328'
            - '8330'
            - '8399'
            - '8423'
            - '8456'
            - '8463'
            - '8482'
            - '8489'
            - '8490'
            - '8491'
            - '8519'
            - '8522'
            - '8523'
            - '8524'
            - '8550'
            - '8604'
            - '8605'
            - '8609'
            - '8612'
            - '8624'
            - '8646'
            - '8647'
            - '8648'
            - '8649'
            - '8650'
            - '8651'
            - '8652'
            - '8653'
            - '8654'
            - '8682'
            - '8718'
            - '8720'
            - '8721'
            - '8722'
            - '8729'
            - '8730'
            - '8731'
            - '8734'
            - '8748'
            - '8749'
            - '8750'
            - '8767'
            - '8768'
            - '8795'
            - '8796'
            - '8797'
            - '8798'
            - '8799'
            - '8800'
            - '8801'
            - '8807'
            - '8808'
            - '8809'
            - '8810'
            - '8811'
            - '8812'
            - '8813'
            - '8814'
            - '8816'
            - '8817'
            - '8827'
            - '8828'
            - '8829'
            - '8830'
            - '8831'
            - '8832'
            - '8833'
            - '8835'
            - '8836'
            - '8837'
            - '8843'
            - '8846'
            - '8853'
            - '8854'
            - '8855'
            - '8856'
            - '8857'
            - '8858'
            - '8875'
            - '8879'
            - '8882'
            - '8884'
            - '8885'
            - '8886'
            - '8887'
            - '8888'
            - '8889'
            - '8890'
            - '8891'
            - '8894'
            - '8900'
            - '8907'
            - '8909'
            - '8919'
            - '8929'
            - '8930'
            - '8931'
            - '8933'
            - '8934'
            - '8935'
            - '8936'
            - '8943'
            - '8973'
            - '8979'
            - '8981'
            - '8983'
            - '8999'
          description: Type of the document.
        number:
          type: string
          description: Reference number stated on the document. E.g. an invoice number.
        issueDate:
          type: string
          minLength: 1
          description: Date of issuance, in the format dd-mm-yyyy
        dataBase64:
          type: string
          minLength: 1
          description: Base64 encoded data of the document file.
        filename:
          type: string
          minLength: 1
          description: Name of the file.
        mimeType:
          type: string
          minLength: 1
          description: MIME type of the file, e.g. "application/pdf".
      required:
        - documentType
        - number
        - issueDate
        - dataBase64
        - filename
        - mimeType
      additionalProperties: false
    GoodsDocument:
      type: object
      properties:
        number:
          type: string
          description: Reference number stated on the document. E.g. an invoice number.
        issueDate:
          type: string
          minLength: 1
          description: Date of issuance, in the format dd-mm-yyyy
        dataBase64:
          type: string
          minLength: 1
          description: Base64 encoded data of the document file.
        filename:
          type: string
          minLength: 1
          description: Name of the file.
        mimeType:
          type: string
          minLength: 1
          description: MIME type of the file, e.g. "application/pdf".
        expiryDate:
          type: string
          pattern: ^\d{2}-\d{2}-\d{4}$
          description: >-
            DMS export and import only. Expiry date of the document, in the
            format dd-mm-yyyy.
        lineNumber:
          type: integer
          minimum: 1
          maximum: 99999
          description: >-
            DMS export and import only. Line of the document this goods item
            refers to.
        submitter:
          type: string
          minLength: 1
          maxLength: 70
          description: >-
            DMS export and import only. Name of who issued or submitted the
            document.
        writeOffQuantity:
          type: number
          minimum: 0
          description: >-
            DMS export and import only. Quantity written off on the document,
            with writeOffQuantityUnit.
        writeOffQuantityUnit:
          type: string
          minLength: 1
          maxLength: 4
          description: >-
            DMS export and import only. Unit of the written-off quantity
            (codelist 349), e.g. KGM.
        writeOffAmount:
          type: number
          minimum: 0
          description: >-
            DMS export and import only. Amount written off on the document, with
            writeOffCurrency.
        writeOffCurrency:
          type: string
          pattern: ^[A-Z]{3}$
          description: >-
            DMS export and import only. Currency of the written-off amount (ISO
            4217).
      required:
        - number
        - issueDate
        - dataBase64
        - filename
        - mimeType
      additionalProperties: false
    GoodSupportingDocument:
      type: object
      properties:
        expiryDate:
          $ref: '#/components/schemas/GoodsDocument/properties/expiryDate'
        lineNumber:
          $ref: '#/components/schemas/GoodsDocument/properties/lineNumber'
        submitter:
          $ref: '#/components/schemas/GoodsDocument/properties/submitter'
        writeOffQuantity:
          $ref: '#/components/schemas/GoodsDocument/properties/writeOffQuantity'
        writeOffQuantityUnit:
          $ref: '#/components/schemas/GoodsDocument/properties/writeOffQuantityUnit'
        writeOffAmount:
          $ref: '#/components/schemas/GoodsDocument/properties/writeOffAmount'
        writeOffCurrency:
          $ref: '#/components/schemas/GoodsDocument/properties/writeOffCurrency'
        type:
          type: string
          pattern: ^[A-Z0-9]{4}$
          description: Document type (codelist 213).
        number:
          type: string
          minLength: 1
          maxLength: 70
          description: Document number.
      required:
        - type
        - number
      additionalProperties: false
    GoodPreviousDocument:
      type: object
      properties:
        type:
          type: string
          pattern: ^[A-Z0-9]{4}$
          description: Document type (codelist 214).
        number:
          type: string
          minLength: 1
          maxLength: 70
          description: Document number.
        lineNumber:
          type: integer
          minimum: 1
          maximum: 99999
          description: >-
            Line number on the previous document. Customs can require it, e.g.
            DMS255AA.
      required:
        - type
        - number
      additionalProperties: false
    Dms:
      type: object
      properties:
        transportDocuments:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]{4}$
                description: Document type (4 characters).
              number:
                type: string
                minLength: 1
                maxLength: 70
                description: Document number.
            required:
              - type
              - number
            additionalProperties: false
          maxItems: 99
          description: Transport documents (codelist 754), e.g. N730 CMR.
        previousDocuments:
          type: array
          items:
            $ref: '#/components/schemas/Dms/properties/transportDocuments/items'
          maxItems: 99
          description: Previous documents of the shipment (codelist 214).
        additionalReferences:
          type: array
          items:
            type: object
            properties:
              type:
                $ref: >-
                  #/components/schemas/Dms/properties/transportDocuments/items/properties/type
              number:
                type: string
                minLength: 1
                maxLength: 70
                description: Document number.
            required:
              - type
            additionalProperties: false
          maxItems: 99
          description: Additional references of the shipment (codelist 380).
        additionalInformation:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                pattern: ^[A-Z0-9]{5}$
                description: Additional statement code (codelist 239).
              text:
                type: string
                minLength: 1
                maxLength: 512
                description: Statement text.
            required:
              - code
            additionalProperties: false
          maxItems: 99
          description: Additional information of the shipment (codelist 239).
        authorisations:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]{4}$
                description: Authorisation type.
              number:
                type: string
                minLength: 1
                maxLength: 35
                description: Authorisation (decision) reference number.
              holder:
                type: string
                minLength: 1
                maxLength: 17
                description: EORI of the authorisation holder.
            required:
              - type
              - number
            additionalProperties: false
          maxItems: 99
          description: >-
            Authorisations (codelist 605), sent next to the ones QuayConnect
            sends (e.g. the DPO).
        aeoParties:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                pattern: ^[A-Z]{1,3}$
                description: Role of the party (codelist 704).
              eori:
                type: string
                minLength: 1
                maxLength: 17
                description: Identification (EORI or AEO number) of the party.
            required:
              - role
              - eori
            additionalProperties: false
          maxItems: 99
          description: >-
            Additional supply chain actors (AEO mutual recognition, codelist
            704).
        routingCountries:
          type: array
          items:
            type: string
            pattern: ^[A-Z]{2}$
          maxItems: 99
          description: Export only. Countries of routing, in order (codelist 008).
        transportChargesPaymentMethod:
          type: string
          pattern: ^[A-Z]$
          description: Export only. Transport charges method of payment (codelist 116).
        declarantContact:
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 70
              description: Name of the contact person.
            phone:
              type: string
              minLength: 1
              maxLength: 256
              description: Phone number.
            email:
              type: string
              minLength: 1
              maxLength: 256
              description: E-mail address.
          required:
            - name
            - phone
            - email
          additionalProperties: false
          description: Contact person of the declarant.
        agentContact:
          $ref: '#/components/schemas/Dms/properties/declarantContact'
          description: Contact person of the representative.
        declarant:
          type: object
          properties:
            eori:
              type: string
              minLength: 1
              maxLength: 17
              description: EORI of the declarant, e.g. NL859623762.
          required:
            - eori
          additionalProperties: false
          description: >-
            The declarant (Declaration/Declarant). Left out, the consignee
            (import) or consignor (export). When it is the EORI of your
            connection (declarantEORI), no representative is sent: you declare
            in your own name.
        obligationGuarantees:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]$
                description: Security details, the type of guarantee (codelist 251).
              references:
                type: array
                items:
                  type: object
                  properties:
                    grn:
                      type: string
                      minLength: 1
                      maxLength: 35
                      description: Guarantee reference number (GRN).
                    reference:
                      type: string
                      minLength: 1
                      maxLength: 24
                      description: Other guarantee reference, when there is no GRN.
                    accessCode:
                      type: string
                      minLength: 1
                      maxLength: 4
                      description: Access code of the guarantee.
                    amount:
                      type: number
                      minimum: 0
                      description: Amount of the guarantee, with currency.
                    currency:
                      type: string
                      pattern: ^[A-Z]{3}$
                      description: Currency of the amount (ISO 4217).
                    office:
                      type: string
                      pattern: ^[A-Z]{2}[A-Z0-9]{6}$
                      description: Customs office of guarantee (codelist 141).
                  required:
                    - amount
                    - currency
                  additionalProperties: false
                minItems: 1
                maxItems: 99
            required:
              - type
              - references
            additionalProperties: false
          maxItems: 99
          description: >-
            Import only. Guarantees of the obligation. Required for procedures
            44, 46, 48, 53 and for 51 with a previous procedure other than 11;
            not allowed for the other procedures.
        surety:
          type: string
          minLength: 1
          maxLength: 17
          description: >-
            Import only. EORI of the surety. It must differ from the EORI of the
            declarant.
        payer:
          type: string
          minLength: 1
          maxLength: 17
          description: >-
            Import only. EORI of the party that pays the duties and taxes
            (Declaration/Payer). Left out, the declarant pays.
        representative:
          type: object
          properties:
            eori:
              type: string
              minLength: 1
              maxLength: 17
              description: >-
                EORI of the representative. Left out, the declarantEORI of the
                service.
            status:
              type: string
              enum:
                - '2'
                - '3'
              description: >-
                Status of the representative: 2 direct, 3 indirect
                representation. The Customs test system refuses 3 without a
                presentation notification (MIG v1.50 rule IR9017), which
                QuayConnect does not send.
          required:
            - status
          additionalProperties: false
          description: >-
            The customs representative (Declaration/Agent). Left out, the
            declarant is a direct representative (2).
        language:
          type: string
          enum:
            - EN
            - NL
          description: Import only. Language of the declaration. Left out, NL.
        additionalDeclarationType:
          type: string
          enum:
            - A
            - B
            - C
            - D
            - E
            - F
            - X
            - 'Y'
            - Z
          description: >-
            Additional declaration type (codelist 042), e.g. A standard or B
            simplified. Left out, A. B, C, E and F need a statement in
            dms.additionalInformation with a code starting with NRV (Customs
            rule IR9020).
        transactionNature:
          type: string
          pattern: ^\d{1,2}$
          description: Nature of transaction (codelist 044), e.g. 32. Left out, 11.
        tradeTermsDescription:
          type: string
          minLength: 1
          maxLength: 512
          description: Description of the delivery terms, e.g. when the incoterm is XXX.
        goodsLocation:
          type: object
          properties:
            postalCode:
              type: string
              minLength: 1
              maxLength: 17
              description: Postal code
            houseNumber:
              type: string
              minLength: 1
              maxLength: 35
              description: House number
            country:
              type: string
              pattern: ^[A-Z]{2}$
              description: 2-letter country code, e.g. NL
            latitude:
              type: string
              maxLength: 17
              pattern: ^[+-]?([0-8]?[0-9]\.[0-9]{5,7}|90\.000000?0?)$
              description: >-
                GNSS latitude (decimal degrees, 5 to 7 decimals), with the other
                coordinate instead of the postal code and house number.
            longitude:
              type: string
              maxLength: 17
              pattern: ^[+-]?((0?[0-9]?|1[0-7])[0-9]\.[0-9]{5,7}|180\.000000?0?)$
              description: >-
                GNSS longitude (decimal degrees, 5 to 7 decimals), with the
                other coordinate instead of the postal code and house number.
          required:
            - country
          additionalProperties: false
          description: >-
            Location of the goods by address (postal code and house number) or
            by GNSS (latitude and longitude). Left out, QuayConnect takes the
            address of the place of loading (export) or the place of delivery
            (import).
        dutyTaxParties:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
                maxLength: 17
                description: >-
                  Fiscal reference of the party, e.g. its VAT number; not
                  limited to an EORI. It must be known to Customs.
              role:
                type: string
                pattern: ^[A-Z0-9]{3}$
                description: Role of the party (codelist 149).
            required:
              - id
              - role
            additionalProperties: false
          maxItems: 99
          description: >-
            Import only. Parties liable for duties and taxes. Required with
            additional procedure F48, not allowed with F49 and F53.
      additionalProperties: false
      description: >-
        DMS export and import only. Declaration data with no other field in the
        shipment (MIG DMS v1.50).
    AdditionalPackaging:
      type: object
      properties:
        quantity:
          type: integer
        quantityUnit:
          type: string
          minLength: 2
          maxLength: 2
        marks:
          type: string
      required:
        - quantity
        - quantityUnit
      additionalProperties: false
    GoodsItem:
      type: object
      properties:
        productCode:
          type: string
          description: >-
            Unique product code referring to a product managed in the
            QuayConnect application. This can be used to fill in details that
            are not available in your current system and can be setup through
            the UI at onboarding.

            If this field is specified, 'description', 'commodityCode',
            'countryOfOrigin' and any other fields defined in this product can
            be omitted.

            A sensible code to use might be the article or product code stored
            in your ERP system for this goods item.
        netWeight:
          type: number
          exclusiveMinimum: true
          minimum: 0
          exclusiveMaximum: true
          maximum: 999999
          description: Net weight of this item in kg
        grossWeight:
          type: number
          exclusiveMinimum: true
          minimum: 0
          exclusiveMaximum: true
          maximum: 999999
          description: Gross weight of this item in kg
        description:
          type: string
          minLength: 1
          maxLength: 255
          description: Short description of the goods, as listed on the invoice.
        commodityCode:
          type: string
          minLength: 8
          description: 8 or 10-digit TARIC code
        countryOfOrigin:
          type: string
          description: >-
            Country of origin of the goods, 2-letter code. Required for DMS
            import (Customs needs it).
        value:
          type: number
          exclusiveMinimum: true
          minimum: 0
          exclusiveMaximum: true
          maximum: 999999
          description: Total value of this item as stated on the invoice
        valueCurrency:
          type: string
          minLength: 3
          maxLength: 3
          description: Currency of the invoice
        packagingQuantity:
          type: number
          minimum: 0
          exclusiveMaximum: true
          maximum: 999999
          description: >-
            Quantity of the smallest external package. This is defined as the
            one in which the goods are packaged in such a way that they cannot
            be divided without first undoing the packaging.
        packagingQuantityUnit:
          type: string
          minLength: 2
          maxLength: 2
          description: Package code list provided separately
        packagingMarks:
          type: string
          maxLength: 255
          description: Any marks on the outside of the packaging.
        eppoCode:
          anyOf:
            - anyOf:
                - not: {}
                - type: string
                  minLength: 5
                  maxLength: 5
            - anyOf:
                - not: {}
                - type: string
                  minLength: 6
                  maxLength: 6
        species:
          type: string
          description: >-
            Genus/species, latin name of the goods. Required for phytosanitary
            notification of certain goods
        class:
          type: string
        variety:
          type: string
          description: >-
            Varity of a phytosanitary good. Required for phytosanitary
            notification of certain goods
        valuationMethod:
          type: string
          enum:
            - Forfait
            - UnitPrice
            - Value
        supplementaryUnits:
          type: number
        supplementaryUnitsType:
          type: string
          enum:
            - pieces
            - kilograms
            - liters
        additionalPackaging:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalPackaging'
        previousDocumentLineNumber:
          type: integer
          description: >-
            The line number on the previous document, if attached, that refers
            to this goods item.
        documents:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/GoodsDocument'
          description: >-
            Additional licenses, certificates and previous documents that apply
            to this line item, keyed by document type. The properties are mapped
            as follows:

            conformity -> N002

            phyto -> N851

            t1 -> T1 Transit Document

            cw -> Customs Warehouse entry number

            bl -> Bill of Lading
        container:
          type: string
        dutyPreference:
          type: string
          enum:
            - '100'
            - '110'
            - '119'
            - '120'
            - '200'
            - '300'
            - '310'
            - '320'
            - '400'
            - '420'
        chargeDeduction:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - freight
                  - insurance
                description: >-
                  Type of charge or deduction to be added to the goods value
                  (sent as AK). Give this or code.
              code:
                type: string
                pattern: ^[A-Z]{2}$
                description: >-
                  DMS import: the charge or deduction code (codelist 791), e.g.
                  BA. Used instead of type.
              amount:
                type: number
                description: Amount of the charge or deduction
              currency:
                type: string
                description: Currency of the charge or deduction
            required:
              - amount
              - currency
            additionalProperties: false
        valuationIndicator:
          type: string
          pattern: ^\d{4}$
          description: >-
            DMS import only. Valuation indicators (4 digits), e.g. 1000. Left
            out, QuayConnect sends 0000.
        customsValuationMethod:
          type: string
          pattern: ^[1-6]$
          description: >-
            DMS import only. Valuation method (1 to 6). Left out, QuayConnect
            sends 1.
        statisticalValue:
          type: number
          minimum: 0
          description: >-
            DMS export and import. Statistical value of the line item in euro.
            Left out, QuayConnect sends the line value (export: converted to
            euro).
        referenceNumber:
          type: string
          minLength: 1
          maxLength: 35
          description: >-
            DMS export and import. Reference (UCR) of this line item. The same
            on every line is sent once for the shipment.
        transactionNature:
          type: string
          pattern: ^\d{1,2}$
          description: >-
            DMS export and import. Nature of transaction (codelist 044) of this
            line item, when the lines differ. Lines without it take
            dms.transactionNature (or 11).
        transportChargesPaymentMethod:
          type: string
          pattern: ^[A-Z]$
          description: >-
            DMS export only. Method of payment for transport charges (codelist
            116) of this line item, when the lines differ. Lines without it take
            dms.transportChargesPaymentMethod.
        preferentialOriginCountry:
          type: string
          pattern: ^[A-Z]{2}$
          description: >-
            DMS import only. Country of preferential origin, when it differs
            from countryOfOrigin. Sent with a preference (dutyPreference) of 200
            or higher.
        dangerousGoods:
          type: array
          items:
            type: object
            properties:
              unNumber:
                type: string
                pattern: ^\d{4}$
                description: UN number of the dangerous goods (4 digits).
            required:
              - unNumber
            additionalProperties: false
          maxItems: 99
          description: >-
            Transit only: dangerous goods carried by this line item (UN numbers,
            codelist 101).
        transitDepartureTransportMeans:
          type: array
          items:
            type: object
            properties:
              identificationType:
                type: string
                pattern: ^[0-9]{2}$
                description: Type of identification (codelist 750).
              identificationNumber:
                type: string
                minLength: 1
                maxLength: 35
                description: Identification of the means of transport.
              nationality:
                type: string
                minLength: 2
                maxLength: 2
                description: Nationality (codelist 165).
            required:
              - identificationType
              - identificationNumber
              - nationality
            additionalProperties: false
          maxItems: 999
          description: >-
            Transit only. Means of transport at departure for this good (max
            999). They replace the vehicle of the voyage: then every good needs
            its own.
        transitTransportChargesPaymentMethod:
          type: string
          pattern: ^[A-Z]$
          description: >-
            Transit only. Transport charges method of payment for this good
            (codelist 116). Give it per good or on transit, not both.
        transitDocuments:
          $ref: '#/components/schemas/TransitItemDocuments'
          description: Transit only. Documents, references and information of this good.
        transitConsignor:
          $ref: '#/components/schemas/TransitParty'
          description: >-
            Transit only. Consignor of this good. Other goods keep the consignor
            of the shipment.
        transitConsignee:
          $ref: '#/components/schemas/TransitParty'
          description: >-
            Transit only. Consignee of this good. Other goods keep the consignee
            of the shipment.
        transitAdditionalSupplyChainActors:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                minLength: 1
                maxLength: 3
                description: Role (codelist 704).
              identificationNumber:
                type: string
                minLength: 1
                maxLength: 17
                description: EORI of the actor.
            required:
              - role
              - identificationNumber
            additionalProperties: false
          maxItems: 99
          description: Transit only. Additional supply chain actors of this good (max 99).
        transitCountryOfDispatch:
          type: string
          minLength: 2
          maxLength: 2
          description: >-
            Transit only: country of dispatch (ISO alpha-2) for this line item,
            when it differs from the declaration.
        transitCountryOfDestination:
          type: string
          minLength: 2
          maxLength: 2
          description: >-
            Transit only: country of destination (ISO alpha-2) for this line
            item, when it differs from the declaration.
        transitReferenceNumberUCR:
          type: string
          maxLength: 35
          description: >-
            Transit only: UCR for this line item, when it differs from the
            declaration.
        transitDeclarationType:
          type: string
          enum:
            - T1
            - T2
            - T2F
            - T2SM
          description: >-
            Transit only: declaration type of this good (codelist 232), required
            on every good of a mixed T declaration (transit.declarationType "T")
            and not allowed otherwise.
        procedure:
          type: object
          properties:
            current:
              type: string
              pattern: ^\d{2}$
              description: Requested procedure (codelist 092).
            previous:
              type: string
              pattern: ^\d{2}$
              description: Previous procedure (codelist 093). Default 00.
            additional:
              type: array
              items:
                type: string
                pattern: ^[A-Z0-9]{3}$
              maxItems: 99
              description: Additional procedures (codelist 102), at most 99.
          additionalProperties: false
          description: >-
            DMS export and import only. The procedure of this line item. Left
            out, QuayConnect sends 10 00 for export and 40 00 (B4: 10 00 F75,
            H5: 40 00 F15) for import. Export allows 10, 11, 23, 31, 21, 22, 76,
            77; import allows 40, 42, 61, 63, 01, 07, 43, 44, 45, 46, 48, 68,
            71, 53, 51, 95, 96.
        cusCode:
          type: string
          minLength: 9
          maxLength: 9
          description: >-
            DMS export, DMS import and DVA departure. CUS code of the chemical
            (9 characters).
        taricAdditionalCodes:
          type: array
          items:
            type: string
            pattern: ^[A-Z0-9]{4}$
          maxItems: 99
          description: >-
            DMS export and import only. TARIC additional codes (4 characters),
            at most 99.
        nationalAdditionalCodes:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 4
          maxItems: 99
          description: >-
            DMS export and import only. National additional codes (up to 4
            characters), at most 99.
        strategicGoodsCodes:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 10
          maxItems: 9
          description: >-
            DMS export and import only. Strategic goods codes (up to 10
            characters), at most 9.
        upuCode:
          type: string
          minLength: 1
          maxLength: 3
          description: >-
            DMS export and import only. UPU item nature code (up to 3
            characters).
        quotaOrder:
          type: string
          minLength: 1
          maxLength: 6
          description: DMS import only. Quota order number of this line item.
        dutyTaxFees:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                pattern: ^[A-Z0-9]{3}$
                description: >-
                  Type of duty or tax (codelist 098): A00 customs duty, B00 VAT,
                  etc.
              taxBase:
                type: number
                minimum: 0
                description: >-
                  Tax base amount. For A00 the customs value; for B00 the
                  additional costs.
              taxRate:
                type: number
                minimum: 0
                description: Tax rate.
              paymentMethod:
                type: string
                pattern: ^[A-Z]$
                description: Method of payment (codelist 104). With payableAmount.
              payableAmount:
                type: number
                minimum: 0
                description: >-
                  Payable amount in EUR; 0 is valid (e.g. VAT postponed under
                  article 23). With paymentMethod.
            required:
              - type
            additionalProperties: false
          maxItems: 99
          description: >-
            DMS import only. Duties and taxes the declarant states for this line
            item, e.g. when there is no DPO. Include A00 (a duty type once per
            line item). VAT postponed under article 23: B00 with taxBase 0 and
            payableAmount 0.
        additionalReferences:
          type: array
          items:
            $ref: '#/components/schemas/Dms/properties/additionalReferences/items'
          maxItems: 99
          description: >-
            DMS export and import only. Additional references of this line item
            (codelist 380).
        additionalInformation:
          type: array
          items:
            $ref: '#/components/schemas/Dms/properties/additionalInformation/items'
          maxItems: 99
          description: >-
            DMS export and import only. Additional information of this line item
            (codelist 239).
        authorisations:
          type: array
          items:
            $ref: '#/components/schemas/Dms/properties/authorisations/items'
          maxItems: 99
          description: >-
            DMS export and import only. Authorisations of this line item
            (codelist 615).
        aeoParties:
          type: array
          items:
            $ref: '#/components/schemas/Dms/properties/aeoParties/items'
          maxItems: 99
          description: >-
            DMS export and import only. Additional supply chain actors of this
            line item (codelist 704).
        transportDocuments:
          type: array
          items:
            $ref: '#/components/schemas/Dms/properties/transportDocuments/items'
          maxItems: 99
          description: >-
            DMS import only. Transport documents of this line item (codelist
            754).
        previousDocumentType:
          type: string
          minLength: 1
          maxLength: 4
          description: >-
            DMS import only. Previous document type of this line item (DMS
            codelist 214), with previousDocumentNumber. For export use
            previousDocuments.
        previousDocumentNumber:
          type: string
          minLength: 1
          maxLength: 70
          description: >-
            Previous document number of this line item, with
            previousDocumentType.
        previousDocuments:
          type: array
          items:
            $ref: '#/components/schemas/GoodPreviousDocument'
          maxItems: 99
          description: >-
            DMS export and import only. Previous documents of this line item
            (max 99, also counting previousDocumentType).
        supportingDocuments:
          type: array
          items:
            $ref: '#/components/schemas/GoodSupportingDocument'
          maxItems: 99
          description: >-
            DMS export and import only. Supporting documents without a file (max
            99, also counting documents). Several of one type are allowed.
        consignor:
          $ref: '#/components/schemas/PartyCodeOrDetails'
          description: >-
            DMS export only. Consignor of this line item, when it differs from
            the shipment.
        consignee:
          $ref: '#/components/schemas/PartyCodeOrDetails'
          description: >-
            DMS export only. Consignee of this line item, when it differs from
            the shipment.
        buyer:
          $ref: '#/components/schemas/PartyCodeOrDetails'
          description: >-
            DMS import only. Buyer of this line item, when it differs from the
            shipment.
        seller:
          $ref: '#/components/schemas/PartyCodeOrDetails'
          description: >-
            DMS import only. Seller of this line item, when it differs from the
            shipment.
        exporter:
          $ref: '#/components/schemas/PartyCodeOrDetails'
          description: >-
            DMS import only. Exporter of this line item, when it differs from
            the shipment.
      required:
        - netWeight
        - grossWeight
        - value
        - packagingQuantity
        - packagingQuantityUnit
      additionalProperties: true
    ShipmentData:
      type: object
      properties:
        shipmentReference:
          type: string
          description: >-
            Unique reference number for this shipment / consignment, e.g.
            invoice reference.
        voyageReference:
          type: string
          description: |2-
             Unique reference for the voyage/truck/container, e.g. transport order id
                or trailer license plate can be used to group several consignments under
                a single trip.
        shipmentType:
          type: string
          enum:
            - FCL
            - LCL
            - FTL
            - LTL
          description: |2-

                FCL = Full Container Load
                LCL = Less than Container Load
                FTL = Full Truck Load
                LTL = Less than Truck Load

                Export: required
                Import: required
        voyage:
          $ref: '#/components/schemas/Voyage'
        transit:
          $ref: '#/components/schemas/Transit'
          description: >-
            Per-declaration NCTS/IE015 (DVA Departure) transit data. Required
            for transit declarations; left out entirely for export/import.
        transitArrival:
          $ref: '#/components/schemas/TransitArrival'
          description: >-
            NCTS/IE007 (DVA Arrival) arrival notification data. Required for the
            transit arrival service; left out otherwise.
        dms:
          $ref: '#/components/schemas/Dms'
          description: >-
            DMS export and import only. Declaration data with no other field in
            the shipment (MIG DMS v1.50).
        valuation:
          $ref: '#/components/schemas/Valuation'
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
        parties:
          type: object
          properties:
            haulier:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            consignor:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            consignee:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            seller:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            buyer:
              $ref: '#/components/schemas/PartyCodeOrDetails'
          required:
            - consignor
            - consignee
          additionalProperties: false
        goods:
          type: array
          items:
            $ref: '#/components/schemas/GoodsItem'
          minItems: 1
          description: >-
            Goods shipped in this shipment. As mentioned on the respecive
            invoice.
      required:
        - shipmentReference
        - shipmentType
        - voyage
        - valuation
        - documents
        - parties
        - goods
      additionalProperties: false
    PartialShipmentData:
      type: object
      properties:
        shipmentReference:
          type: string
          description: >-
            Unique reference number for this shipment / consignment, e.g.
            invoice reference.
        voyageReference:
          type: string
          description: |2-
             Unique reference for the voyage/truck/container, e.g. transport order id
                or trailer license plate can be used to group several consignments under
                a single trip.
        shipmentType:
          type: string
          enum:
            - FCL
            - LCL
            - FTL
            - LTL
          description: |2-

                FCL = Full Container Load
                LCL = Less than Container Load
                FTL = Full Truck Load
                LTL = Less than Truck Load

                Export: required
                Import: required
        voyage:
          $ref: '#/components/schemas/Voyage'
        transit:
          $ref: '#/components/schemas/Transit'
        transitArrival:
          $ref: '#/components/schemas/TransitArrival'
        dms:
          $ref: '#/components/schemas/Dms'
          description: >-
            DMS export and import only. Declaration data with no other field in
            the shipment (MIG DMS v1.50).
        valuation:
          $ref: '#/components/schemas/Valuation'
        parties:
          type: object
          properties:
            haulier:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            consignor:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            consignee:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            seller:
              $ref: '#/components/schemas/PartyCodeOrDetails'
            buyer:
              $ref: '#/components/schemas/PartyCodeOrDetails'
          additionalProperties: false
        goods:
          type: array
          items:
            $ref: '#/components/schemas/GoodsItem'
          minItems: 1
          description: >-
            Goods shipped in this shipment. As mentioned on the respecive
            invoice.
      additionalProperties: false
    NewShipmentRequest:
      type: object
      properties:
        autoFinalize:
          type: boolean
          description: >-
            If false, this means that the shipment is not automatically
            submitted after creation. If using these options, the shipment needs
            to be finalized by calling the 'POST
            /shipments/:shipmentId/finalize' endpoint.
        onBehalf:
          type: string
          description: Submit the shipment onbeahlf of another organisation
        services:
          type: array
          items:
            $ref: '#/components/schemas/ServiceDefinition'
        payload:
          $ref: '#/components/schemas/ShipmentData'
      required:
        - services
        - payload
      additionalProperties: false
    NewPartialShipmentRequest:
      type: object
      properties:
        onBehalf:
          type: string
          description: Submit the shipment on behalf of another organisation.
        payload:
          $ref: '#/components/schemas/PartialShipmentData'
      additionalProperties: false
    NewShipmentResponse:
      type: object
      properties:
        shipmentId:
          type: string
      required:
        - shipmentId
      additionalProperties: false
    OperationStatusResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - failure
      required:
        - status
      additionalProperties: false
    ValidationErrorSchema:
      type: object
      properties:
        code:
          type: string
          enum:
            - custom
            - invalid_type
            - unrecognized_keys
            - invalid_union_discriminator
            - invalid_arguments
            - invalid_return_type
            - invalid_intersection_types
            - invalid_union
            - invalid_enum_value
            - invalid_date
            - invalid_literal
            - invalid_string
            - too_small
            - too_big
            - not_multiple_of
            - conflict
            - invalid_party
            - invalid_location
            - invalid_commodity
            - logic
            - invalid_product
            - invalid_shipment
            - invalid_service
            - invalid_unlocode
            - failed_service
            - parser
            - syntax
            - service
            - invalid_document
            - invalid_enumeration
            - missing_key
            - missing_document
        path:
          type: array
          description: >-
            Path to the data element in the request. Array indexes are indicated
            with numbers, data fields are provided by field name.
        message:
          type: string
          description: Explanation of the error
        resourceId:
          type: string
        locationCode:
          type: string
        productCode:
          type: string
        unlocode:
          type: string
        partyCode:
          type: string
        errorCode:
          anyOf:
            - type: string
            - type: number
          description: >-
            Customs' own error code, when Customs refused the declaration, e.g.
            DMS459AB.
        originalMessage:
          type: string
          description: Customs' own error text (Dutch), e.g. ONGELDIGE WAARDE GEBRUIKT.
        originalPath:
          type: array
          description: >-
            Where in the Customs message the error is, e.g. ["Declaration",
            "Agent", "FunctionCode"].
        originalAttributeValue:
          type: string
          description: >-
            Customs' detail on the error, when it gives one, e.g.
            MISSING_COUNTRY_OF_PREFERENTIAL_ORIGIN (code '235').
      required:
        - code
        - path
        - message
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorSchema'
      required:
        - code
      additionalProperties: false
    ValidationErrorArraySchema:
      type: array
      items:
        $ref: '#/components/schemas/ValidationErrorSchema'
    UnloadingGoodsItem:
      type: object
      properties:
        houseConsignment:
          type: string
          description: Sequence number of the house consignment.
        goodsItemNumber:
          type: string
          description: Goods item number within the house consignment.
        declarationGoodsItemNumber:
          type: string
          description: Goods item number within the declaration.
        description:
          type: string
          description: Description of the goods.
        commodityCode:
          type: string
          description: Commodity code (HS subheading and combined nomenclature).
        grossMass:
          type: string
          description: Gross mass in kg.
        netMass:
          type: string
          description: Net mass in kg.
        packages:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                description: Type of packages (CL017).
              number:
                type: string
                description: Number of packages.
              shippingMarks:
                type: string
                description: Shipping marks.
            additionalProperties: false
      additionalProperties: false
    UnloadingContainer:
      type: object
      properties:
        sequenceNumber:
          type: string
        containerNumber:
          type: string
          description: Container identification number.
        numberOfSeals:
          type: string
        seals:
          type: array
          items:
            type: string
          description: Seal identifiers.
        goodsItems:
          type: array
          items:
            type: string
          description: Declaration goods item numbers of the goods in this container.
      additionalProperties: false
    RequestedDocument:
      type: object
      properties:
        type:
          type: string
          description: Customs document type code, e.g. "N851", "C640".
        description:
          type: string
          description: Human-readable description of the requested document.
      additionalProperties: false
    NonExitedParty:
      type: object
      properties:
        role:
          type: string
          enum:
            - agent
            - declarant
            - exporter
          description: Role of the party in the declaration.
        eori:
          type: string
          description: EORI number of the party.
        name:
          type: string
        relationCode:
          type: string
          description: Agent status code (Customs code list CL094). Agent only.
        address:
          type: object
          properties:
            line:
              type: string
              description: Street and number.
            postcode:
              type: string
            city:
              type: string
            country:
              type: string
              description: ISO 3166-1 alpha-2 code.
          additionalProperties: false
        contact:
          type: object
          properties:
            name:
              type: string
            communications:
              type: array
              items:
                type: object
                properties:
                  number:
                    type: string
                  type:
                    type: string
                    description: Communication type code, e.g. "EM", "TE".
                additionalProperties: false
          additionalProperties: false
      required:
        - role
      additionalProperties: false
    ShipmentStatus:
      type: object
      properties:
        serviceType:
          type: string
          enum: *ref_1
        status:
          type: string
        documentType:
          type: string
          enum:
            - EUA
            - EX
            - T1
            - T2
        mrn:
          type: string
        document:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorSchema'
        importState:
          type: string
          description: >-
            Import document-flow sub-state, e.g. "IE460-DOC" (Customs requested
            documents), "DOCUMENTS-SUBMITTED".
        exportState:
          type: string
          description: >-
            Export document-flow sub-state, e.g. "IE560-DOC",
            "DOCUMENTS-SUBMITTED".
        requestedDocuments:
          type: array
          items:
            $ref: '#/components/schemas/RequestedDocument'
          description: Document types Customs requested for this declaration.
        documentsSubmittedAt:
          type: string
          description: ISO timestamp of the last supporting-documents submission.
        documentsSubmittedCount:
          type: number
          description: Number of documents in the last submission.
        options:
          type: object
          additionalProperties: {}
          description: >-
            Service options resolved for this declaration, per the service
            blueprint, e.g. { "declarantEORI": { "optionValue": "NL123456789" }
            }.
        nonExitedEnquiryDate:
          type: string
          description: >-
            Export only. Date Customs sent the request on non-exited export
            (IE582), as received from Customs.
        nonExitedEvidenceLimitDate:
          type: string
          description: >-
            Export only. Deadline for providing alternative evidence of exit, as
            received from Customs (IE582).
        nonExitedDeclarationOffice:
          type: string
          description: >-
            Export only. Office of declaration handling the non-exited enquiry
            (IE582).
        nonExitedParties:
          type: array
          items:
            $ref: '#/components/schemas/NonExitedParty'
          description: >-
            Export only. Agent, declarant and exporter named in the non-exited
            enquiry (IE582).
        documentsRequestedEffectiveDate:
          type: string
          description: >-
            Export only. Date Customs sent the documents-requested reminder
            (RRD/CC438A).
        documentsRequestedExpirationDate:
          type: string
          description: >-
            Export only. Deadline to provide the requested documents
            (RRD/CC438A).
        timerExpiredLimitDate:
          type: string
          description: >-
            Export only. Control limit date from the timer-expired message
            (IE531/CC531C).
        timerExpiredInspectionDate:
          type: string
          description: >-
            Export only. Inspection start date from the timer-expired message
            (IE531/CC531C).
        timerExpiredStatement:
          type: string
          description: >-
            Export only. Customs statement text from the timer-expired message
            (IE531/CC531C).
        amendmentAcceptedDate:
          type: string
          description: >-
            Export and transit. Date an amendment to the declaration was
            accepted (export IE504/CC504C, transit IE004/CC004C).
        handledExternallyDate:
          type: string
          description: >-
            Export and import. Date of the message saying Customs handles the
            declaration outside DMS (EXT/CCEXTA), as received from Customs.
        noReleaseDate:
          type: string
          description: >-
            Export and transit. Date the declaration was not released (export
            IE551/CC551C, transit IE051/CC051C).
        noReleaseReasons:
          type: string
          description: >-
            Export only. Customs' reason text(s) for not releasing the export
            (IE551/CC551C).
        noReleaseControlResults:
          type: string
          description: >-
            Export only. Control results from the no-release message, one per
            line separated by "; " (IE551/CC551C).
        customsEmergencyProcedureDocument:
          type: string
          description: >-
            Import only. URL to download Customs' emergency procedure document
            (NOOD), next to the one QuayConnect generates.
        emergencyProcedureDate:
          type: string
          description: >-
            Import only. Date of the emergency procedure document (NOOD), as
            received from Customs.
        ogaReportMonth:
          type: string
          description: >-
            Import only. Month (YYYY-MM) of the monthly OGA tax report (OGATAX)
            this declaration is in.
        ogaTotalPaymentAmount:
          type: string
          description: >-
            Import only. Total payment amount of the declaration in the OGA tax
            report (OGATAX).
        ogaTaxes:
          type: string
          description: >-
            Import only. Duties, taxes and fees per item from the OGA tax
            report, e.g. "item 1: A00 12.50, B00 2.10 (total 14.60)", separated
            by "; ".
        lrn:
          type: string
          description: >-
            Transit only. LRN of the transit declaration (IE015), as known to
            Customs.
        acceptanceDate:
          type: number
          description: >-
            Transit only. Date Customs accepted the transit declaration
            (IE028/IE029), in milliseconds since the epoch.
        t2Document:
          type: string
          description: >-
            Transit only. URL to download the transit accompanying document
            (TAD) with its list of items, made after the release for transit
            (IE029).
        releaseForTransit:
          type: boolean
          description: >-
            Transit only. True once Customs released the goods for transit
            (IE029/CC029C).
        typeCode:
          type: string
          description: >-
            Transit only. Code of the last message received from Customs, e.g.
            "CC029C".
        description:
          type: string
          description: Transit only. Description of the last message received from Customs.
        releaseDate:
          type: string
          description: >-
            Transit only. Date the goods were released for transit
            (IE029/CC029C).
        transitDeclarationType:
          type: string
          description: >-
            Transit only. Declaration type Customs accepted: T1, T2, T2F, T, TIR
            (IE029/CC029C).
        departureOffice:
          type: string
          description: Transit only. Customs office of departure (IE029/CC029C).
        destinationOffice:
          type: string
          description: Transit only. Customs office of destination (IE029/CC029C).
        controlResult:
          type: string
          description: >-
            Transit only. Control result at release: code - date - controlled by
            - text (IE029/CC029C).
        rejectionDate:
          type: string
          description: Transit only. Date Customs rejected a request (IE056/CC056C).
        rejectionType:
          type: string
          description: >-
            Transit only. Which request was rejected: 015 declaration, 013
            amendment, 014 invalidation, 170 presentation (IE056/CC056C).
        rejectionReason:
          type: string
          description: Transit only. Reason given for the rejection (IE056/CC056C).
        noReleaseReason:
          type: string
          description: >-
            Transit only. Reason the goods were not released for transit
            (IE051/CC051C).
        controlNotificationDate:
          type: string
          description: >-
            Transit only. Date Customs notified a control at departure
            (IE060/CC060C).
        controlNotificationType:
          type: string
          description: Transit only. Control notification type (IE060/CC060C, CL384).
        controlTypes:
          type: string
          description: >-
            Transit only. Types of control, separated by "; " (IE060/CC060C,
            CL716).
        controlRequestedDocuments:
          type: string
          description: >-
            Transit only. Documents Customs requested for the control, separated
            by "; " (IE060/CC060C).
        discrepanciesDate:
          type: string
          description: Transit only. Date Customs notified discrepancies (IE019/CC019C).
        discrepancies:
          type: string
          description: Transit only. Discrepancies found by Customs (IE019/CC019C).
        amendmentAllowedDate:
          type: string
          description: >-
            Transit only. Date Customs allowed an amendment after a control
            (IE022/CC022C).
        arrivalDate:
          type: string
          description: Transit only. Date the goods arrived at destination (IE006/CC006C).
        arrivalDestinationOffice:
          type: string
          description: Transit only. Customs office where the goods arrived (IE006/CC006C).
        writeOffDate:
          type: string
          description: >-
            Transit only. Date the transit movement was written off, i.e. closed
            (IE045/CC045C).
        nonArrivalRequestDate:
          type: string
          description: >-
            Transit only. Date Customs asked for information on a movement that
            has not arrived (IE140/CC140C).
        nonArrivalResponseLimitDate:
          type: string
          description: >-
            Transit only. Deadline to answer the non-arrival request
            (IE140/CC140C).
        nonArrivalEnquiryOffice:
          type: string
          description: >-
            Transit only. Customs office asking about the non-arrived movement
            (IE140/CC140C).
        incidentDate:
          type: string
          description: >-
            Transit only. Date an incident during the movement was notified
            (IE182/CC182C).
        incidentOffice:
          type: string
          description: >-
            Transit only. Customs office that registered the incident
            (IE182/CC182C).
        incidents:
          type: string
          description: >-
            Transit only. Incidents as code - text, separated by "; "
            (IE182/CC182C).
        invalidGuarantees:
          type: string
          description: Transit only. Guarantees Customs found not valid (IE055/CC055C).
        guaranteeQueryDate:
          type: string
          description: >-
            Transit only. Date of the answer to the guarantee query
            (IE037/CC037C).
        guaranteeQueryResult:
          type: string
          description: Transit only. Result of the guarantee query (IE037/CC037C).
        invalidationDate:
          type: string
          description: >-
            Transit only. Date Customs decided on the invalidation
            (IE009/CC009C).
        invalidationDecision:
          type: string
          description: >-
            Transit only. Invalidation decision: invalidated or not
            (IE009/CC009C).
        acknowledgementDate:
          type: string
          description: >-
            Transit only. Date Customs confirmed it received the declaration
            (IE928/CC928C).
        acknowledgementMrn:
          type: string
          description: >-
            Transit only. MRN Customs gave with the acknowledgement
            (IE928/CC928C), before the acceptance. Sent back in the presentation
            notification (IE170) of a pre-lodged declaration.
        arrivalNotificationDate:
          type: string
          description: >-
            Transit arrival only. Date the arrival notification (IE007/CC007C)
            was sent to the office of destination.
        unloadingRemarksDate:
          type: string
          description: >-
            Transit arrival only. Date the unloading remarks (IE044/CC044C) were
            sent; IE025 (release) or IE057 (rejection) follows.
        unloadingPermissionDate:
          type: string
          description: >-
            Transit arrival only. Date Customs permitted the unloading
            (IE043/CC043C); the unloading remarks (IE044) are due next.
        unloadingSeals:
          type: string
          description: >-
            Transit arrival only. Containers and their seals to check, e.g.
            "1/CSQU3054383: F742", separated by "; " (IE043/CC043C).
        unloadingGoodsItems:
          type: string
          description: >-
            Transit arrival only. Number of goods items in the consignment to
            unload (IE043/CC043C).
        unloadingGoods:
          type: array
          items:
            $ref: '#/components/schemas/UnloadingGoodsItem'
          description: >-
            Transit arrival only. The goods items of the consignment to unload,
            to check the load against before sending the unloading remarks
            (IE043/CC043C).
        unloadingContainers:
          type: array
          items:
            $ref: '#/components/schemas/UnloadingContainer'
          description: >-
            Transit arrival only. The containers of the consignment to unload
            with their seals (IE043/CC043C).
        unloadingPermission:
          type: string
          description: >-
            Transit arrival only. URL to download the received unloading
            permission (IE043/CC043C) with the whole consignment.
        destinationReleaseDate:
          type: string
          description: >-
            Transit arrival only. Date the goods were released at destination
            (IE025/CC025C).
        releaseNotification:
          type: string
          description: >-
            Transit arrival only. Release indicator (CL164) as code - text, e.g.
            "1 - Full release of goods (as per declaration) - Movement closed"
            (IE025/CC025C).
        releaseTypes:
          type: string
          description: >-
            Transit arrival only. Release type (CL163) per house consignment and
            goods item, separated by "; " (IE025/CC025C).
        destinationRejectionDate:
          type: string
          description: >-
            Transit arrival only. Date the office of destination rejected a
            request (IE057/CC057C).
        destinationRejectionType:
          type: string
          description: >-
            Transit arrival only. Which request was rejected: 007 arrival
            notification, 044 unloading remarks (IE057/CC057C).
        destinationRejectionReason:
          type: string
          description: >-
            Transit arrival only. Rejection code and reason (IE057/CC057C); the
            functional errors are in errors.
        destinationControlDate:
          type: string
          description: >-
            Transit arrival only. Date the office of destination notified a
            control of the goods (IE061/CC061C).
      required:
        - serviceType
      additionalProperties: true
    ShipmentStatusResponse:
      type: object
      properties:
        shipmentId:
          type: string
          description: >-
            Unique identifier of the shipment as was returned when the shipment
            was created.
        finalized:
          type: boolean
          description: >-
            Indicates if the shipment has been finalized or if it is still
            editable
        services:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentStatus'
      additionalProperties: false
    GetContactsResponse:
      type: object
      properties:
        contacts:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              legalName:
                type: string
              eori:
                type: string
              vat:
                type: string
              phone:
                type: string
              email:
                type: string
              contactPerson:
                type: string
              tracesNumber:
                type: string
              chamberOfCommerceNumber:
                type: string
              roles:
                type: array
                items:
                  type: string
              address:
                type: object
                properties:
                  street:
                    type: string
                  houseNumber:
                    type: string
                  houseNumberAddition:
                    type: string
                  postalCode:
                    type: string
                  city:
                    type: string
                  province:
                    type: string
                  country:
                    type: string
                additionalProperties: false
            additionalProperties: false
      additionalProperties: false
    NewContactRequest:
      type: object
      properties:
        onBehalf:
          type: string
          description: >-
            Create the contact for another organisation. Only allowed for
            intermediary and service provider organisations.
        code:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Unique code of the contact within the organisation. Shipments refer
            to the contact with this code.
        legalName:
          type: string
          maxLength: 200
          description: Legal name of the contact.
        eori:
          type: string
          maxLength: 200
          description: EORI number of the contact.
        vat:
          type: string
          maxLength: 200
          description: VAT number of the contact.
        phone:
          type: string
          maxLength: 200
          description: Phone number of the contact.
        email:
          type: string
          format: email
          description: Email address of the contact.
        contactPerson:
          type: string
          maxLength: 200
          description: Name of the contact person.
        tracesNumber:
          type: string
          maxLength: 200
          description: TRACES identification number of the contact.
        chamberOfCommerceNumber:
          type: string
          maxLength: 200
          description: Chamber of Commerce (KvK) number of the contact.
        roles:
          type: array
          items:
            type: string
            enum:
              - importer
              - exporter
              - consignee
              - consignor
              - buyer
              - seller
              - haulier
          minItems: 1
          description: Roles this contact can have in a shipment.
        address:
          type: object
          properties:
            street:
              type: string
              maxLength: 200
              description: Street name.
            houseNumber:
              type: string
              maxLength: 200
              description: House number.
            houseNumberAddition:
              type: string
              maxLength: 200
              description: Addition to the house number, e.g. "A".
            postalCode:
              type: string
              maxLength: 200
              description: Postal code.
            city:
              type: string
              maxLength: 200
              description: City, e.g. Rotterdam.
            province:
              type: string
              maxLength: 200
              description: Province or state.
            country:
              type: string
              enum: *ref_0
              description: UN 2-letter country code, e.g. "NL".
          additionalProperties: false
          description: Default address of the contact.
        serviceDetails:
          type: object
          additionalProperties:
            type: object
            properties:
              enabled:
                type: boolean
            required:
              - enabled
            additionalProperties:
              type: object
              properties:
                optionName:
                  type: string
                optionType:
                  type: string
                  enum:
                    - string
                    - boolean
                    - number
                    - enum
                optionValue:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
              required:
                - optionName
                - optionType
                - optionValue
              additionalProperties: false
          description: >-
            Service configuration of the contact, per service id, e.g. {
            "nl-export-track-on-trade": { "enabled": true } }. Any option
            besides `enabled` must be an object with optionName, optionType and
            optionValue.
      required:
        - code
        - roles
      additionalProperties: false
    NewContactResponse:
      type: object
      properties:
        code:
          type: string
          description: Code of the created contact.
        legalName:
          type: string
        roles:
          type: array
          items:
            type: string
        address:
          $ref: '#/components/schemas/NewContactRequest/properties/address'
      required:
        - code
        - roles
      additionalProperties: false
    SimulateUpdateRequest:
      type: object
      properties:
        serviceType:
          type: string
          enum:
            - uk-import-declaration
            - nl-export-declaration
        updateType:
          type: string
          enum:
            - success
            - failure
        output:
          type: array
          items:
            type: object
            properties:
              outputName:
                type: string
              outputType:
                type: string
                enum:
                  - document
                  - number
                  - boolean
                  - array
                  - string
                  - taxes
                  - controls
                  - control-results
                  - amendments
                  - timestamp
              base64Data:
                type: string
              number:
                type: string
            required:
              - outputName
              - outputType
            additionalProperties: false
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            additionalProperties: false
      required:
        - serviceType
        - updateType
      additionalProperties: false
    finalizeShipmentResponse:
      type: object
      properties:
        shipmentId:
          type: string
      required:
        - shipmentId
      additionalProperties: false
    NewLocationRequest:
      type: object
      properties:
        onBehalf:
          type: string
          description: >-
            Create the location for another organisation. Only allowed for
            intermediary and service provider organisations.
        code:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Unique code of the location within the organisation. Shipments refer
            to the location with this code. A commonly used code is the postal
            code + house number, which is unique in the Netherlands.
        name:
          type: string
          maxLength: 200
          description: Name of the location.
        address:
          type: object
          properties:
            street:
              type: string
              maxLength: 200
              description: Street name.
            houseNumber:
              type: string
              maxLength: 200
              description: House number.
            houseNumberAddition:
              type: string
              maxLength: 200
              description: Addition to the house number, e.g. "A".
            postalCode:
              type: string
              maxLength: 200
              description: Postal code.
            city:
              type: string
              maxLength: 200
              description: City, e.g. Rotterdam.
            country:
              type: string
              enum: *ref_0
              description: UN 2-letter country code, e.g. "NL".
          required:
            - country
          additionalProperties: false
          description: Address of the location. The country is required.
        serviceBinding:
          type: object
          additionalProperties:
            type: object
            properties:
              enabled:
                type: boolean
            required:
              - enabled
            additionalProperties:
              $ref: >-
                #/components/schemas/NewContactRequest/properties/serviceDetails/additionalProperties/additionalProperties
          description: >-
            Service configuration of the location, per service id, e.g. {
            "nl-export-dms": { "enabled": true } }. Any option besides `enabled`
            must be an object with optionName, optionType and optionValue.
      required:
        - code
        - address
      additionalProperties: false
    NewLocationResponse:
      type: object
      properties:
        code:
          type: string
          description: Code of the created location.
        name:
          type: string
        address:
          type: object
          properties:
            street:
              $ref: >-
                #/components/schemas/NewLocationRequest/properties/address/properties/street
            houseNumber:
              $ref: >-
                #/components/schemas/NewLocationRequest/properties/address/properties/houseNumber
            houseNumberAddition:
              $ref: >-
                #/components/schemas/NewLocationRequest/properties/address/properties/houseNumberAddition
            postalCode:
              $ref: >-
                #/components/schemas/NewLocationRequest/properties/address/properties/postalCode
            city:
              $ref: >-
                #/components/schemas/NewLocationRequest/properties/address/properties/city
            country:
              $ref: >-
                #/components/schemas/NewLocationRequest/properties/address/properties/country
          required:
            - country
          additionalProperties: false
      required:
        - code
        - address
      additionalProperties: false
    UpdateContactRequest:
      type: object
      properties:
        onBehalf:
          $ref: '#/components/schemas/NewContactRequest/properties/onBehalf'
          description: >-
            Create the contact for another organisation. Only allowed for
            intermediary and service provider organisations.
        legalName:
          $ref: '#/components/schemas/NewContactRequest/properties/legalName'
          description: Legal name of the contact.
        eori:
          $ref: '#/components/schemas/NewContactRequest/properties/eori'
          description: EORI number of the contact.
        vat:
          $ref: '#/components/schemas/NewContactRequest/properties/vat'
          description: VAT number of the contact.
        phone:
          $ref: '#/components/schemas/NewContactRequest/properties/phone'
          description: Phone number of the contact.
        email:
          $ref: '#/components/schemas/NewContactRequest/properties/email'
          description: Email address of the contact.
        contactPerson:
          $ref: '#/components/schemas/NewContactRequest/properties/contactPerson'
          description: Name of the contact person.
        tracesNumber:
          $ref: '#/components/schemas/NewContactRequest/properties/tracesNumber'
          description: TRACES identification number of the contact.
        chamberOfCommerceNumber:
          $ref: >-
            #/components/schemas/NewContactRequest/properties/chamberOfCommerceNumber
          description: Chamber of Commerce (KvK) number of the contact.
        roles:
          $ref: '#/components/schemas/NewContactRequest/properties/roles'
          description: Roles this contact can have in a shipment.
        address:
          $ref: '#/components/schemas/NewContactRequest/properties/address'
          description: Default address of the contact.
        serviceDetails:
          $ref: '#/components/schemas/NewContactRequest/properties/serviceDetails'
          description: >-
            Service configuration of the contact, per service id, e.g. {
            "nl-export-track-on-trade": { "enabled": true } }. Any option
            besides `enabled` must be an object with optionName, optionType and
            optionValue.
      additionalProperties: false
    UpdateLocationRequest:
      type: object
      properties:
        onBehalf:
          $ref: '#/components/schemas/NewLocationRequest/properties/onBehalf'
          description: >-
            Create the location for another organisation. Only allowed for
            intermediary and service provider organisations.
        name:
          $ref: '#/components/schemas/NewLocationRequest/properties/name'
          description: Name of the location.
        address:
          $ref: '#/components/schemas/NewLocationRequest/properties/address'
          description: Address of the location. The country is required.
        serviceBinding:
          $ref: '#/components/schemas/NewLocationRequest/properties/serviceBinding'
          description: >-
            Service configuration of the location, per service id, e.g. {
            "nl-export-dms": { "enabled": true } }. Any option besides `enabled`
            must be an object with optionName, optionType and optionValue.
      additionalProperties: false
    GetLocationsResponse:
      type: object
      properties:
        locations:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              name:
                type: string
              address:
                $ref: '#/components/schemas/NewLocationResponse/properties/address'
            required:
              - code
            additionalProperties: false
      required:
        - locations
      additionalProperties: false
    AttachDocumentsResponse:
      type: object
      properties:
        documentId:
          type: string
      required:
        - documentId
      additionalProperties: false
    SimpleError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      additionalProperties: false
    TriggerServiceRequest:
      type: object
      properties:
        service:
          type: object
          properties:
            serviceType:
              type: string
              enum: *ref_1
            gvms:
              type: boolean
            eidr:
              type: boolean
          required:
            - serviceType
          additionalProperties: false
      required:
        - service
      additionalProperties: false
    AddressData:
      type: object
      properties:
        country:
          type: string
        city:
          type: string
        street:
          type: string
        postalCode:
          type: string
        name:
          type: string
      additionalProperties: false
    ServiceData:
      type: object
      additionalProperties:
        type: object
        properties:
          companyCode:
            type: object
            properties:
              optionType:
                type: string
              optionValue:
                type: string
              optionName:
                type: string
            required:
              - optionType
              - optionValue
              - optionName
            additionalProperties: false
          eidrEnabled:
            type: object
            properties:
              optionType:
                type: string
              optionValue:
                type: boolean
              optionName:
                type: string
            required:
              - optionType
              - optionValue
              - optionName
            additionalProperties: false
          shortName:
            type: object
            properties:
              optionType:
                type: string
              optionValue:
                type: string
              optionName:
                type: string
            required:
              - optionType
              - optionValue
              - optionName
            additionalProperties: false
          enabled:
            type: boolean
        additionalProperties: false
    PartyData:
      type: object
      properties:
        legalName:
          type: string
        address:
          $ref: '#/components/schemas/AddressData'
        name:
          type: string
        serviceDetails:
          $ref: '#/components/schemas/ServiceData'
        resolved:
          type: boolean
      additionalProperties: false
    DocumentData:
      type: object
      properties:
        number:
          type: string
        type:
          type: string
        fileRef:
          type: string
      additionalProperties: false
    ItemData:
      type: object
      additionalProperties:
        anyOf:
          - not: {}
          - type: object
            properties:
              uid: {}
              index:
                type: number
              resolved:
                type: boolean
              productCode:
                $ref: '#/components/schemas/GoodsItem/properties/productCode'
              netWeight:
                $ref: '#/components/schemas/GoodsItem/properties/netWeight'
              grossWeight:
                $ref: '#/components/schemas/GoodsItem/properties/grossWeight'
              description:
                $ref: '#/components/schemas/GoodsItem/properties/description'
              commodityCode:
                $ref: '#/components/schemas/GoodsItem/properties/commodityCode'
              countryOfOrigin:
                $ref: '#/components/schemas/GoodsItem/properties/countryOfOrigin'
              value:
                $ref: '#/components/schemas/GoodsItem/properties/value'
              valueCurrency:
                $ref: '#/components/schemas/GoodsItem/properties/valueCurrency'
              packagingQuantity:
                $ref: '#/components/schemas/GoodsItem/properties/packagingQuantity'
              packagingQuantityUnit:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/packagingQuantityUnit
              packagingMarks:
                $ref: '#/components/schemas/GoodsItem/properties/packagingMarks'
              eppoCode:
                $ref: '#/components/schemas/GoodsItem/properties/eppoCode'
              species:
                $ref: '#/components/schemas/GoodsItem/properties/species'
              class:
                $ref: '#/components/schemas/GoodsItem/properties/class'
              variety:
                $ref: '#/components/schemas/GoodsItem/properties/variety'
              valuationMethod:
                $ref: '#/components/schemas/GoodsItem/properties/valuationMethod'
              supplementaryUnits:
                $ref: '#/components/schemas/GoodsItem/properties/supplementaryUnits'
              supplementaryUnitsType:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/supplementaryUnitsType
              additionalPackaging:
                $ref: '#/components/schemas/GoodsItem/properties/additionalPackaging'
              previousDocumentLineNumber:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/previousDocumentLineNumber
              documents:
                type: array
                items:
                  $ref: '#/components/schemas/DocumentData'
              container:
                $ref: '#/components/schemas/GoodsItem/properties/container'
              dutyPreference:
                $ref: '#/components/schemas/GoodsItem/properties/dutyPreference'
              chargeDeduction:
                $ref: '#/components/schemas/GoodsItem/properties/chargeDeduction'
              valuationIndicator:
                $ref: '#/components/schemas/GoodsItem/properties/valuationIndicator'
              customsValuationMethod:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/customsValuationMethod
              statisticalValue:
                $ref: '#/components/schemas/GoodsItem/properties/statisticalValue'
              referenceNumber:
                $ref: '#/components/schemas/GoodsItem/properties/referenceNumber'
              transactionNature:
                $ref: '#/components/schemas/GoodsItem/properties/transactionNature'
              transportChargesPaymentMethod:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transportChargesPaymentMethod
              preferentialOriginCountry:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/preferentialOriginCountry
              dangerousGoods:
                $ref: '#/components/schemas/GoodsItem/properties/dangerousGoods'
              transitDepartureTransportMeans:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transitDepartureTransportMeans
              transitTransportChargesPaymentMethod:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transitTransportChargesPaymentMethod
              transitDocuments:
                $ref: '#/components/schemas/GoodsItem/properties/transitDocuments'
              transitConsignor:
                $ref: '#/components/schemas/GoodsItem/properties/transitConsignor'
              transitConsignee:
                $ref: '#/components/schemas/GoodsItem/properties/transitConsignee'
              transitAdditionalSupplyChainActors:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transitAdditionalSupplyChainActors
              transitCountryOfDispatch:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transitCountryOfDispatch
              transitCountryOfDestination:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transitCountryOfDestination
              transitReferenceNumberUCR:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transitReferenceNumberUCR
              transitDeclarationType:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/transitDeclarationType
              procedure:
                $ref: '#/components/schemas/GoodsItem/properties/procedure'
              cusCode:
                $ref: '#/components/schemas/GoodsItem/properties/cusCode'
              taricAdditionalCodes:
                $ref: '#/components/schemas/GoodsItem/properties/taricAdditionalCodes'
              nationalAdditionalCodes:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/nationalAdditionalCodes
              strategicGoodsCodes:
                $ref: '#/components/schemas/GoodsItem/properties/strategicGoodsCodes'
              upuCode:
                $ref: '#/components/schemas/GoodsItem/properties/upuCode'
              quotaOrder:
                $ref: '#/components/schemas/GoodsItem/properties/quotaOrder'
              dutyTaxFees:
                $ref: '#/components/schemas/GoodsItem/properties/dutyTaxFees'
              additionalReferences:
                $ref: '#/components/schemas/GoodsItem/properties/additionalReferences'
              additionalInformation:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/additionalInformation
              authorisations:
                $ref: '#/components/schemas/GoodsItem/properties/authorisations'
              aeoParties:
                $ref: '#/components/schemas/GoodsItem/properties/aeoParties'
              transportDocuments:
                $ref: '#/components/schemas/GoodsItem/properties/transportDocuments'
              previousDocumentType:
                $ref: '#/components/schemas/GoodsItem/properties/previousDocumentType'
              previousDocumentNumber:
                $ref: >-
                  #/components/schemas/GoodsItem/properties/previousDocumentNumber
              previousDocuments:
                $ref: '#/components/schemas/GoodsItem/properties/previousDocuments'
              supportingDocuments:
                $ref: '#/components/schemas/GoodsItem/properties/supportingDocuments'
              consignor:
                type: object
                properties:
                  legalName:
                    $ref: '#/components/schemas/PartyData/properties/legalName'
                  address:
                    $ref: '#/components/schemas/PartyData/properties/address'
                  name:
                    $ref: '#/components/schemas/PartyData/properties/name'
                  serviceDetails:
                    $ref: '#/components/schemas/PartyData/properties/serviceDetails'
                  resolved:
                    $ref: '#/components/schemas/PartyData/properties/resolved'
                additionalProperties: true
              consignee:
                type: object
                properties:
                  legalName:
                    $ref: '#/components/schemas/PartyData/properties/legalName'
                  address:
                    $ref: '#/components/schemas/PartyData/properties/address'
                  name:
                    $ref: '#/components/schemas/PartyData/properties/name'
                  serviceDetails:
                    $ref: '#/components/schemas/PartyData/properties/serviceDetails'
                  resolved:
                    $ref: '#/components/schemas/PartyData/properties/resolved'
                additionalProperties: true
              buyer:
                type: object
                properties:
                  legalName:
                    $ref: '#/components/schemas/PartyData/properties/legalName'
                  address:
                    $ref: '#/components/schemas/PartyData/properties/address'
                  name:
                    $ref: '#/components/schemas/PartyData/properties/name'
                  serviceDetails:
                    $ref: '#/components/schemas/PartyData/properties/serviceDetails'
                  resolved:
                    $ref: '#/components/schemas/PartyData/properties/resolved'
                additionalProperties: true
              seller:
                type: object
                properties:
                  legalName:
                    $ref: '#/components/schemas/PartyData/properties/legalName'
                  address:
                    $ref: '#/components/schemas/PartyData/properties/address'
                  name:
                    $ref: '#/components/schemas/PartyData/properties/name'
                  serviceDetails:
                    $ref: '#/components/schemas/PartyData/properties/serviceDetails'
                  resolved:
                    $ref: '#/components/schemas/PartyData/properties/resolved'
                additionalProperties: true
              exporter:
                type: object
                properties:
                  legalName:
                    $ref: '#/components/schemas/PartyData/properties/legalName'
                  address:
                    $ref: '#/components/schemas/PartyData/properties/address'
                  name:
                    $ref: '#/components/schemas/PartyData/properties/name'
                  serviceDetails:
                    $ref: '#/components/schemas/PartyData/properties/serviceDetails'
                  resolved:
                    $ref: '#/components/schemas/PartyData/properties/resolved'
                additionalProperties: true
            required:
              - netWeight
              - grossWeight
              - value
              - packagingQuantity
              - packagingQuantityUnit
            additionalProperties: false
    unLocodeData:
      type: object
      properties:
        country:
          type: string
        city:
          type: string
        unLocode:
          type: string
        resolved:
          type: boolean
      additionalProperties: false
    ValuationData:
      type: object
      properties:
        incoterms:
          type: string
        invoiceValue:
          type: object
          properties:
            amount:
              type: number
          additionalProperties: false
        incotermsLocation:
          $ref: '#/components/schemas/unLocodeData'
      additionalProperties: false
    PlaceData:
      type: object
      properties:
        code:
          type: string
        resolved:
          type: boolean
        serviceDetails:
          type: object
          additionalProperties: {}
      additionalProperties: false
    GoodsLocationData:
      type: object
      properties:
        type:
          type: string
        code:
          type: string
        address:
          $ref: '#/components/schemas/NewLocationResponse/properties/address'
      additionalProperties: false
    TransitDataResponse:
      type: object
      properties:
        declarationType:
          type: string
        additionalDeclarationType:
          type: string
        security:
          type: string
        reducedDatasetIndicator:
          type: boolean
        specificCircumstancesIndicator:
          type: string
        bindingItinerary:
          type: boolean
        tirCarnet:
          type: string
        goodsPresentationDate:
          type: number
        departureLanguage:
          type: string
        limitDate:
          type: number
        goodsLocation:
          $ref: '#/components/schemas/GoodsLocationData'
        loadingPlace:
          type: object
          properties:
            unLocode:
              type: string
            country:
              type: string
            location:
              type: string
          additionalProperties: false
        unloadingPlace:
          type: object
          properties:
            unLocode:
              type: string
            country:
              type: string
            location:
              type: string
          additionalProperties: false
        authorisations:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              referenceNumber:
                type: string
            additionalProperties: false
        transitOffices:
          type: array
          items:
            type: object
            properties:
              referenceNumber:
                type: string
              arrivalDate:
                type: number
            additionalProperties: false
        exitOffices:
          type: array
          items:
            type: string
        guarantees:
          type: array
          items:
            $ref: '#/components/schemas/TransitGuarantee'
        additionalSupplyChainActors:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
              identificationNumber:
                type: string
            additionalProperties: false
        routingCountries:
          type: array
          items:
            type: string
      additionalProperties: false
    VoyageData:
      type: object
      properties:
        voyageType:
          type: string
          enum:
            - roro
            - roro-eurotunnel
            - ocean
            - air
            - rail
          description: >-

            Describes the combined mode of transport from export to import
            country.

            roro - roro via shortsea vessel (ferry)

            roro-eurotunnel - roro via shortsea vessel (ferry)

            ocean - ocean carrier route

            air - air freight

            rail - rail transport crossing the border
        placeOfLoading:
          $ref: '#/components/schemas/PlaceData'
        portOfLoading:
          $ref: '#/components/schemas/unLocodeData'
        portOfDischarge:
          $ref: '#/components/schemas/unLocodeData'
        placeOfDelivery:
          $ref: '#/components/schemas/PlaceData'
        trailer:
          $ref: '#/components/schemas/VehicleDescription'
        truck:
          $ref: '#/components/schemas/VehicleDescription'
        wagon:
          $ref: '#/components/schemas/VehicleDescription'
        aircraft:
          $ref: '#/components/schemas/VehicleDescription'
        flight:
          $ref: '#/components/schemas/VehicleDescription'
        vessel:
          $ref: '#/components/schemas/VehicleDescription'
        carrier:
          $ref: '#/components/schemas/Carrier'
        transitCustomsOffices:
          type: array
          items:
            type: string
          description: >-
            Customs Office of Transit where products cross the EU border to a
            Customs Office of Destination in a nonEU country member of the
            Common Transit Convention.
        destinationCustomsOffice:
          type: string
          description: ' Customs office of destination in Transit Departure declaration.'
        exitCustomsOffice:
          type: string
          description: >-
            Customs office of exit: where the goods leave the EU (e.g.
            NL000396). Used by DMS export.
        containers:
          type: array
          items:
            $ref: '#/components/schemas/Container'
        eta:
          type: number
          description: >-
            Estimated time of arrival of the shipment (for UK services: at the
            UK border), as a UNIX timestamp in milliseconds (e.g.
            1792557908243). Not sent in the DMS export or import declaration.
      required:
        - voyageType
        - eta
      additionalProperties: false
    ShipmentDataResponse:
      type: object
      properties:
        shipmentReference:
          type: string
        shipmentType:
          type: string
        valuation:
          $ref: '#/components/schemas/ValuationData'
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentData'
        parties:
          type: object
          properties:
            consignee:
              $ref: '#/components/schemas/PartyData'
            haulier:
              $ref: '#/components/schemas/PartyData'
            consignor:
              $ref: '#/components/schemas/PartyData'
          additionalProperties: false
        items:
          $ref: '#/components/schemas/ItemData'
        voyageReference:
          type: string
        voyage:
          $ref: '#/components/schemas/VoyageData'
        transit:
          $ref: '#/components/schemas/TransitDataResponse'
        transitArrival:
          type: object
          properties:
            mrn:
              $ref: '#/components/schemas/TransitArrival/properties/mrn'
              description: MRN of the transit movement that arrived.
            officeOfDestination:
              $ref: >-
                #/components/schemas/TransitArrival/properties/officeOfDestination
              description: >-
                Actual customs office of destination (codelist 173). Falls back
                to the customsOfficeOfDestination option of the service.
            arrivalDate:
              $ref: '#/components/schemas/TransitArrival/properties/arrivalDate'
              description: >-
                Arrival notification date and time, as a UNIX timestamp.
                Defaults to the time of sending.
            simplifiedProcedure:
              $ref: >-
                #/components/schemas/TransitArrival/properties/simplifiedProcedure
              description: True when the authorised consignee procedure is used.
            destinationLanguage:
              $ref: >-
                #/components/schemas/TransitArrival/properties/destinationLanguage
              description: Language of communication at destination (codelist 192).
            authorisations:
              $ref: '#/components/schemas/TransitArrival/properties/authorisations'
            goodsLocation:
              $ref: '#/components/schemas/TransitArrival/properties/goodsLocation'
              description: Where the goods can be examined at destination.
            incidents:
              $ref: '#/components/schemas/TransitArrival/properties/incidents'
              description: Incidents during the movement.
            unloadingRemarks:
              $ref: '#/components/schemas/TransitArrival/properties/unloadingRemarks'
              description: >-
                Unloading remarks (IE044) after the unloading permission
                (IE043). Without findings, everything is reported as declared.
          additionalProperties: false
        dms:
          $ref: '#/components/schemas/Dms'
          description: >-
            DMS export and import only. Declaration data with no other field in
            the shipment (MIG DMS v1.50).
      additionalProperties: false
    ShipmentStatusDataResponse:
      type: object
      properties:
        shipmentId:
          type: string
          description: >-
            Unique identifier of the shipment as was returned when the shipment
            was created.
        finalized:
          type: boolean
          description: >-
            Indicates if the shipment has been finalized or if it is still
            editable
        services:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentStatus'
        shipmentData:
          $ref: '#/components/schemas/ShipmentDataResponse'
      required:
        - shipmentData
      additionalProperties: false
    ImportCRIRequest:
      type: object
      properties:
        lines:
          type: array
          items:
            type: object
            properties:
              index:
                type: number
              value:
                type: number
            required:
              - index
              - value
            additionalProperties: false
      required:
        - lines
      additionalProperties: false
    ImportCancelRequest:
      type: object
      properties:
        reason:
          type: string
      required:
        - reason
      additionalProperties: false
    ReasonRequest:
      type: object
      properties:
        reason:
          type: string
          minLength: 1
          maxLength: 512
          description: Why the declaration is cancelled.
      required:
        - reason
      additionalProperties: false
    TransitAmendRequest:
      type: object
      properties:
        guaranteeOnly:
          type: boolean
          description: >-
            Send only the guarantee of the declaration in the amendment. Left
            out, the whole declaration is sent.
      additionalProperties: false
    ProvideDocumentsRequest:
      type: object
      properties:
        direction:
          type: string
          enum:
            - import
            - export
          description: >-
            Which DMS declaration flow the documents belong to. Defaults to
            "import".
      additionalProperties: false
      description: >-
        Provide the supporting documents Customs requested for a declaration
        under control (DMS Digitaal Dossier, message IE446 import / NLPRD
        export).
    ProvideDocumentsResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - failure
      required:
        - status
      additionalProperties: false
    ImportCRIResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - failure
      required:
        - status
      additionalProperties: false
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: The API key of the organisation, as "Bearer <API key>".
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
security:
  - ApiKey: []
x-webhooks:
  service-update:
    post:
      summary: Webhook callback to receive updates on the shipment's service statuses.
      operationId: onServiceUpdate
      description: >-
        This endpoint should exist in your application, so QuayConnect can call
        it whenever an update on a service comes in.


        QuayConnect authenticates with http basic auth (a username and password
        you choose) or a bearer token. To enable the webhook, give a QuayConnect
        developer the URL and the credentials.
      security:
        - BasicAuth: []
        - BearerAuth: []
      requestBody:
        description: Status update on the services
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShipmentStatusResponse'
      responses:
        '200':
          description: The update was received.
