> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/oms/commands/oms-package-command-matrix.md).

# OMS Package Command Matrix

This guide summarizes all commands that can be run on OMS packages. For each command, it shows which package statuses the command can be applied to, which status the package moves to afterwards, and which error is returned when the command cannot be applied.

## Overview

Package commands drive a package through its lifecycle, from planning and preparation to packaging, shipping, delivery, and replanning. Each command is a state transition: it starts from the package's current status and, when it succeeds, moves the package to a destination status (or updates package data without changing the status).

This guide covers:

* [How commands become available on a package](#how-commands-become-available-on-a-package)
* [How to read the matrix](#how-to-read-the-matrix)
* [Command abbreviations](#command-abbreviations)
* [Command matrix by group](#command-matrix-by-group)
* [Status-based quick reference](#status-based-quick-reference)
* [Status glossary](#status-glossary)
* [Command conditions](#command-conditions)
* [Error codes](#error-codes)

## How Commands Become Available on a Package

1. **Commands are defined per customer.** For a command to appear on a package, a state transition starting from the package's current status must be defined for that customer. The matrix shows every status a command can be applied to; a given customer may have only some of these transitions defined.
2. **Commands visible on a package = defined transitions − transitions blocked by a condition.** The transitions defined for the package's current status are listed. If a transition has a condition attached (see [Command conditions](#command-conditions)) and the package does not meet it, the command is not listed.
3. **Error responses.** When a command cannot be applied, the response contains an error code (`error_code`) and a description. Common error codes are listed in [Error codes](#error-codes).

### Transitions Defined in the Default Setup

The following transitions are defined by default. All other transitions are added based on customer requirements.

| Command                                 | Transition            |
| --------------------------------------- | --------------------- |
| `COMPLETE_PACKAGING`                    | 100 → 500             |
| `COMPLETE_PACKAGING_WITHOUT_SHIPMENT`   | 100 → 500             |
| `SHIP_THE_PACKAGE`                      | 500 → 700             |
| `DETECTED_OUT_OF_STOCK_ITEM`            | 100 → 920             |
| `UPDATE_PACKAGE_SHIPMENT_STATUS`        | 700 → 800             |
| `RENEW_PACKAGE_PLAN`                    | 920 → 900, 1000 → 900 |
| `TRANSFERS_ARRIVED`                     | 300 → 100             |
| `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND` | 610 → 800             |
| `READY_FOR_PICKUP`                      | 500 → 610             |
| `UPDATE_INVOICE_OF_THE_PACKAGE`         | 500 → 500, 700 → 700  |
| `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 100 → 900             |

## How to Read the Matrix

* **Row:** The package's status **before** the command runs (current status).
* **Cell:** The status the package moves to **after** the command runs successfully.

| Notation   | Meaning                                                                                                                                                                   |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `500`      | The command runs; the package moves to this status afterwards.                                                                                                            |
| `500/510`  | The destination depends on the context (customer setting, whether a cargo label exists, the defined transition, etc.).                                                    |
| `920→900`  | The package first moves to the first status, then to the second status through an automatic replan.                                                                       |
| `⁺`        | The command creates new package(s); the cell shows the final status of the original package.                                                                              |
| `=`        | The status does not change; the command only updates data (invoice, shipment information, label).                                                                         |
| `previous` | The package returns to the status it had before it was blocked.                                                                                                           |
| `✗`        | A transition can be defined for this status, but the command is rejected when run (`package_100_5`).                                                                      |
| `—`        | Not applicable. The command cannot be defined for this status (`commands_100_1`). If the command is run while the package is in this status, `package_100_5` is returned. |

> **Note:** `PACKAGE_SYNC_OMNITRON_STATUS` (SYNC) can run in every status. It aligns the package status with the status of the order item in Omnitron. For readability, it is not repeated in the tables below.

## Command Abbreviations

| Abbreviation | Command slug                            | Group            |
| ------------ | --------------------------------------- | ---------------- |
| ACCEPT       | `ACCEPT_PACKAGING`                      | Preparation      |
| PST          | `PKG_STATE_TRANSITION`                  | Preparation      |
| DEALLOC      | `PKG_DEALLOCATE_RESERVATIONS`           | Preparation      |
| PREPARE      | `PREPARE_PACKAGE_COMMAND`               | Preparation      |
| STALE        | `MARK_STALE_PACKAGES`                   | Preparation      |
| MERGE        | `MERGE_SAME_LOCATION_PACKAGES`          | Preparation      |
| TRF\_ARR     | `TRANSFERS_ARRIVED`                     | Preparation      |
| BLOCK        | `BLOCK_THE_PACKAGE`                     | Preparation      |
| UNBLOCK      | `UNBLOCK_THE_PACKAGE`                   | Preparation      |
| CP           | `COMPLETE_PACKAGING`                    | Packaging        |
| CP\_NOSHIP   | `COMPLETE_PACKAGING_WITHOUT_SHIPMENT`   | Packaging        |
| CP\_CHAN     | `CHANNEL_BASED_COMPLETE_PACKAGING`      | Packaging        |
| LABEL        | `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE`  | Packaging        |
| SHIP         | `SHIP_THE_PACKAGE`                      | Shipping         |
| SHIP\_ADV    | `SHIP_THE_PACKAGE_ADVANCED`             | Shipping         |
| SHIP\_BSC    | `SHIP_THE_PACKAGE_BASIC`                | Shipping         |
| SHIP\_INFO   | `UPDATE_SHIPMENT_INFO_OF_THE_PACKAGE`   | Shipping         |
| SHIP\_RECR   | `RECREATE_SHIPMENT_OF_THE_PACKAGE`      | Shipping         |
| SHIP\_STAT   | `UPDATE_PACKAGE_SHIPMENT_STATUS`        | Delivery         |
| DELIVER      | `DELIVER_PACKAGE`                       | Delivery         |
| PICKUP       | `READY_FOR_PICKUP`                      | Delivery         |
| SELF\_DLV    | `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND` | Delivery         |
| OOS          | `DETECTED_OUT_OF_STOCK_ITEM`            | Stock / Replan   |
| OOS\_ADV     | `DETECTED_OUT_OF_STOCK_ITEM_ADVANCED`   | Stock / Replan   |
| MISSING      | `REPORT_MISSING_ITEM_COMMAND`           | Stock / Replan   |
| BLACKLST     | `BLACKLIST_ITEM`                        | Stock / Replan   |
| REFUSE       | `REFUSE_PACKAGE`                        | Stock / Replan   |
| RENEW        | `RENEW_PACKAGE_PLAN`                    | Stock / Replan   |
| ASSIGN       | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | Stock / Replan   |
| REPLACE      | `REPLACE_PRODUCT`                       | Stock / Replan   |
| TRF\_CNCL    | `CANCEL_TRANSFER_ORDER_RENEW_PACKAGE`   | Stock / Replan   |
| PFR          | `PACKED_FOR_REFUND`                     | Refund / Invoice |
| INVOICE      | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Refund / Invoice |
| SYNC         | `PACKAGE_SYNC_OMNITRON_STATUS`          | Sync             |

## Command Matrix by Group

Each table lists only the statuses where at least one command in the group is applicable.

### Preparation

| Current status                   | ACCEPT | PST     | DEALLOC | PREPARE | STALE | MERGE | TRF\_ARR | BLOCK | UNBLOCK  |
| -------------------------------- | ------ | ------- | ------- | ------- | ----- | ----- | -------- | ----- | -------- |
| 100 waiting                      | 110    | 150/200 | 200     | 200⁺    | 105   | 900⁺  | —        | 1200  | —        |
| 110 accepted                     | —      | 150/200 | 200     | 200⁺    | —     | —     | —        | 1200  | —        |
| 150 waiting\_remote\_action      | —      | 200     | —       | —       | —     | —     | —        | 1200  | —        |
| 200 preparing                    | —      | —       | —       | —       | —     | —     | —        | 1200  | —        |
| 300 waiting\_transfer\_operation | —      | —       | —       | —       | —     | —     | 100      | —     | —        |
| 400 ready\_to\_pack              | —      | —       | —       | —       | —     | —     | —        | 1200  | —        |
| 1200 blocked                     | —      | —       | —       | —       | —     | —     | —        | —     | previous |

### Packaging

| Current status            | CP      | CP\_NOSHIP | CP\_CHAN | LABEL   |
| ------------------------- | ------- | ---------- | -------- | ------- |
| 100 waiting               | 500/510 | 500        | 500      | —       |
| 110 accepted              | 500/510 | 500        | 500      | —       |
| 200 preparing             | 500/510 | 500        | 500      | =       |
| 400 ready\_to\_pack       | 500/510 | 500        | 500      | —       |
| 500 packed                | —       | —          | —        | =       |
| 510 waiting\_cargo\_label | —       | —          | —        | 500/700 |
| 700 shipped               | —       | —          | —        | =       |

### Shipping

| Current status          | SHIP | SHIP\_ADV | SHIP\_BSC | SHIP\_INFO | SHIP\_RECR |
| ----------------------- | ---- | --------- | --------- | ---------- | ---------- |
| 500 packed              | 700  | 700/510   | 700       | =          | =          |
| 700 shipped             | —    | —         | —         | =          | =          |
| 710 delivery\_failed    | —    | —         | —         | =          | =          |
| 720 attempted\_delivery | —    | —         | —         | =          | =          |

### Delivery

| Current status                   | SHIP\_STAT | DELIVER | PICKUP | SELF\_DLV |
| -------------------------------- | ---------- | ------- | ------ | --------- |
| 100 waiting                      | —          | —       | 610    | 800       |
| 105 stale\_waiting               | —          | 800/610 | —      | —         |
| 110 accepted                     | —          | —       | 610    | 800       |
| 200 preparing                    | —          | —       | —      | 800       |
| 500 packed                       | —          | —       | 610    | 800       |
| 610 ready\_for\_customer\_pickup | —          | —       | —      | 800       |
| 700 shipped                      | 800/710    | 800/610 | 610    | —         |
| 710 delivery\_failed             | 800/710    | 800/610 | —      | —         |
| 720 attempted\_delivery          | 800/710    | —       | —      | —         |
| 800 delivered                    | ✗          | —       | —      | —         |

### Stock / Replan

| Current status                   | OOS      | OOS\_ADV | MISSING  | BLACKLST | REFUSE | RENEW | ASSIGN | REPLACE | TRF\_CNCL |
| -------------------------------- | -------- | -------- | -------- | -------- | ------ | ----- | ------ | ------- | --------- |
| 100 waiting                      | 920→900⁺ | 920⁺     | 920/900⁺ | 920⁺     | 1000   | —     | 900⁺   | 900⁺    | —         |
| 105 stale\_waiting               | —        | —        | —        | —        | —      | 900⁺  | —      | —       | —         |
| 110 accepted                     | 920→900⁺ | 920⁺     | 920/900⁺ | 920⁺     | 1000   | —     | 900⁺   | 900⁺    | —         |
| 150 waiting\_remote\_action      | —        | —        | 920/900⁺ | —        | 1000   | —     | 900⁺   | —       | —         |
| 200 preparing                    | 920→900⁺ | 920⁺     | 920/900⁺ | —        | 1000   | —     | 900⁺   | —       | —         |
| 300 waiting\_transfer\_operation | —        | —        | —        | —        | —      | —     | 900⁺   | —       | 920→900⁺  |
| 400 ready\_to\_pack              | 920→900⁺ | 920⁺     | —        | —        | —      | —     | —      | —       | —         |
| 910 defective\_products          | —        | —        | —        | —        | —      | 900⁺  | 900⁺   | —       | —         |
| 920 out\_of\_stock\_products     | —        | —        | —        | —        | —      | 900⁺  | 900⁺   | —       | —         |
| 1000 needs\_replan               | —        | —        | —        | —        | —      | 900⁺  | 900⁺   | —       | —         |

### Refund / Invoice

| Current status                   | PFR  | INVOICE |
| -------------------------------- | ---- | ------- |
| 100 waiting                      | 1100 | —       |
| 110 accepted                     | 1100 | —       |
| 300 waiting\_transfer\_operation | —    | =       |
| 500 packed                       | —    | =       |
| 610 ready\_for\_customer\_pickup | —    | =       |
| 700 shipped                      | —    | =       |
| 720 attempted\_delivery          | —    | =       |
| 800 delivered                    | —    | =       |
| 920 out\_of\_stock\_products     | 1100 | —       |
| 1100 packed\_for\_refund         | —    | =       |

> **Note:** There are no package commands for the `520 waiting_invoice_creation`, `850 cancellation_waiting`, `900 cancelled`, `1300 refund`, and `1310 refund_waiting` statuses. Packages are moved into these statuses by the order cancellation/refund flow or by cargo tracking (see [Status glossary](#status-glossary)).

## Status-Based Quick Reference

This is the list view of the matrix: for each current status, the commands that can be run and the status the package moves to afterwards.

| Current status                       | Command                                 | Status after the command                                          |
| ------------------------------------ | --------------------------------------- | ----------------------------------------------------------------- |
| **100 waiting**                      | `ACCEPT_PACKAGING`                      | 110 accepted                                                      |
|                                      | `PKG_STATE_TRANSITION`                  | 150 waiting\_remote\_action or 200 preparing                      |
|                                      | `PKG_DEALLOCATE_RESERVATIONS`           | 200 preparing                                                     |
|                                      | `PREPARE_PACKAGE_COMMAND`               | 200 preparing + new package(s)                                    |
|                                      | `MARK_STALE_PACKAGES`                   | 105 stale\_waiting                                                |
|                                      | `MERGE_SAME_LOCATION_PACKAGES`          | 900 cancelled + new package(s)                                    |
|                                      | `BLOCK_THE_PACKAGE`                     | 1200 blocked                                                      |
|                                      | `COMPLETE_PACKAGING`                    | 500 packed or 510 waiting\_cargo\_label                           |
|                                      | `COMPLETE_PACKAGING_WITHOUT_SHIPMENT`   | 500 packed                                                        |
|                                      | `CHANNEL_BASED_COMPLETE_PACKAGING`      | 500 packed                                                        |
|                                      | `READY_FOR_PICKUP`                      | 610 ready\_for\_customer\_pickup                                  |
|                                      | `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND` | 800 delivered                                                     |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM`            | 920 out\_of\_stock\_products, then 900 cancelled + new package(s) |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM_ADVANCED`   | 920 out\_of\_stock\_products + new package(s)                     |
|                                      | `REPORT_MISSING_ITEM_COMMAND`           | 920 out\_of\_stock\_products or 900 cancelled + new package(s)    |
|                                      | `BLACKLIST_ITEM`                        | 920 out\_of\_stock\_products + new package(s)                     |
|                                      | `REFUSE_PACKAGE`                        | 1000 needs\_replan                                                |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
|                                      | `REPLACE_PRODUCT`                       | 900 cancelled + new package(s)                                    |
|                                      | `PACKED_FOR_REFUND`                     | 1100 packed\_for\_refund                                          |
| **105 stale\_waiting**               | `DELIVER_PACKAGE`                       | 800 delivered or 610 ready\_for\_customer\_pickup                 |
|                                      | `RENEW_PACKAGE_PLAN`                    | 900 cancelled + new package(s)                                    |
| **110 accepted**                     | `PKG_STATE_TRANSITION`                  | 150 waiting\_remote\_action or 200 preparing                      |
|                                      | `PKG_DEALLOCATE_RESERVATIONS`           | 200 preparing                                                     |
|                                      | `PREPARE_PACKAGE_COMMAND`               | 200 preparing + new package(s)                                    |
|                                      | `BLOCK_THE_PACKAGE`                     | 1200 blocked                                                      |
|                                      | `COMPLETE_PACKAGING`                    | 500 packed or 510 waiting\_cargo\_label                           |
|                                      | `COMPLETE_PACKAGING_WITHOUT_SHIPMENT`   | 500 packed                                                        |
|                                      | `CHANNEL_BASED_COMPLETE_PACKAGING`      | 500 packed                                                        |
|                                      | `READY_FOR_PICKUP`                      | 610 ready\_for\_customer\_pickup                                  |
|                                      | `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND` | 800 delivered                                                     |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM`            | 920 out\_of\_stock\_products, then 900 cancelled + new package(s) |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM_ADVANCED`   | 920 out\_of\_stock\_products + new package(s)                     |
|                                      | `REPORT_MISSING_ITEM_COMMAND`           | 920 out\_of\_stock\_products or 900 cancelled + new package(s)    |
|                                      | `BLACKLIST_ITEM`                        | 920 out\_of\_stock\_products + new package(s)                     |
|                                      | `REFUSE_PACKAGE`                        | 1000 needs\_replan                                                |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
|                                      | `REPLACE_PRODUCT`                       | 900 cancelled + new package(s)                                    |
|                                      | `PACKED_FOR_REFUND`                     | 1100 packed\_for\_refund                                          |
| **150 waiting\_remote\_action**      | `PKG_STATE_TRANSITION`                  | 200 preparing                                                     |
|                                      | `BLOCK_THE_PACKAGE`                     | 1200 blocked                                                      |
|                                      | `REPORT_MISSING_ITEM_COMMAND`           | 920 out\_of\_stock\_products or 900 cancelled + new package(s)    |
|                                      | `REFUSE_PACKAGE`                        | 1000 needs\_replan                                                |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
| **200 preparing**                    | `BLOCK_THE_PACKAGE`                     | 1200 blocked                                                      |
|                                      | `COMPLETE_PACKAGING`                    | 500 packed or 510 waiting\_cargo\_label                           |
|                                      | `COMPLETE_PACKAGING_WITHOUT_SHIPMENT`   | 500 packed                                                        |
|                                      | `CHANNEL_BASED_COMPLETE_PACKAGING`      | 500 packed                                                        |
|                                      | `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE`  | Unchanged (data is updated)                                       |
|                                      | `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND` | 800 delivered                                                     |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM`            | 920 out\_of\_stock\_products, then 900 cancelled + new package(s) |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM_ADVANCED`   | 920 out\_of\_stock\_products + new package(s)                     |
|                                      | `REPORT_MISSING_ITEM_COMMAND`           | 920 out\_of\_stock\_products or 900 cancelled + new package(s)    |
|                                      | `REFUSE_PACKAGE`                        | 1000 needs\_replan                                                |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
| **300 waiting\_transfer\_operation** | `TRANSFERS_ARRIVED`                     | 100 waiting                                                       |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
|                                      | `CANCEL_TRANSFER_ORDER_RENEW_PACKAGE`   | 920 out\_of\_stock\_products, then 900 cancelled + new package(s) |
|                                      | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Unchanged (data is updated)                                       |
| **400 ready\_to\_pack**              | `BLOCK_THE_PACKAGE`                     | 1200 blocked                                                      |
|                                      | `COMPLETE_PACKAGING`                    | 500 packed or 510 waiting\_cargo\_label                           |
|                                      | `COMPLETE_PACKAGING_WITHOUT_SHIPMENT`   | 500 packed                                                        |
|                                      | `CHANNEL_BASED_COMPLETE_PACKAGING`      | 500 packed                                                        |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM`            | 920 out\_of\_stock\_products, then 900 cancelled + new package(s) |
|                                      | `DETECTED_OUT_OF_STOCK_ITEM_ADVANCED`   | 920 out\_of\_stock\_products + new package(s)                     |
| **500 packed**                       | `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE`  | Unchanged (data is updated)                                       |
|                                      | `SHIP_THE_PACKAGE`                      | 700 shipped                                                       |
|                                      | `SHIP_THE_PACKAGE_ADVANCED`             | 700 shipped or 510 waiting\_cargo\_label                          |
|                                      | `SHIP_THE_PACKAGE_BASIC`                | 700 shipped                                                       |
|                                      | `UPDATE_SHIPMENT_INFO_OF_THE_PACKAGE`   | Unchanged (data is updated)                                       |
|                                      | `RECREATE_SHIPMENT_OF_THE_PACKAGE`      | Unchanged (data is updated)                                       |
|                                      | `READY_FOR_PICKUP`                      | 610 ready\_for\_customer\_pickup                                  |
|                                      | `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND` | 800 delivered                                                     |
|                                      | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Unchanged (data is updated)                                       |
| **510 waiting\_cargo\_label**        | `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE`  | 500 packed or 700 shipped                                         |
| **610 ready\_for\_customer\_pickup** | `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND` | 800 delivered                                                     |
|                                      | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Unchanged (data is updated)                                       |
| **700 shipped**                      | `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE`  | Unchanged (data is updated)                                       |
|                                      | `UPDATE_SHIPMENT_INFO_OF_THE_PACKAGE`   | Unchanged (data is updated)                                       |
|                                      | `RECREATE_SHIPMENT_OF_THE_PACKAGE`      | Unchanged (data is updated)                                       |
|                                      | `UPDATE_PACKAGE_SHIPMENT_STATUS`        | 800 delivered or 710 delivery\_failed                             |
|                                      | `DELIVER_PACKAGE`                       | 800 delivered or 610 ready\_for\_customer\_pickup                 |
|                                      | `READY_FOR_PICKUP`                      | 610 ready\_for\_customer\_pickup                                  |
|                                      | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Unchanged (data is updated)                                       |
| **710 delivery\_failed**             | `UPDATE_SHIPMENT_INFO_OF_THE_PACKAGE`   | Unchanged (data is updated)                                       |
|                                      | `RECREATE_SHIPMENT_OF_THE_PACKAGE`      | Unchanged (data is updated)                                       |
|                                      | `UPDATE_PACKAGE_SHIPMENT_STATUS`        | 800 delivered or 710 delivery\_failed                             |
|                                      | `DELIVER_PACKAGE`                       | 800 delivered or 610 ready\_for\_customer\_pickup                 |
| **720 attempted\_delivery**          | `UPDATE_SHIPMENT_INFO_OF_THE_PACKAGE`   | Unchanged (data is updated)                                       |
|                                      | `RECREATE_SHIPMENT_OF_THE_PACKAGE`      | Unchanged (data is updated)                                       |
|                                      | `UPDATE_PACKAGE_SHIPMENT_STATUS`        | 800 delivered or 710 delivery\_failed                             |
|                                      | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Unchanged (data is updated)                                       |
| **800 delivered**                    | `UPDATE_PACKAGE_SHIPMENT_STATUS`        | Rejected (`package_100_5`)                                        |
|                                      | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Unchanged (data is updated)                                       |
| **910 defective\_products**          | `RENEW_PACKAGE_PLAN`                    | 900 cancelled + new package(s)                                    |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
| **920 out\_of\_stock\_products**     | `RENEW_PACKAGE_PLAN`                    | 900 cancelled + new package(s)                                    |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
|                                      | `PACKED_FOR_REFUND`                     | 1100 packed\_for\_refund                                          |
| **1000 needs\_replan**               | `RENEW_PACKAGE_PLAN`                    | 900 cancelled + new package(s)                                    |
|                                      | `ASSIGN_PACKAGE_ITEMS_MANUALLY`         | 900 cancelled + new package(s)                                    |
| **1100 packed\_for\_refund**         | `UPDATE_INVOICE_OF_THE_PACKAGE`         | Unchanged (data is updated)                                       |
| **1200 blocked**                     | `UNBLOCK_THE_PACKAGE`                   | Status before the block                                           |

> **Note:** `PACKAGE_SYNC_OMNITRON_STATUS` is not repeated in this table because it can run in all statuses. The following statuses have no other package commands: `520 waiting_invoice_creation`, `850 cancellation_waiting`, `900 cancelled`, `1300 refund`, `1310 refund_waiting`.

## Status Glossary

| Code | Status                       | Meaning / how the package enters it                                                                                                                                  | How the package leaves it                                                                                                                    |
| ---- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| 100  | `waiting`                    | The first status of a package after planning. The package also returns here when transfers are completed (`TRANSFERS_ARRIVED`).                                      | Preparation, packaging, out-of-stock, block, refusal, refund, etc.                                                                           |
| 105  | `stale_waiting`              | The package has been waiting for too long (`MARK_STALE_PACKAGES`); its reservations are released.                                                                    | `RENEW_PACKAGE_PLAN`, `DELIVER_PACKAGE`                                                                                                      |
| 110  | `accepted`                   | The store has accepted the package (`ACCEPT_PACKAGING`).                                                                                                             | Largely the same commands as 100                                                                                                             |
| 150  | `waiting_remote_action`      | The package has been handed over to an external system (`PKG_STATE_TRANSITION`).                                                                                     | `PKG_STATE_TRANSITION`, block, refusal, missing item                                                                                         |
| 200  | `preparing`                  | Picking has started.                                                                                                                                                 | Packaging, out-of-stock, block, refusal, delivery (click & collect)                                                                          |
| 300  | `waiting_transfer_operation` | Planning requires a transfer; the package is waiting for transfers.                                                                                                  | `TRANSFERS_ARRIVED` (automatically, once no active transfer remains), `CANCEL_TRANSFER_ORDER_RENEW_PACKAGE`, `ASSIGN_PACKAGE_ITEMS_MANUALLY` |
| 400  | `ready_to_pack`              | Ready for packaging. Occurs as the starting status of a packaging scenario or when a block is removed.                                                               | Packaging, out-of-stock, block                                                                                                               |
| 500  | `packed`                     | All items have been packed.                                                                                                                                          | Shipping, click & collect, invoice/shipment updates                                                                                          |
| 510  | `waiting_cargo_label`        | Packed/shipped but without a cargo label (for customers with the pending cargo label flow enabled).                                                                  | `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE`                                                                                                       |
| 520  | `waiting_invoice_creation`   | Not used in the standard flow; can only occur with a customer-specific definition.                                                                                   | —                                                                                                                                            |
| 610  | `ready_for_customer_pickup`  | The click & collect package is ready at the store (`READY_FOR_PICKUP`, or delivery/cargo tracking while the click & collect setting is enabled).                     | `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND`                                                                                                      |
| 700  | `shipped`                    | Handed over to the carrier.                                                                                                                                          | Delivery commands, cargo tracking, shipment information updates                                                                              |
| 710  | `delivery_failed`            | Delivery failed (failure/cancellation information from the carrier, or a failed delivery reported via `UPDATE_PACKAGE_SHIPMENT_STATUS`).                             | `DELIVER_PACKAGE`, `UPDATE_PACKAGE_SHIPMENT_STATUS`                                                                                          |
| 720  | `attempted_delivery`         | Delivery was attempted; set only by cargo tracking.                                                                                                                  | `UPDATE_PACKAGE_SHIPMENT_STATUS`, invoice/shipment updates                                                                                   |
| 800  | `delivered`                  | Delivered.                                                                                                                                                           | Invoice update only; refund flow (→ 1310)                                                                                                    |
| 850  | `cancellation_waiting`       | The order cancellation is being processed. A package with a shipment enters this status only if all of its items are being cancelled and it is in 100, 200, or 1000. | 900 / 1000 when the plan is completed; the previous status if reverted                                                                       |
| 900  | `cancelled`                  | Terminal. Entered through order cancellation, replan, merge, manual assignment, product replacement, or Omnitron sync.                                               | —                                                                                                                                            |
| 910  | `defective_products`         | A defective product was reported (out-of-stock commands, if 910 is defined as the destination).                                                                      | `RENEW_PACKAGE_PLAN`, `ASSIGN_PACKAGE_ITEMS_MANUALLY`                                                                                        |
| 920  | `out_of_stock_products`      | Out of stock was reported.                                                                                                                                           | `RENEW_PACKAGE_PLAN`, `ASSIGN_PACKAGE_ITEMS_MANUALLY`, `PACKED_FOR_REFUND`                                                                   |
| 1000 | `needs_replan`               | The package must be replanned (store refusal, partial cancellation).                                                                                                 | `RENEW_PACKAGE_PLAN`, `ASSIGN_PACKAGE_ITEMS_MANUALLY`                                                                                        |
| 1100 | `packed_for_refund`          | Packed for refund (`PACKED_FOR_REFUND`). The refund itself is processed separately.                                                                                  | Invoice update; refund flow                                                                                                                  |
| 1200 | `blocked`                    | Put on hold (`BLOCK_THE_PACKAGE`); reservations are kept.                                                                                                            | `UNBLOCK_THE_PACKAGE`                                                                                                                        |
| 1300 | `refund`                     | Refund completed (order refund or Omnitron sync). Terminal.                                                                                                          | —                                                                                                                                            |
| 1310 | `refund_waiting`             | The refund plan is being processed. Entered only from 500/510/610/700/710/720/800; otherwise the refund is rejected.                                                 | 1300 when the plan is completed; the previous status if reverted                                                                             |

## Command Conditions

Conditions are rules that can be attached to transitions. If the package does not meet the rule, the command is not listed on the package. If the command is run anyway, `package_commands_100_1` is returned.

| Condition                                 | Blocks the command when                                                                                                         |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `OMNISHOP_ORDERS`                         | The order's channel is not one of the defined channels.                                                                         |
| `ONLY_CLICK_AND_COLLECT_ORDERS`           | The order is not a click & collect order.                                                                                       |
| `OTHER_THAN_CLICK_AND_COLLECT_ORDERS`     | The order is a click & collect order.                                                                                           |
| `BLOCK_NON_TRADEIN_PACKAGES`              | The order does not meet the trade-in rule. *\[Rule details masked.]* This condition returns a dedicated error code: `[masked]`. |
| `RETAIL_STORE_PACKAGING_WITHOUT_SHIPMENT` | The delivery store is different from the package's location.                                                                    |
| `RETAIL_STORE_PACKAGING_WITH_SHIPMENT`    | The delivery store is the same as the package's location.                                                                       |
| `VIEWING_STORE_IS_DELIVERY_STORE`         | The store performing the action is not the package's location.                                                                  |
| `SHIPPING_OPTION_GROUP`                   | The carrier of one of the items is not in the defined list.                                                                     |
| `WAIT_MINUTES_SINCE_COMMAND`              | The specified command was run on this package within the last X minutes.                                                        |
| `STOCK_LOCATION_LIST`                     | The package location is not in the list.                                                                                        |
| `EXCLUDED_STOCK_LOCATION_LIST`            | The package location is in the excluded list.                                                                                   |

## Error Codes

The following errors are common to all commands. Dynamic values in response messages are shown as `[masked]`.

| Code                               | When it occurs                                                                                                              | Message (EN)                                                                                     |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `package_100_5`                    | The package is not in a status the command can be applied to (e.g., `SHIP_THE_PACKAGE` was run on a package in status 200). | `Invalid state transition ([masked]) for ([masked]) package.`                                    |
| `package_100_6`                    | The command ran, but the package did not move to the expected status or the expected data was not created.                  | `Package State transition failed to complete correctly.` `[masked]`                              |
| `commands_100_1`                   | Returned while defining a transition: the command cannot be defined with these statuses.                                    | `Command definition is not allowed! Check source & destination states of command to be created.` |
| `commands_100_3`                   | The command parameters are invalid.                                                                                         | `Invalid command parameters passed to command.`                                                  |
| `commands_100_4`, `commands_100_6` | Another command required by this command is not defined for the customer.                                                   | `State transition ([masked]) not defined`                                                        |
| `package_commands_100_1`           | A condition attached to the transition blocked the package.                                                                 | `Package command can not be applied this package! Package: [masked]`                             |
| `package_commands_100_12`          | The command parameters do not match the package items.                                                                      | `Command parameters are invalid for the package! Package: [masked]!`                             |
| `state_100_1`                      | The package is already in the destination status.                                                                           | `Invalid state transition. Already on the same state!`                                           |
| —                                  | The command could not be found.                                                                                             | `[masked]`                                                                                       |


---

# 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://docs.akinon.com/technical-guides/oms/commands/oms-package-command-matrix.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.
