# 17. Отвязка от маркетплейса

Отправить запрос на отвязку:

[**https://my.payanyway.ru/npdapi/postunbindpartner**](https://my.payanyway.ru/npdapi/postunbindpartner)&#x20;

Принимаемые параметры:

* key - (security\_key) (строка, до 32-х символов)
* inn - ИНН самозанятого (строка до 12-ти символов)
* signature - подпись запроса (строка, до 32-х символов)

Ответ на запрос:

* requestId - ID запроса - нужен для идентификации url уведомлений, которые придут в ответ на данный запрос (число, до 11-ти знаков)
* methodName - имя запроса (строка, до 32-х символов)
* requestStatus - статус запроса - может иметь одно из значений: NEW (создан новый запрос), ACTIVE - запрос сработал, DONE - запрос завершен и NO\_MESSAGE\_ID (не был получен ID сообщения от АИС “Налог-3” - в этом случае запрос до АИС “Налог-3” будет повторяться автоматически до получения ID сообщения от АИС “Налог-3”) (строка, до 32-х символов)
* methodId - ID сообщения от АИС “Налог-3” (строка, до 50-ти символов)
* debugData - данные для отладки - массив json, имеющий следующую структуру:
  * token - (строка, до 32-х символов)
  * userIdentity - (строка, до 255-ти символов)
* result - json массив
  * Body - json массив
    * GetMessageResponse - json массив
      * ProcessingStatus - (строка, до 32-х символов)
      * Message - json массив
        * PostUnbindPartnerResponse - json массив
          * UnregistrationTime - (строка, date time)

Пример ответа:

```
{
   "requestId":15843,
   "methodName":"postunbindpartner",
   "requestStatus":"ACTIVE",
   "methodId":"85cd0ea5-c4f2-42fc-a5d3-cf3c25600a12",
   "debugData":{
      "token":"c82b6892b6c548cb905939a6194a659d",
      "userIdentity":"aW5zdGE="
   },
   "result":{
      "Body":{
         "GetMessageResponse":{
            "ProcessingStatus":"COMPLETED",
            "Message":{
               "PostUnbindPartnerResponse":{
                  "UnregistrationTime":"2020-02-28T11:18:31.809Z"
               }
            },
            "FileLinks":[
               
            ]
         }
      }
   }
}
```

Структура URL - уведомления от NPD API при отказе самозанятого от привязки:

* notificationId - ID нотификации (число, до 11-ти знаков)
* notificationName - (строка, до 32-х символов)
* userPhone - (строка, до 32-х символов)
* userInn - ИНН самозанятого (строка до 12-ти символов)
* debugData - json массив
  * Body - json массив
    * GetMessageResponse - json массив
      * ProcessingStatus - (строка, до 32-х символов)
      * Message - json массив
        * SmzPlatformError - json массив
          * Code - (строка, до 32-х символов)
          * Message - (строка, text 16384 символа)
          * Args - json массив - список пар ключ-значение
            * Key - (строка, до 32-х символов)
            * Value - (строка, text 16384 символа)

Пример URL - уведомления об успешной отвязке:

```
{
   "notificationId":391,
   "notificationName":"userunlinked",
   "userPhone":"79038326801",
   "userInn":null,
   "debugData":{
      "Body":{
         "GetMessageResponse":{
            "ProcessingStatus":"COMPLETED",
            "Message":{
               "SmzPlatformError":{
                  "Code":"TAXPAYER_UNREGISTERED",
                  "Message":"\u041d\u0430\u043b\u043e\u0433\u043e\u043f\u043b\u0430\u0442\u0435\u043b\u044c\u0449\u0438\u043a \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d"
               }
            },
            "FileLinks":[
               
            ]
         }
      }
   }
}
```

На все URL - уведомления нужно отвечать строкой SUCCESS без переносов строк, если этого не происходит, будет осуществляться отправка URL - уведомления, но не более 300 раз.

Дождаться URL - уведомления userunlinked об отвязке<br>


---

# Agent Instructions: 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:

```
GET https://docs.payanyway.ru/marketplace/samozanyatye/zaprosy-dlya-raboty-s-fns/6.-otvyazka-ot-platformy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
