---
metadata:
  - name: generator
    content: Diplodoc Platform v5.55.0
alternate:
  - https://yandex.com/dev/market/partner-api/doc/en/step-by-step/stocks.md
  - https://yandex.com/dev/market/partner-api/doc/ru/step-by-step/stocks.md
  - https://yandex.com/dev/market/partner-api/doc/zh/step-by-step/stocks.md
  - href: en/step-by-step/stocks.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

# Transfer of balances via API

In order for the Market to receive up-to-date information about balances, use one of the following methods:

* If there are no warehouse groups in the cabinet — [POST v3/businesses/{businessId}/offers/stocks/update](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/updateStocksOnPartnerWarehouses.md)
* If there are warehouse groups in the cabinet — [PUT v2/campaigns/{campaignId}/offers/stocks](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/updateStocks.md)

[What are warehouse groups and why are they needed?](https://yandex.ru/support/marketplace/assortment/operations/stocks.html#unified-stocks).

## What needs to be ready before you get started {#before-you-start}

Before setting up order processing via the API, you need to add products to the Market and set up assortment updates. You don't have to do this through the API. — choose any method that is convenient for you. All the necessary instructions are available in [Yandex.Market Help for sellers](https://yandex.ru/support/marketplace/assortment/index.html).

## How does the transfer of leftovers work? {#details}

It is important for Yandex.Market to know how many items are left in the store's warehouse. — otherwise, it may turn out that the buyer places an order, but the product does not turn out to be there. Exception — models FBY and LaaS, because the goods are stored in the Market's warehouse and he can count them himself.

To transfer the leftovers correctly, be sure to read [an article in the Help of the Market for sellers](https://yandex.ru/support/marketplace/assortment/operations/stocks.html). All the general rules for transferring balances apply to the API too.


{% note info "Можно ли использовать одновременно API и другие способы передачи остатков?" %}


Yes, you can transfer balances according to these instructions using the API and in the cabinet via YML or via Excel files.


{% endnote %}


## Integration development {#getting-it-done}

### If there are no warehouse groups in the cabinet {#no-warehouse-groups}

1. Get the warehouse IDs — [POST v3/businesses/{businessId}/warehouses](https://yandex.com/dev/market/partner-api/doc/en/reference/warehouses/getPartnerWarehouses.md).
2. Transfer the leftovers — [POST v3/businesses/{businessId}/offers/stocks/update](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/updateStocksOnPartnerWarehouses.md). In the request, specify your SKU, the warehouse ID and the value of the leftovers.
3. Check the current balances if necessary. — [POST v3/businesses/{businessId}/offers/stocks](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/getStocksOnPartnerWarehouses.md).

### If there are warehouse groups in the cabinet {#with-warehouse-groups}

Using a request [PUT v2/campaigns/{campaignId}/offers/stocks](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/updateStocks.md) You can transfer leftovers at any time.

Each entry includes:

* Your SKU the product for which you need to update the balance.
* Date and time — the moment when the new value is relevant.
* The value of the leftovers itself.

### How to check the functionality of the integration {#check}

1. Hide the items using [POST v2/campaigns/{campaignId}/hidden-offers](https://yandex.com/dev/market/partner-api/doc/en/reference/hidden-offers/addHiddenOffers.md).
2. Make a request to transfer the remaining funds — [POST v3/businesses/{businessId}/offers/stocks/update](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/updateStocksOnPartnerWarehouses.md) or [PUT v2/campaigns/{campaignId}/offers/stocks](https://yandex.com/dev/market/partner-api/doc/en/reference/stocks/updateStocks.md).
3. Resume showing hidden goods — [POST v2/campaigns/{campaignId}/hidden-offers/delete](https://yandex.com/dev/market/partner-api/doc/en/reference/hidden-offers/deleteHiddenOffers.md).

### What number should I send {#count}

Remaining product — This is the number of units, **available for ordering on the Market**.

When a customer places an order, the number of available items decreases., — therefore, the leftovers too. For example, if there were 20 and someone ordered 2 units, the remainder would be 18.


{% note info "Учитываются продажи и на Маркете, и вне Маркета" %}


It doesn't matter where the product was purchased: on the Market or, for example, directly in an offline store. In any case, immediately reduce the remaining product.


{% endnote %}


For example:

#|
||**Event**|**Changing balances**||
||10 units of new goods were brought to the warehouse|0 → 10||
||The buyer ordered 2 units on the Market|10 → 8||
||The supplier brought 10 more pieces.|8 → 18||
||Visitor [offline stores](*warehouse) I bought 3 pieces|18 → 15||
|#


## How to transfer leftovers for a group of warehouses {#warehouse-group}

Transfer leftovers only for **one of any warehouse**. Information for the rest of the warehouses in this group will be updated automatically.

[*warehouse]: It is assumed that the offline store sells with **The same warehouse**, the same as the store on the Market.
