# EditProfileDocumentRequest документа руководителя

Заполнение документа руководителя в личном кабинете (юните) клиента маркетплейса

```javascript
Запрос:
{  
   "Envelope":{  
      "Header":{  
         "Security":{  
            "UsernameToken":{  
               "Username":"Username",
               "Password":"Password"
            }
         }
      },
      "Body":{  
         "EditProfileDocumentRequest":{  
           "unitId": 12345,
            "profileId": 44444,
            "id": 5057,
            "attribute":             [
                              {
                  "value": "YYYY-MM-DD",
                  "key": "ISSUED"
               },
                              {
                  "value": "0000",
                  "key": "NUMBER"
               },
                              {
                  "value": "000000",
                  "key": "SERIES"
               },
                              {
                  "value": "ISSUER",
                  "key": "ISSUER"
               }
            ],
            "type": "PASSPORT"
         }
         }
      }
   }
   
   Ответ:
   
   {  
   "Envelope":{  
      "Body":{  
         "EditProfileDocumentResponse":{  

         }
      }
   }
}

```

```php
<?php
if (isset($_POST['unit_id']) && isset($_POST['submit'])) {

    $sdkAppFileName = __DIR__ . "/../moneta-sdk-lib/autoload.php";
    include_once($sdkAppFileName);

    try {
        $monetaSdk = new \Moneta\MonetaSdk();
        $monetaSdk->checkMonetaServiceConnection();

        $doc = new \Moneta\Types\EditProfileDocumentRequest();

        $doc->unitId = $_POST['unit_id'];
        $doc->profileId = $_POST['profile_id'];
        $doc->id = $_POST['doc_id'];
        $doc->type = $_POST['doc_type'];

        //Когда выдан документ
        $attribute = new \Moneta\Types\KeyValueApprovedAttribute();
        $attribute->approved = false;
        $attribute->key = "ISSUED";
        $attribute->value = $_POST['issued'];
        $doc->addAttribute($attribute);

        //Серия документа
        $attribute = new \Moneta\Types\KeyValueApprovedAttribute();
        $attribute->approved = false;
        $attribute->key = "SERIES";
        $attribute->value = $_POST['series'];
        $doc->addAttribute($attribute);

        //Номер документа
        $attribute = new \Moneta\Types\KeyValueApprovedAttribute();
        $attribute->approved = false;
        $attribute->key = "NUMBER";
        $attribute->value = $_POST['number'];
        $doc->addAttribute($attribute);

        //Кем выдан документ
        $attribute = new \Moneta\Types\KeyValueApprovedAttribute();
        $attribute->approved = false;
        $attribute->key = "ISSUER";
        $attribute->value = $_POST['issuer'];
        $doc->addAttribute($attribute);

        //сохранение документа подпрофиля руководителя
        $result = $monetaSdk->monetaService->EditProfileDocument($doc);

        if (!empty($result)) {
            throw new Exception(print_r($result, true));
        }

        echo "Данные документа подпрофиля руководителя успешно сохранены.";

    } catch (Exception $e) {
        echo "Произошла ошибка:<br />";
        echo "<pre>" . $e->getMessage() . "</pre>";
    }

} else {
    echo '
        <form method="post">
            unit ID организации (площадки):<br/>
            <input type="text" name="unit_id" required="required"/><br/><br/>

            ID подпрофиля руководителя (Director):<br/>
            <input type="text" name="profile_id" required="required"/><br/><br/>
            
            ID документа подпрофиля руководителя:<br/>
            <input type="text" name="doc_id" required="required"/><br/><br/>

            Тип документа:<br/>
            <select name="doc_type" required="required">
                <option value=""></option>
                <option value="PASSPORT">Паспорт</option>
            </select><br/><br/>

            Когда выдан документ:<br/>
            <input type="date" name="issued" required="required"/><br/><br/>
            
            Серия документа:<br/>
            <input type="text" name="series" required="required" placeholder="0000"/><br/><br/>
            
            Номер документа:<br/>
            <input type="text" name="number" required="required" placeholder="000000"/><br/><br/>
            
            Кем выдан документ:<br/>
            <input type="text" name="issuer" required="required"/><br/><br/>

            <input type="submit" name="submit" value="Сохранить документ подпрофиля руководителя"/>
        </form>
    ';
}
```

Все запросы маркетплейс отправляет с помощью интерфейса MONETA.MerchantAPI.

{% hint style="info" %}
Интерфейс [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-ip-i-yul/13.-registraciya-prodavcov-ploshadki-v-sisteme-moneta.ru/13.5.-zaprosy-dlya-podklyucheniya-prodavca-k-sisteme-moneta.ru/editprofiledocumentrequest-dokumenta-rukovoditelya.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.
