Commit a warehouse transfer order

Operation ID: commitTransferOrder

Group: Inventory › Warehouse Transfer Orders

Open in the interactive reference

POST /inventory/warehouse-transfer-orders/{id}/commit

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Commits a warehouse transfer order, converting it into a draft warehouse transfer. Creates a warehouse transfer for everything the order still has open and sets the order to 'IN_TRANSFER'. transferId is the new transfer's id and transferDocumentNumber its number.

The transfer is a draft and moves nothing until you commit it with POST inventory/warehouse-transfers/:id/commit. Committing the transfer updates the order's processed and open quantities.

Every line with open quantity needs a source warehouse that differs from its destination. If any line is at 'NEEDS_SOURCE' or has no locationId, the request fails with UNRESOLVED_SOURCE_LINES. To fix such a line on a 'DRAFT' order, remove it with deleteLines and add a replacement with a locationId through createLines in one PATCH inventory/warehouse-transfer-orders/:id request, then send this request again.

Only an order at 'DRAFT' or 'PARTIALLY_PROCESSED' can be converted. While its transfer is uncommitted the order is 'IN_TRANSFER', and a second request fails. If the transfer commits less than was asked for, the order becomes 'PARTIALLY_PROCESSED', and this endpoint then creates a transfer for what is left.

Parameters

Name In Type Required Description
Api-Version header string · v1 yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.
id path string yes The unique identifier of the transfer order you want to convert.

Response

200 Success

Under data (commitTransferOrderOutput):

Field Type Required Description
id string yes The unique identifier for the transfer order. Example: "7c1e5a90-3d24-4f68-b0a7-91e5d2c46f38".
documentStatus string yes The status of the transfer order, read back from the document. 'IN_TRANSFER' on success: the transfer this created has the open quantity and has yet to commit. Example: "IN_TRANSFER".
transferId string no The warehouse transfer this created. See id on GET inventory/warehouse-transfers/:id. It is a draft and moves nothing until it is committed in its own right. Example: "5b2e9d14-8a37-4c06-91f5-2d7b3e08a6c9".
transferDocumentNumber string no The number of that transfer. Example: "WT-2287".
{
  "data": {
    "id": "7c1e5a90-3d24-4f68-b0a7-91e5d2c46f38",
    "documentStatus": "IN_TRANSFER",
    "transferId": "5b2e9d14-8a37-4c06-91f5-2d7b3e08a6c9",
    "transferDocumentNumber": "WT-2287"
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Response headers

Errors

Code Status
NOT_FOUND 400
WRONG_STATUS 400
NO_LINES 400
UNRESOLVED_SOURCE_LINES 400
CONVERSION_REJECTED 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses