Add

[POST] .../v1/customerpersonaldocument/add

Creates personal document customer. Use this method to create one personal document record for a retail customer and document type, optionally attaching a file in JSON base64 form or multipart form-data. The request requires customer_id, personal_doc_type_id and value, validates file.name, file.extension and file.data for JSON uploads or the uploaded multipart file for multipart uploads and returns new_id as a success marker because the document is identified by customer_id plus personal_doc_type_id. The method checks the current request user and requires customer personal document add permission; it validates the personal document type mask, rejects duplicate customer and type records and returns malformed body, missing field, invalid mask, duplicate, permission, file storage, foreign-key and storage failures as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
customer_id Int64 Required Customer ID.
file CommonFileAdd Optional Attached personal document file.
personal_doc_type_id Int64 Required Personal document type ID.
value String Required Personal document value, such as a document number or identifier.

Request Example

{
  "customer_id": 1,
  "file": {
    "access_level": "system",
    "data": "string",
    "duration_ms": 1,
    "extension": "string",
    "folder_id": 1,
    "height": 1,
    "name": "string",
    "user_id": 1,
    "width": 1
  },
  "personal_doc_type_id": 1,
  "value": "string"
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 1
  }
}