> For the complete documentation index, see [llms.txt](https://topseller.gitbook.io/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://topseller.gitbook.io/help/instruction/ts-connect/settings/leroymerlin/api.md).

# Настройка API

Первое и самое главное что нужно настроить, для того чтобы мы начали работать с Вашим аккаунтом - это подключение по API.

## ⚙️ Для того чтобы настроить раздел API: <a href="#dlya-togo-chtoby-nastroit-razdel-api" id="dlya-togo-chtoby-nastroit-razdel-api"></a>

1. Зайдите в Connect:
   * в МойСклад в [LEROY MERLIN CONNECT](https://online.moysklad.ru/app/#apps?id=f6783e05-4276-4230-b086-a4ce5c43c9a9)
   * в отдельную версию [TOPSELLER PRO](https://pro.topseller.ru/)
2. Нажмите на логотип маркетплейса <img src="https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Flogo%2Flogo_lm.svg&#x26;width=40&#x26;dpr=4&#x26;quality=100&#x26;sign=d2295b86&#x26;sv=2" alt="" data-size="line">
3. Затем нажмите на аккаунт, чтобы открылись настройки аккаунта

![](https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_lm%2F%25D0%25B2%25D1%258B%25D0%25B1%25D0%25BE%25D1%2580_%25D0%25B0%25D0%25BA%25D0%25BA_%25D0%25BB%25D0%25BC_%25D0%25B3%25D0%25B8%25D1%2584_%25D0%25BE%25D0%25B1%25D0%25B2.gif\&width=768\&dpr=4\&quality=100\&sign=7a16b095\&sv=2)

1. Перейдите в раздел `АПИ` . Выберите `Схему работы маркетплейса` и задайте удобное для Вас `Название магазина`:

<figure><img src="/files/a9trAW7FCoIscXc9tRTL" alt="" width="563"><figcaption></figcaption></figure>

* **FBS** (со своего склада) - схема продажи, при которой вы храните товары у себя на складе, следите за новыми заказами, собираете их и передаёте в службу доставки ЛеруаМерлен.

1. **Получение токена импорта заказов.** Теперь нужно заполнить `Merchant username` и `Merchant password` (это ваши логин и пароль от входа в ЛК). А `Merchant client_id` с `Merchant client_secret` (сразу попросите также `Апи-ключ`) можно получить через **МЕНЕДЖЕРА**. После заполнения нажмите кнопку <img src="https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_common%2Fstroke%2F%25D0%25BF%25D0%25BE%25D0%25BB%25D1%2583%25D1%2587%25D0%25B8%25D1%2582%25D1%258C_jwt_%25D1%2582%25D0%25BE%25D0%25BA%25D0%25B5%25D0%25BD_%25D0%25BE%25D0%25B1%25D0%25B2.png&#x26;width=233&#x26;dpr=4&#x26;quality=100&#x26;sign=b396365e&#x26;sv=2" alt="" data-size="line">
2. **Получение токена для экспорта остатков.** Далее, если вы хотите, чтобы работала синхронизация остатков и цен по АПИ Вам нужно запросить у менеджера или ТП Леруа: `Логин` и `Пароль` для метода остатков. После заполнения нажмите кнопку <img src="https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_common%2Fstroke%2F%25D0%25BF%25D0%25BE%25D0%25BB%25D1%2583%25D1%2587%25D0%25B8%25D1%2582%25D1%258C_jwt_%25D1%2582%25D0%25BE%25D0%25BA%25D0%25B5%25D0%25BD_%25D0%25BE%25D0%25B1%25D0%25B2.png&#x26;width=233&#x26;dpr=4&#x26;quality=100&#x26;sign=b396365e&#x26;sv=2" alt="" data-size="line">
3. Далее добавьте апи ключ и нажмите кнопку ![](https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_common%2Fstroke%2F%25D0%25BA%25D0%25BD%25D0%25BE%25D0%25BF%25D0%25BA%25D0%25B0_%25D1%2581%25D0%25BE%25D1%2585%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B8%25D1%2582%25D1%258C_%25D1%2582%25D0%25BE%25D0%25BF%25D1%2581%25D0%25B5%25D0%25BB%25D0%25BB%25D0%25B5%25D1%2580_%25D0%25BE%25D0%25B1%25D0%25B2_2.png\&width=193\&dpr=4\&quality=100\&sign=3fa11943\&sv=2)

{% hint style="danger" %}
Кнопка ![](https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_common%2Fstroke%2F%25D0%25BA%25D0%25BD%25D0%25BE%25D0%25BF%25D0%25BA%25D0%25B0_%25D1%2581%25D0%25BE%25D1%2585%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B8%25D1%2582%25D1%258C_%25D1%2582%25D0%25BE%25D0%25BF%25D1%2581%25D0%25B5%25D0%25BB%25D0%25BB%25D0%25B5%25D1%2580_%25D0%25BE%25D0%25B1%25D0%25B2_2.png\&width=193\&dpr=4\&quality=100\&sign=3fa11943\&sv=2) может находиться в правой области браузера - особенность интерфейса Connect для МоегоСклада, который технически не позволяет разместить ее внизу формы, как все привыкли. И пользователи её теряли за полосой прокрутки. Поэтому теперь она находится справа - чтобы всегда быть в доступе и на виду.![](https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_lm%2F%25D0%25B0%25D0%25BF%25D0%25B8_%25D0%25B0%25D0%25B2%25D1%2582%25D0%25BE%25D1%2580%25D0%25B8%25D0%25B7%25D0%25B0%25D1%2586%25D0%25B8%25D1%258F_%25D0%25BE%25D0%25B1%25D0%25B2.png\&width=768\&dpr=4\&quality=100\&sign=3845f31b\&sv=2)
{% endhint %}

<figure><img src="/files/iT3sMBb97CQ9LCYkkDWz" alt=""><figcaption></figcaption></figure>

7\. После успешной авторизации по API **обязательно** включите аккаунт

![](https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_common%2Fstroke%2F%25D0%25B2%25D0%25BA%25D0%25BB_%25D0%25B0%25D0%25BA%25D0%25BA%25D0%25B0%25D1%2583%25D0%25BD%25D1%2582_%25D0%25BE%25D0%25B1%25D0%25B2.png\&width=768\&dpr=4\&quality=100\&sign=2e84de68\&sv=2)![](https://help.topseller.ru/~gitbook/image?url=https%3A%2F%2Fstatic.connect.topseller.ru%2Fsomething%2Fhelp%2Ffaq_common%2Fstroke%2F%25D0%25B2%25D0%25BA%25D0%25BB_%25D0%25B0%25D0%25BA%25D0%25BA%25D0%25B0%25D1%2583%25D0%25BD%25D1%2582_%25D0%25BE%25D0%25B1%25D0%25B2.png\&width=768\&dpr=4\&quality=100\&sign=2e84de68\&sv=2)

<figure><img src="/files/On7tTJ0DIaYeItYPf9Qx" alt=""><figcaption></figcaption></figure>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://topseller.gitbook.io/help/instruction/ts-connect/settings/leroymerlin/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
