---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://yandex.com/dev/market/partner-api/doc/en/step-by-step/laas-order.md
  - https://yandex.com/dev/market/partner-api/doc/ru/step-by-step/laas-order.md
  - https://yandex.com/dev/market/partner-api/doc/zh/step-by-step/laas-order.md
  - href: en/step-by-step/laas-order.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/market/partner-api/doc/en/llms.txt


# Working with the LaaS order

With the help Yandex Market API You can receive, create, modify, and cancel orders.


## Create an order {#create}

<!-- source: en/_includes/mermaid/create-order.md -->
```mermaid
%%{
  init: {
    'theme': 'base',
    'themeVariables': {
      'primaryColor': '#FDF3E8',
      'primaryTextColor': '#000000',
      'primaryBorderColor': '#BA9C80',
      'lineColor': '#BA9C80',
      'secondaryColor': '#94E1C4',
      'tertiaryColor': '#F84E57',
      'noteBkgColor': '#FED58D'
    }
  }
}%%

sequenceDiagram
    participant Merchant as Your Store
    participant Market as Yandex Market

    opt
      rect rgb(251, 243, 232)
          note right of Merchant: Optional step
          note right of Merchant: For pickup: getting a list of pickup points
          Merchant ->> Market: POST v2/businesses/{businessId}/logistics-points
          Market -->> Merchant: OK: list of pickup points.
      end
    end

    rect rgb(251, 243, 232)
        note right of Merchant: Getting stock and warehouse identifiers
        Merchant ->> Market: POST v2/campaigns/{campaignId}/offers/stocks
        Market -->> Merchant: OK: product stock and warehouse identifiers.
    end

    rect rgb(251, 243, 232)
        note right of Merchant: Getting order delivery options
        Merchant ->> Market: POST v2/campaigns/{campaignId}/delivery-options
        Market -->> Merchant: OK: delivery options.
    end

    rect rgb(251, 243, 232)
        note right of Merchant: Creating an order
        Merchant ->>+ Market: POST v2/campaigns/{campaignId}/orders/create
        alt Order created as draft (draft=true)
            Market ->> Market: Creates an order<br>with status RESERVED.
        else Order created without draft (draft=false)
            Market ->> Market: Creates an order<br>with status PROCESSING STARTED.
        end
        Market -->>- Merchant: OK: order identifier.
    end

    opt
        note right of Merchant: If the order was created with draft=true
        rect rgb(251, 243, 232)
            note right of Merchant: Confirming the order
            Merchant ->>+ Market: Status PROCESSING with substatus STARTED<br>PUT v2/campaigns/{campaignId}/orders/{orderId}/status
            Market ->> Market: Starts the operation<br>to confirm the order.
            Market -->>- Merchant: OK: operation identifier.
        end
        rect rgb(251, 243, 232)
            note right of Merchant: Checking operation status
            Merchant ->> Market: Operation identifier<br>POST v2/businesses/{businessId}/operations
            Market -->> Merchant: OK: operation information.
        end
    end
```
<!-- endsource: en/_includes/mermaid/create-order.md -->

1. **For pickup:** if necessary, call the method [POST v1/businesses/{businessId}/logistics-points](https://yandex.com/dev/market/partner-api/doc/en/reference/logistic-points/getLogisticPoints.md), which returns a list of Market order pickups.

    Request this information regularly to keep up-to-date data in the store's system. For example, once a day.

1. Check the remaining stocks — method [POST v2/campaigns/{campaignId}/offers/stocks](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/getStocks.md).

    The response will also return the IDs of the warehouses where the goods are stored.

1. Get the available shipping options. To do this, in the method [POST v1/campaigns/{campaignId}/delivery-options](https://yandex.com/dev/market/partner-api/doc/en/reference/delivery-options/getDeliveryOptions.md) provide all the items in the order and information for courier delivery or pickup.

    If necessary, also provide the IDs of the warehouses from which you want to pick up the goods. If this is not done, the Market will select the warehouses itself.

1. Create an order using the method [POST v1/campaigns/{campaignId}/orders/create](https://yandex.com/dev/market/partner-api/doc/en/reference/orders/createOrder.md). For delivery by courier, provide the full address, including the region.

    Parameter value `draft`:

    * `true` — Yandex.Market will create an order with the status `RESERVED` and it will wait for confirmation from the store.
    * `false` — Yandex.Market will create an order with the status `PROCESSING` with a sub-status `STARTED` and it will start processing it, no confirmation is required.

1. If the order is in the status `RESERVED` and you are ready to confirm it, please send the status `PROCESSING` with a sub-status `STARTED` in the method [PUT v2/campaigns/{campaignId}/orders/{orderId}/status](https://yandex.com/dev/market/partner-api/doc/en/reference/orders/updateOrderStatus.md). If you do not do this within an hour after creating the order, yandex.Market will cancel the order.

    The operation ID will be returned in the response.

1. Check the operation status using the method [POST v1/businesses/{businessId}/operations](https://yandex.com/dev/market/partner-api/doc/en/reference/operations/getOperations.md).


## Change the order {#change}

You can change:

* recipient's details;
* the courier delivery date interval.

<!-- source: en/_includes/mermaid/change-order.md -->
```mermaid
%%{
  init: {
    'theme': 'base',
    'themeVariables': {
      'primaryColor': '#FDF3E8',
      'primaryTextColor': '#000000',
      'primaryBorderColor': '#BA9C80',
      'lineColor': '#BA9C80',
      'secondaryColor': '#94E1C4',
      'tertiaryColor': '#F84E57',
      'noteBkgColor': '#FED58D'
    }
  }
}%%

sequenceDiagram
    participant Merchant as Your store
    participant Market as Yandex Market

    rect rgb(251, 243, 232)
        note right of Merchant: To change the courier delivery date range
        note right of Merchant: Get available delivery intervals
        Merchant ->> Market: POST v2/campaigns/{campaignId}/orders/update-options
        Market -->> Merchant: OK: delivery intervals.
    end

    rect rgb(251, 243, 232)
        note right of Merchant: Update order
        Merchant ->>+ Market: POST v2/campaigns/{campaignId}/orders/update
        Market ->> Market: Starts the operation<br>to update the order.
        Market -->>- Merchant: OK: operation ID.
    end

    rect rgb(251, 243, 232)
        note right of Merchant: Check operation status
        Merchant ->> Market: Operation ID<br>POST v2/businesses/{businessId}/operations
        Market -->> Merchant: OK: operation information.
    end
```
<!-- endsource: en/_includes/mermaid/change-order.md -->

1. **To change the date interval of courier delivery:** Get the available time intervals using the method [POST v1/campaigns/{campaignId}/orders/update-options](https://yandex.com/dev/market/partner-api/doc/en/reference/orders/getOrderUpdateOptions.md).

1. Start the operation to change the order. To do this, specify the order ID and the new data in the method [POST v1/campaigns/{campaignId}/orders/update](https://yandex.com/dev/market/partner-api/doc/en/reference/orders/updateOrder.md).

    Transmit only the information that you want to change. If necessary, you can edit both the recipient's data and the courier delivery date interval at the same time.

1. Check the operation status using the method [POST v1/businesses/{businessId}/operations](https://yandex.com/dev/market/partner-api/doc/en/reference/operations/getOperations.md).


## Cancel the order {#cancel}

<!-- source: en/_includes/mermaid/cancel-order.md -->
```mermaid
%%{
  init: {
    'theme': 'base',
    'themeVariables': {
      'primaryColor': '#FDF3E8',
      'primaryTextColor': '#000000',
      'primaryBorderColor': '#BA9C80',
      'lineColor': '#BA9C80',
      'secondaryColor': '#94E1C4',
      'tertiaryColor': '#F84E57',
      'noteBkgColor': '#FED58D'
    }
  }
}%%

sequenceDiagram
    participant Merchant as Your Store
    participant Market as Yandex Market

    rect rgb(251, 243, 232)
        note right of Merchant: Order cancellation or cancellations
        Merchant ->>+ Market: Status `CANCELLED` with cancellation reason `SHOP_FAILED`<br>PUT v2/campaigns/{campaignId}/orders/{orderId}/status<br>or<br>POST v2/campaigns/{campaignId}/orders/status-update
        Market ->> Market: Starts the operation<br>for order cancellation.
        Market -->>- Merchant: OK: operation identifier.
    end

    rect rgb(251, 243, 232)
        note right of Merchant: Operation status check
        Merchant ->> Market: Operation identifier<br>POST v2/businesses/{businessId}/operations
        Market -->> Merchant: OK: operation information.
    end

    opt
      rect rgb(251, 243, 232)
          note right of Merchant: Optional step
          note right of Merchant: Order or orders status check
          Merchant ->> Market: POST v1/businesses/{businessId}/orders
          Market -->> Merchant: OK: order or orders information.
      end
    end
```
<!-- endsource: en/_includes/mermaid/cancel-order.md -->

1. Start the order cancellation operation. To do this, send the status `CANCELLED` with the reason for cancellation `SHOP_FAILED` in the method:

    * [PUT v2/campaigns/{campaignId}/orders/{orderId}/status](https://yandex.com/dev/market/partner-api/doc/en/reference/orders/updateOrderStatus.md) — for a single order;
    * [POST v2/campaigns/{campaignId}/orders/status-update](https://yandex.com/dev/market/partner-api/doc/en/reference/orders/updateOrderStatuses.md) — for multiple orders.

    Do not transmit other statuses.

1. Check the operation status — method [POST v1/businesses/{businessId}/operations](https://yandex.com/dev/market/partner-api/doc/en/reference/operations/getOperations.md).

1. If necessary, check the order status: use the method [POST v1/businesses/{businessId}/orders](https://yandex.com/dev/market/partner-api/doc/en/reference/orders/getBusinessOrders.md) with a filter `orderIds`.
