* @property integer $id * @property $document_type // тип документа Возможные значения для этого поля 'prihod','rashod','inventar','transfer','invoice' * @property integer $document_id // id документа * @property integer $document_number // номер документа * @property integer $clinic_id // id клиники
Пример запроса получения настройки нумерации складских документов
Эта настройка отвечает за ведение нумерации складских документов.
curl --location -g --request GET 'https://{DOMAIN NAME}/rest/api/properties/?filter=[{"property":"clinic_id", "value":"1", "operator": "="},{"property":"property_name", "value":["numbering-store-enabled"], "operator": "IN"}]' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Если в результате запроса property_value равно 0 или результат пустой, то значит настройка выключена, 1 - настройка включена.
Пример ответа сервера
{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": 1,
"properties": [
{
"id": 409,
"property_name": "numbering-store-enabled",
"property_value": "1",
"property_title": "",
"clinic_id": 1
}
]
}
}
Только при включеyной настройке numbering-store-enabled можно получить данные по складским документам из DocumentNumber.
curl --location -g --request GET 'https://{DOMAIN NAME}/rest/api/DocumentNumber/?filter=[{"property":"document_type", "value":"prihod", "operator": "="},{"property":"document_number", "value":"457", "operator": "="}]' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'
Пример ответа сервера
{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": 1,
"documentNumber": [
{
"id": 196495,
"document_type": "prihod",
"document_id": 133739,
"document_number": "457",
"number_mask": "{d}",
"number_clear": 457,
"clinic_id": 1,
"unique_crutch": 1
}
]
}
}
Пример запроса получения ID документа для счетов
curl --location -g --request GET 'https://{DOMAIN NAME}/rest/api/DocumentNumber/?filter=[{"property":"document_type", "value":"invoice", "operator": "="},{"property":"document_number", "value":"96499", "operator": "="}]' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'
Пример ответа сервера
{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": 1,
"documentNumber": [
{
"id": 192386,
"document_type": "invoice",
"document_id": 190504,
"document_number": "96499",
"number_mask": "{d}",
"number_clear": 96499,
"clinic_id": 0,
"unique_crutch": 1
}
]
}
}Пример запроса получения записи по ID
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/DocumentNumber/192424' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'
Пример ответа сервера
{
"success": true,
"message": "Record Retrieved Successfully",
"data": {
"totalCount": 1,
"documentNumber": {
"id": 192424,
"document_type": "invoice",
"document_id": 190542,
"document_number": "96518",
"number_mask": "{d}",
"number_clear": 96518,
"clinic_id": 0,
"unique_crutch": 1
}
}
}