> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/fulfillment.md).

# Fulfillment

Report 3PL pick and pack outcomes to ESW with the Fulfillment API. About 20 minutes.

The Fulfillment API lets retailers and third-party logistics (3PL) providers exchange warehouse updates with ESW. This quick start is for 3PL and warehouse management system (WMS) integrators. It covers the warehouse handover: reporting a completed pick and pack through `POST /v1/PickPack/Confirm`.

**Time:** about 20 minutes

**Environment:** sandbox

### Before you begin

* Your `tenantCode`
* Sandbox client credentials. The scope varies by API and client. Ask ESW which scope your Fulfillment client uses, then follow the [Authentication quick start](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/authentication.md)
* An ESW order reference (`eswOrderReference`) for an order ESW has sent to your system

{% hint style="info" %}
This guide covers pick and pack confirmation. For the other Fulfillment flows, see the tutorials for [synchronizing inventory](https://developer.esw.com/fulfillment-api/resources/tutorials/synchronizing-inventory.md) and [submitting an Advanced Shipping Notice](https://developer.esw.com/fulfillment-api/resources/tutorials/submitting-an-advanced-shipping-notice.md).
{% endhint %}

{% stepper %}
{% step %}

#### Get an access token

Request a token with the scope ESW enabled for your Fulfillment client, using the request from the [Authentication quick start](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/authentication.md). Store it in `ESW_TOKEN`.
{% endstep %}

{% step %}

#### Confirm a successful pick and pack

Call this endpoint when picking and packing is **complete**. Every item must be picked or have a recorded pick failure. Pack the goods and stage the parcels for carrier collection. Your system calls ESW. ESW does not call this endpoint.

Save this body as `confirm.json`.

{% code expandable="true" %}

```json
{
  "confirmationId": "PPK-78542-WH01-20261002091500",
  "confirmationDateTime": "2026-10-02T09:15:00.000Z",
  "eswOrderReference": "<eswOrderReference>",
  "tenantCode": "<tenantCode>",
  "pickPackResponse": {
    "status": "Confirmed",
    "failureReason": "None",
    "itemsResult": [
      {
        "productCode": "SKU-00123",
        "quantityConfirmed": 1,
        "quantityFailed": 0,
        "status": "Success",
        "failureReason": "NotDefined"
      }
    ]
  }
}
```

{% endcode %}

The order-level and item-level `failureReason` fields use different lists. At order level, `None` means no failure. At item level, the equivalent is `NotDefined`.

```sh
curl --request POST "https://api.sandbox.esw.com/v1/PickPack/Confirm" \
  --header "Authorization: Bearer $ESW_TOKEN" \
  --header "Content-Type: application/json" \
  --data @confirm.json
```

The endpoint returns `202 Accepted`. It confirms ESW accepted the update for processing. It does not confirm that a later carrier or label step has completed.

| Field                  | Required | Description                                                                    |
| ---------------------- | -------- | ------------------------------------------------------------------------------ |
| `confirmationId`       | Yes      | Your unique identifier for this pick-and-pack event. It is the idempotency key |
| `eswOrderReference`    | Yes      | The ESW order reference this confirmation relates to                           |
| `tenantCode`           | Yes      | The brand or tenant code                                                       |
| `pickPackResponse`     | Yes      | The pick-and-pack outcome. Its `status` field is required                      |
| `confirmationDateTime` | No       | When packing finished in the warehouse, in ISO 8601 UTC                        |

After `Confirmed`, ESW marks the order as picked and packed. It then moves to the next fulfillment step, such as carrier booking or label generation.
{% endstep %}

{% step %}

#### Report a partial result

Use `PartialResult` when some items are packed and others are not. Include every ordered item in `itemsResult`.

{% code expandable="true" %}

```json
{
  "confirmationId": "PPK-78543-WH01-20261002092200",
  "confirmationDateTime": "2026-10-02T09:22:00.000Z",
  "eswOrderReference": "<eswOrderReference>",
  "tenantCode": "<tenantCode>",
  "pickPackResponse": {
    "status": "PartialResult",
    "itemsResult": [
      {
        "productCode": "SKU-00123",
        "quantityConfirmed": 1,
        "quantityFailed": 0,
        "status": "Success",
        "failureReason": "NotDefined"
      },
      {
        "productCode": "SKU-00456",
        "quantityConfirmed": 2,
        "quantityFailed": 1,
        "status": "PartialResult",
        "failureReason": "Damaged",
        "problemMessage": "One unit has a broken buckle. Moved to quarantine."
      }
    ]
  }
}
```

{% endcode %}

ESW ships the packed items. It handles failed units based on `failureReason`, such as through a refund, reallocation, or customer service.
{% endstep %}

{% step %}

#### Retry safely

If a request times out, resend it with the **same** `confirmationId`. ESW recognizes the duplicate and does not apply the operation twice.

| `status` and `failureReason`         | Retry?  | What to do                                                        |
| ------------------------------------ | ------- | ----------------------------------------------------------------- |
| `Confirmed`                          | No      | Nothing more to send                                              |
| `AcceptedForProcessing`              | Not yet | Send the final status later, using a new `confirmationId`         |
| `Failed` with `TransientError`       | Yes     | Retry after a short delay with the same `confirmationId`          |
| `Failed` or `TimeOut` with `TimeOut` | Yes     | Retry after a longer delay with the same `confirmationId`         |
| `Failed` with `_3PLNotConfigured`    | No      | Escalate. ESW must fix the configuration                          |
| `BadAddress`                         | No      | Wait for an address correction. Do not retry until it is resolved |
| `BadRequest`                         | No      | Investigate the order reference mismatch                          |
| `PartialResult`                      | No      | Do not resend it. Preserve every item and its reported outcome.   |

An `AcceptedForProcessing` update and its final update are separate events. Use a new `confirmationId` for the final update. Reuse an ID only when retrying the same request after a timeout or transient failure.
{% endstep %}
{% endstepper %}

### Choose the right status

| `pickPackResponse.status` | Use it when                                                                           |
| ------------------------- | ------------------------------------------------------------------------------------- |
| `AcceptedForProcessing`   | Your WMS is asynchronous. You accepted the instruction and will send the result later |
| `Confirmed`               | Every item was picked and packed at the right quantity                                |
| `PartialResult`           | At least one item was packed and at least one item could not be                       |
| `Failed`                  | The whole operation failed and nothing was picked, for example a WMS outage           |
| `BadRequest`              | The order reference is unknown to your system                                         |
| `BadAddress`              | The carrier rejected the destination address                                          |
| `TimeOut`                 | The operation did not finish in the expected window                                   |

### Rules that prevent first-call errors

* **`confirmationId` is per pick-and-pack event, not per order.** An order packed in several waves needs a separate `confirmationId` for each wave. Include the order reference and pack station identifier to simplify debugging.
* **Send the real packing time** in `confirmationDateTime`, not the time of the API call. ESW uses it for SLA tracking and audit.
* **`PartialResult` needs `itemsResult`.** List every ordered item, including the ones that succeeded. For each item, `quantityConfirmed` plus `quantityFailed` must equal the quantity ordered.
* **Send `itemsResult` on `Confirmed` too.** It is optional there, but it gives ESW a full audit trail.
* **Choose the item `failureReason` that matches what happened.** Use `NotFound` for an empty pick face and `Damaged` for an unsellable item. Use `EndOfDay` for a closed pick wave, `OperationalCancel` for a cancellation by your system, and `ReallocatedExclude` for an item moved to another order or wave.
* **Use `CancelledItem` only for items canceled before picking** by ESW, the retailer, or the shopper. ESW treats it as acknowledging a cancellation, and the refund process may already have started. Do not use it to mean that you could not find or pack the item.

### Common errors

| Status                                                                    | Cause                                         | Fix                                                     |
| ------------------------------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------- |
| `400`: `confirmationId`, `eswOrderReference`, or `tenantCode` is required | A required field is missing                   | Include a non-empty value for the missing field         |
| `400`: `pickPackResponse.status` is required                              | `status` is missing inside `pickPackResponse` | Add `status`                                            |
| `400`: invalid `status` value                                             | Unknown enum value                            | Use one of the seven values in the table above          |
| `401`                                                                     | Token missing or invalid                      | Send `Authorization: Bearer <token>` with a valid token |

### Next steps

* Review every status and failure reason in [Response Status and Failure Reasons](https://developer.esw.com/fulfillment-api/fulfillment-api/concepts/response-status-and-failure-reasons.md)
* Read the full [Confirming Pick & Pack](https://developer.esw.com/fulfillment-api/resources/tutorials/confirming-pick-and-pack.md) tutorial
* Return to the [Quick Start Guide](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/fulfillment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
