> Documentation index: [Saleor](/llms.txt) · [This section](/developer/llms.txt)
> Source: https://docs.saleor.io/developer/order/order-status

# Order Status

A typical order lifecycle begins with a customer finalizing the checkout process and ends with delivering the products. Between those two points, the order can go through several states. This article describes the possible states of an order and the transitions between them.

<a id="settings"></a>

## Settings

Several settings can affect the behavior of the order. You can find them in the [`channel.orderSettings`](/api-reference/miscellaneous/objects/order-settings.md) object.

<a id="order-status"></a>

## Order status

Below is a diagram that shows the possible states of an order and the transitions between them. Names of the states are drawn from the [`OrderStatus`](/api-reference/orders/enums/order-status.md) enum. Each state is described in detail in the following sections.

The order is initiated either by creating a draft version or completing a checkout.

```mermaid
flowchart TD
    CreatedDraft[Draft order created] --> DRAFT(DRAFT)
    CheckoutCompleted[Checkout Completed]

    DRAFT -->| Draft order complete | isAutomated{Is automated<br> order confirmation turned on?}

    CheckoutCompleted --> isAutomated
    isAutomated -->|Yes| UNFULFILLED
    isAutomated -->|No| UNCONFIRMED(UNCONFIRMED)

    UNCONFIRMED -->|Expire time overdue| EXPIRED(EXPIRED)
    UNCONFIRMED -->|Confirm order| UNFULFILLED

    UNFULFILLED -->|Create fulfillment| isNotFulfilled{Are there unfulfilled<br> order lines?}
    isNotFulfilled -->|Yes| PARTIALLY_FULFILLED(PARTIALLY_FULFILLED)
    isNotFulfilled -->|No| FULFILLED(FULFILLED)
    UNFULFILLED -->|Cancel order| CANCELLED(CANCELLED)

    FULFILLED -->|Return products| isNotReturned
    FULFILLED -->|Cancel fulfillment| isAllCancelled

    PARTIALLY_FULFILLED -->|Create fulfillment| isNotFulfilled
    PARTIALLY_FULFILLED --->|Return products| isNotReturned{Are there unreturned<br> order lines?}
    PARTIALLY_FULFILLED --->|Cancel fulfillment| isAllCancelled{Are all fulfillments<br> cancelled?}

    isAllCancelled ~~~ isNotFulfilled

    isAllCancelled -->|No| PARTIALLY_FULFILLED
    isAllCancelled -->|Yes| UNFULFILLED

    isNotReturned -->|Yes| PARTIALLY_RETURNED(PARTIALLY_RETURNED)
    isNotReturned -->|No| RETURNED(RETURNED)

    PARTIALLY_RETURNED -->|Return products| isNotReturned
```

<a id="draft"></a>

### DRAFT

```mermaid
stateDiagram-v2
    direction LR

    [*] --> DRAFT: Draft order created in the Dashboard or the API

    DRAFT --> UNFULFILLED: Order confirmed
    DRAFT --> [*]: Draft order removed
```

-   Result of [`draftOrderCreate`](/api-reference/orders/mutations/draft-order-create.md) mutation.
-   Item stocks are not allocated.

<a id="available-transitions"></a>

#### Available transitions

-   Remove: removed `DRAFT` orders are not visible in the dashboard.
-   Finalize: the status will change to `UNFULFILLED`.

<a id="unconfirmed"></a>

### UNCONFIRMED

```mermaid
stateDiagram-v2
    direction LR

    [*] --> UNCONFIRMED

    UNCONFIRMED --> UNFULFILLED: Order confirmed
    UNCONFIRMED --> EXPIRED: Expire time has passed
    UNCONFIRMED --> CANCELED: Order canceled
```

-   Item stocks are allocated for ProductVariants with `ProductVariant.trackInventory` turned on.
-   this state is the result of [`checkoutComplete`](/api-reference/checkout/mutations/checkout-complete.md) mutation, if [`channel.orderSettings.automaticallyConfirmAllNewOrders`](/api-reference/miscellaneous/objects/order-settings.md#automatically-confirm-all-new-orders) is set to `False`.

<a id="available-transitions-1"></a>

#### Available transitions

-   Confirm: the status will change to `UNFULFILLED`.
-   Expire: the status will automatically change to `EXPIRED` if the order is older than [`channel.orderSettings.expireOrdersAfter`](/api-reference/miscellaneous/objects/order-settings.md#expire-orders-after) minutes. This will happen automatically only if no transaction attempts were made.
-   Cancel: the status will change to `CANCELED` and order will be visible in the dashboard.

<a id="unfulfilled"></a>

### UNFULFILLED

```mermaid
stateDiagram-v2
    state if_state_fulfillments <<choice>>
    state if_state_returns <<choice>>

    direction LR

    [*] --> UNFULFILLED

    UNFULFILLED --> if_state_fulfillments: Fulfillment created
    if_state_fulfillments --> FULFILLED: All products fulfilled
    if_state_fulfillments --> PARTIALLY_FULFILLED: Products waiting for fulfillment

    UNFULFILLED --> CANCELED: Order canceled

    UNFULFILLED --> if_state_returns: Return items
    if_state_returns --> RETURNED: All products returned
    if_state_returns --> PARTIALLY_RETURNED: Not all products returned
```

-   Item stocks are allocated for ProductVariants with `ProductVariant.trackInventory` turned on.
-   Result of [`orderConfirm`](/api-reference/orders/mutations/order-confirm.md) mutation or finishing a checkout in a channel with automatic confirmation.

<a id="available-transitions-2"></a>

#### Available transitions

-   Fulfill: creating fulfillments will result in transition to `PARTIALLY_FULFILLED` or `FULFILLED` state, depending on whether there are any unfulfilled items left. For items with inventory tracking enabled, this will also deduct stock quantity from warehouses and release allocations.
-   Return: creating returns will result in transition to `PARTIALLY_RETURNED` or `RETURNED` state. Returning items will not modify stock.
-   Cancel: the status will change to `CANCELED` and order will be visible in the dashboard.

<a id="partially_fulfilled"></a>

### PARTIALLY\_FULFILLED

```mermaid
stateDiagram-v2
    direction LR

    [*] --> PARTIALLY_FULFILLED
    state if_state_fulfillments <<choice>>
    state if_state_returns <<choice>>
    state if_state_cancel_fulfillments <<choice>>


    PARTIALLY_FULFILLED --> if_state_fulfillments: Fulfillment created
    if_state_fulfillments --> PARTIALLY_FULFILLED: Products waiting for fulfillment
    if_state_fulfillments --> FULFILLED: All products fulfilled

    PARTIALLY_FULFILLED --> if_state_cancel_fulfillments: Fulfillment canceled
    if_state_cancel_fulfillments --> PARTIALLY_FULFILLED: Not all fulfillments canceled
    if_state_cancel_fulfillments --> UNFULFILLED: All fulfillments canceled

    PARTIALLY_FULFILLED --> if_state_returns: Return items
    if_state_returns --> PARTIALLY_RETURNED: Not all products returned
    if_state_returns --> RETURNED: All products returned
```

-   Stocks of unfulfilled items are allocated, and fulfilled items are deducted from the stock quantity.
-   Result of [`orderFulfill`](/api-reference/orders/mutations/order-fulfill.md) mutation.

<a id="available-actions"></a>

#### Available actions

-   Fulfill: creating fulfillments will result in transition to `PARTIALLY_FULFILLED` or `FULFILLED` state, depending on whether there are any unfulfilled items left. For items with inventory tracking enabled, this will also deduct stock quantity from warehouses and release allocations.
-   Cancel fulfillment: cancelling all fulfillments will result in transition to `UNFULFILLED` state. Items with inventory tracking enabled will be restocked in the warehouse specified in the input of `orderFulfillmentCancel` mutation.
-   Return: creating returns will result in transition to `PARTIALLY_RETURNED` or `RETURNED` state. Returning items will not modify stock.

<a id="fulfilled"></a>

### FULFILLED

```mermaid
stateDiagram-v2
    direction LR

    [*] --> FULFILLED
    state if_state_returns <<choice>>
    state if_state_cancel_fulfillments <<choice>>

    FULFILLED --> if_state_returns: Return items
    if_state_returns --> PARTIALLY_RETURNED: Not all products returned
    if_state_returns --> RETURNED: All products returned

    FULFILLED --> if_state_cancel_fulfillments: Cancel fulfillment
    if_state_cancel_fulfillments --> PARTIALLY_FULFILLED: Not all fulfillments canceled
    if_state_cancel_fulfillments --> UNFULFILLED: All fulfillments canceled
```

-   No allocations, stocks already deducted from warehouses.
-   Result of [`orderFulfill`](/api-reference/orders/mutations/order-fulfill.md) mutation.
-   Purpose: order is fulfilled, waiting for optional operations: return, refund.

<a id="partially_returned"></a>

### PARTIALLY\_RETURNED

```mermaid
stateDiagram-v2
    direction LR

    [*] --> PARTIALLY_RETURNED

    state if_state_returns <<choice>>

    PARTIALLY_RETURNED --> if_state_returns: Return items
    if_state_returns --> PARTIALLY_RETURNED: Not all products returned
    if_state_returns --> RETURNED: All products returned
```

-   Some of the items were marked as returned.
-   Return procedure does not modify stocks automatically.

<a id="returned"></a>

### RETURNED

-   All of the items were marked as returned.

<a id="expired"></a>

### EXPIRED

-   Stock allocations are released.
-   It will happen automatically based on channel settings.

<a id="available-actions-1"></a>

#### Available actions

This state cannot be changed.

<a id="canceled"></a>

### CANCELED

-   Stock allocations are released.
-   Result of [`orderCancel`](/api-reference/orders/mutations/order-cancel.md).
-   Possible previous states: UNCONFIRMED, UNFULFILLED.

<a id="available-actions-2"></a>

#### Available actions

This state cannot be changed.
