> ## Documentation Index
> Fetch the complete documentation index at: https://docs-nce.global-e.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dispatch orders (Merchant to Global-e)

> The DispatchOrders API provides the necessary carrier manifest, encoded as a base64 byte array, and a printing URL for all orders with printed labels since the last DispatchOrders call.

> [!NOTE]
>
> Part of the [Generating Shipping Documents](https://docs-nce.global-e.com/shipping-documents-api) integration guide — see it for when and how to use this endpoint.


## OpenAPI

````yaml api-reference/specs/dispatchorders.yaml POST /Order/DispatchOrders
openapi: 3.0.3
info:
  title: DispatchOrders
  version: 1.0.0
  description: >-
    The DispatchOrders API provides the necessary carrier manifest, encoded as a
    base64 byte array, and a printing URL for all orders with printed labels
    since the last DispatchOrders call.
servers:
  - url: https://{globale_api_domain}
    variables:
      globale_api_domain:
        default: globale_api_domain
        description: Global-e API host, supplied to the merchant by Global-e.
security: []
tags:
  - name: DispatchOrders
    x-page-title: DispatchOrders
  - name: 'Direction: Merchant → Global-e'
  - name: 'Domain: Shipping'
paths:
  /Order/DispatchOrders:
    post:
      tags:
        - DispatchOrders
      summary: Dispatch orders and retrieve carrier manifest
      description: >-
        The DispatchOrders API provides the necessary carrier manifest, encoded
        as a base64 byte array, and a printing URL for all orders with printed
        labels since the last DispatchOrders call. You can dispatch at order
        level with order identifiers, or dispatch selected parcels only when you
        send parcel codes or tracking numbers (for example split shipments).
        Manifest generation and dispatch notifications behave the same for both.
      operationId: dispatchOrders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DispatchOrdersRequest'
            examples:
              orderLevel:
                summary: Order-level dispatch (unchanged)
                value:
                  OrderIds:
                    - GE11111111GB
                    - GE2222211GB
                  HubCode: hub001
              parcelCodes:
                summary: Parcel-level dispatch by parcel code
                value:
                  ParcelCodes:
                    - 100018322-1
                    - 100018322-2
                  HubCode: hub001
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DispatchOrdersResponse'
              example:
                IsSuccess: true
                ShipperManifests:
                  - DocumentTypeCode: '3'
                    DocumentTypeName: ShipperManifest
                    DocumentExtension: pdf
                    URL: >-
                      https://assets.global-e.com/documents/04552836-ED8F-4362-AE09-FAB014DAA421.pdf
                    DocumentData: JVBERi0xLjUNCiW1tbW1DQoxIDAgb2[...]mDQoxNDgzNDkNCiUlRU9G
                    ErrorMessage: null
        '400':
          description: >-
            None of the orders or parcels could be dispatched, or the request
            failed validation (for example when none of `ParcelCodes`,
            `TrackingNumbers`, `OrderIds`, or `MerchantOrderIds` is provided).
            The body has the same shape as a successful response, with
            `IsSuccess` set to `false`: `ErrorText` describes the failure, and
            `Errors` lists each order or parcel that was rejected, when there is
            one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DispatchOrdersResponse'
              example:
                IsSuccess: false
                ErrorText: There are no orders valid for dispatch.
                ShipperManifests: []
                Errors: null
        '500':
          description: >-
            The dispatch failed, for example a `HubCode` that does not match a
            hub configured for the merchant. Same body as a successful response,
            with `IsSuccess` set to `false`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DispatchOrdersResponse'
              example:
                IsSuccess: false
                ErrorText: >-
                  Configuration error. Cannot determine source hub. Please
                  contact Global-e TechSuppor.
                ShipperManifests: []
                Errors: []
components:
  schemas:
    DispatchOrdersRequest:
      type: object
      title: DispatchOrdersRequest
      description: >-
        Identifies which orders or parcels to dispatch. Supply at least one of
        `ParcelCodes`, `TrackingNumbers`, `OrderIds`, or `MerchantOrderIds`.
        Only one resolution method applies per request: (1) If `ParcelCodes` is
        non-empty, only those parcels are dispatched and `TrackingNumbers` and
        order identifiers in the same request are ignored. (2) Else if
        `TrackingNumbers` is non-empty, only matching parcels are dispatched and
        order identifiers in the same request are ignored. (3) Else order-level
        dispatch uses `OrderIds` and/or `MerchantOrderIds` (existing behaviour).
        When both `TrackingNumbers` and `ParcelCodes` are sent, `ParcelCodes`
        are used. When dispatching by parcel identifiers, only matching parcels
        are dispatched; the rest of the order stays open.
      properties:
        HubCode:
          type: string
          description: >-
            When dispatching from multiple hubs, indicates for a given call
            which hub the related shipment will be dispatched from.
        OrderIds:
          type: array
          description: >-
            Global-e order IDs for order-level dispatch when you do not send
            parcel identifiers. Ignored when a non-empty `ParcelCodes` or
            `TrackingNumbers` list is used.
          items:
            type: string
        MerchantOrderIds:
          type: array
          description: >-
            Your eCommerce order numbers for order-level dispatch when you do
            not send parcel identifiers. For Shopify, use either the Shopify
            Order Name (default), e.g. #12345, or the Shopify Order Number, e.g.
            12345. Ignored when a non-empty `ParcelCodes` or `TrackingNumbers`
            list is used.
          items:
            type: string
        ParcelCodes:
          type: array
          description: >-
            Merchant parcel identifiers for the parcels to dispatch. Each code
            must match a parcel that is Received In Hub, belongs to your
            account, and when `HubCode` is supplied, belongs to that hub.
          items:
            type: string
        TrackingNumbers:
          type: array
          description: >-
            AWB or tracking numbers for the parcels to dispatch. Each number
            matches a parcel at parcel level, or at order level for
            single-parcel or consolidated orders where tracking is stored on the
            order. Parcels must be Received In Hub, belong to your account, and
            when `HubCode` is supplied, belong to that hub.
          items:
            type: string
    DispatchOrdersResponse:
      type: object
      title: DispatchOrdersResponse
      properties:
        IsSuccess:
          type: boolean
          description: Indicates whether the API call was successful.
        ErrorText:
          type: string
          nullable: true
          description: Description of the error for getting documents.
        ShipperManifests:
          type: array
          nullable: true
          description: List of OrderDocument objects that hold shipper manifest documents.
          items:
            $ref: '#/components/schemas/OrderDocument'
        Errors:
          type: array
          nullable: true
          description: >-
            The orders or parcels that could not be dispatched, one entry each.
            See [DispatchOrders error
            codes](/shipping-documents-api#dispatchorders-error-codes).
          items:
            $ref: '#/components/schemas/ShipperManifestError'
    OrderDocument:
      type: object
      title: OrderDocument
      properties:
        DocumentData:
          type: string
          description: Base64 encoded byte array representing the document file content.
        URL:
          type: string
          format: uri
          description: URL for the document.
        DocumentTypeCode:
          type: string
          description: >-
            Document type code. (Note: for PLT countries the commercial invoice
            is not returned in the response.) This value can be:
            CommercialInvoice = 1, PackingList = 2, ShipperManifest = 3, Label =
            4, VATInvoice = 5, DangerousGoodDeclarationLink = 6, GELabel = 7,
            CustomerReceiptInvoice = 8, ArchiveLabel = 9, DeliveryAdvice = 10.
          enum:
            - '1'
            - '2'
            - '3'
            - '4'
            - '5'
            - '6'
            - '7'
            - '8'
            - '9'
            - '10'
        DocumentTypeName:
          type: string
          description: >-
            Document type name, e.g. AWB, CommercialInvoiceAndPackingList or
            Manifest.
        DocumentExtension:
          type: string
          description: Document extension (pdf, zpl, epl).
        ErrorMessage:
          type: string
          nullable: true
          description: >-
            Description of the error for this entity (order/parcel) if it
            happened.
        ParcelCode:
          type: string
          description: The parcel code related to the document.
        ShippingServiceName:
          type: string
          description: The name of the shipping service for this document.
    ShipperManifestError:
      type: object
      title: ShipperManifestError
      properties:
        OrderID:
          type: string
          nullable: true
          description: The Global-e order ID the error refers to.
        ErrorCode:
          type: string
          example: B401
          description: >-
            The error code. See [DispatchOrders error
            codes](/shipping-documents-api#dispatchorders-error-codes).
        ErrorText:
          type: string
          description: Description of the error.
        MerchantOrderID:
          type: string
          nullable: true
          description: >-
            The merchant's order ID for the order. Empty or null when the order
            was not found.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.