# AsyncRequest

Проверка статуса асинхронного таска. Статус нужно проверять до наступления таймаута асинхронного таска. Таймаут = 700 минут.

```javascript
запрос:

{"Envelope": {
    "Header": {
      "Security": {
        "UsernameToken": {
          "Username": "USERNAME",
          "Password": "PASSWORD"
        }
      }
    },
    "Body": {
      "AsyncRequest": {
        "asyncId": 37027
      }
    }
  }
}

вариант ответа #1:

{"Envelope": {
    "Body": {
      "AsyncResponse": {
        "expirationDate": "2017-07-24T18:07:12.000+03:00",
        "asyncId": 37027,
        "asyncStatus": "INPROGRESS"
      }
    }
  }
}

вариант ответа #2:

{"Envelope": {
    "Body": {
        "fault": {
            "detail": {
                "faultDetail":"500.9.1"
            },
            "faultcode": "Client",
            "faultstring": "Асинхронная задача не найдена"
        }
    }
}}

вариант ответа #3 (успешное завершение таска):

{
  "Envelope": {
    "Body": {
      "AsyncResponse": {
        "SimplifiedIdentificationResponse": {
          "success": true,
          "personalInformation": {
            "profile": {
              "attribute": [
                {
                  "approved": true,
                  "value": "Last name",
                  "published": false,
                  "key": "last_name"
                },
                {
                  "approved": true,
                  "value": "000-000-000 00",
                  "published": false,
                  "key": "snils"
                },
                {
                  "approved": true,
                  "value": "First name",
                  "published": false,
                  "key": "first_name"
                },
                {
                  "approved": true,
                  "value": "000000000000",
                  "published": false,
                  "key": "inn"
                },
                {
                  "approved": true,
                  "value": "79001234567",
                  "published": false,
                  "key": "cell_phone"
                },
                {
                  "approved": true,
                  "value": "Middle initial",
                  "published": false,
                  "key": "middle_initial_name"
                },
                {
                  "approved": false,
                  "value": "11111",
                  "published": false,
                  "key": "unitid"
                },
                {
                  "approved": false,
                  "value": "22222",
                  "published": false,
                  "key": "profileid"
                }
              ]
            },
            "document": {
              "id": 123,
              "type": "PASSPORT",
              "hasAttachedFiles": false,
              "attribute": [
                {
                  "approved": true,
                  "value": "0000",
                  "published": false,
                  "key": "series"
                },
                {
                  "approved": false,
                  "value": "Issuer name",
                  "published": false,
                  "key": "issuer"
                },
                {
                  "approved": false,
                  "value": "000-000",
                  "published": false,
                  "key": "department"
                },
                {
                  "approved": false,
                  "value": "2017-08-15",
                  "published": false,
                  "key": "issued"
                },
                {
                  "approved": true,
                  "value": "000000",
                  "published": false,
                  "key": "number"
                },
                {
                  "approved": true,
                  "value": "2017-08-08T13:53:22.000+03:00",
                  "key": "modificationdate"
                }
              ]
            }
          }
        }
      }
    }
  }
}

вариант ответа #4 (идентификация не пройдена):

{
  "Envelope": {
    "Body": {
      "AsyncResponse": {
        "SimplifiedIdentificationResponse": {
          "success": false,
          "error": "Customer data did not pass ESIA check.",
          "errorCode": "500.7.3",
          "personalInformation": {
            "document": {
              "id": 123,
              "hasAttachedFiles": false,
              "attribute": [
                {
                  "approved": false,
                  "value": "0000",
                  "published": false,
                  "key": "series"
                },
                {
                  "approved": false,
                  "value": "Issuer name",
                  "published": false,
                  "key": "issuer"
                },
                {
                  "approved": false,
                  "value": "000-000",
                  "published": false,
                  "key": "department"
                },
                {
                  "approved": false,
                  "value": "2017-08-15",
                  "published": false,
                  "key": "issued"
                },
                {
                  "approved": false,
                  "value": "000000",
                  "published": false,
                  "key": "number"
                },
                {
                  "approved": true,
                  "value": "2017-08-17T10:23:15.000+03:00",
                  "key": "modificationdate"
                }
              ],
              "type": "PASSPORT"
            },
            "profile": {
              "attribute": [
                {
                  "approved": false,
                  "value": "Last name",
                  "published": false,
                  "key": "last_name"
                },
                {
                  "approved": false,
                  "value": "000-000-000 00",
                  "published": false,
                  "key": "snils"
                },
                {
                  "approved": false,
                  "value": "First name",
                  "published": false,
                  "key": "first_name"
                },
                {
                  "approved": false,
                  "value": "000000000000",
                  "published": false,
                  "key": "inn"
                },
                {
                  "approved": true,
                  "value": "79001234567",
                  "published": false,
                  "key": "cell_phone"
                },
                {
                  "approved": false,
                  "value": "Middle initial",
                  "published": false,
                  "key": "middle_initial_name"
                },
                {
                  "approved": false,
                  "value": "11111",
                  "published": false,
                  "key": "unitid"
                },
                {
                  "approved": false,
                  "value": "22222",
                  "published": false,
                  "key": "profileid"
                }
              ]
            }
          }
        }
      }
    }
  }
}
```

По истечении таймаута маркетплейс может отправить запрос GetProfileInfoRequest,  в котором будет указан parenId, если юнит клиента находится в группе "Анонимные пользователи", то считаем, что идентификация не пройдена и маркетплейс может проверить данные клиента,  указанные в юните, исправить их и отправить запрос SimplifiedIdentificationRequest еще раз.

{% hint style="info" %}
Запросы маркетплейс отправляет в рамках интерфейса MONETA.MerchantAPI

Интерфейс [MONETA.MerchantAPI](http://www.moneta.ru/doc/MONETA.MerchantAPI.v2.ru.pdf) представляет собой Web-сервис, описанный по спецификации Web Services Description Language [(WSDL)](https://service.moneta.ru/services.wsdl), использующий протокол Simple Object Access Protocol (SOAP) для передачи информации.
{% endhint %}


---

# 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/zaprosy-dlya-registracii-fl/registraciya-fizicheskogo-lica/primer-2.-posledovatelnost-zaprosov./asyncrequest.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.
