Logo

Products

Договоры (далее продукты) являются основной частью AIINS. На этой странице мы подробно рассмотрим различные конечные точки продуктов, которые вы можете использовать для программного управления продуктами. Мы рассмотрим, как запрашивать, создавать, обновлять и удалять продукты.

The products model

Модель продуктов содержит всю информацию о ваших продуктах, такую ​​как: номер договора, страхователь, страховщик и т.д. Она также содержит ссылку на полис, т. к. один продукт может иметь несколько полисов. Продукт - это основная информация, а полис хранит данные специфичные самому полису.

Свойства

  • Name
    id
    Type
    integer
    Description

    Первичный ключ, уникальное поле.

  • Name
    additional_information
    Type
    string
    Description

    Дополнительная информация.

  • Name
    chatId
    Type
    string
    Description

    ID чат комнаты связанной с этим продуктом.

  • Name
    contact
    Type
    string
    Description

    Контактная информация.

  • Name
    delete
    Type
    boolean
    Description

    Есть ли права на удаление продукта.

  • Name
    docs_count
    Type
    integer
    Description

    Количество документов связанных с продуктом.

  • Name
    executor
    Type
    string
    Description

    Исполнитель договора (как правило тот, кто занес в систему).

  • Name
    holding
    Type
    string
    Description

    Принадлежность к холдингу.

  • Name
    improving_conditions
    Type
    string
    Description

    Улучшение условий по текущему продукту.

  • Name
    insurance_type
    Type
    string
    Description

    Вид или виды страхования в данном продукте.

  • Name
    insurant
    Type
    string
    Description

    Страхователь.

  • Name
    insurer
    Type
    string
    Description

    Страховщик.

  • Name
    product_type
    Type
    string
    Description

    Тип продукта.

  • Name
    prolongation_type
    Type
    string
    Description

    Тип пролонгации.

  • Name
    redundancy
    Type
    string
    Description

    Была ли ранее убыточность по продукту.

  • Name
    status
    Type
    string
    Description

    Статус продукта.

  • Name
    subagent
    Type
    string
    Description

    Субагент.

  • Name
    time_of_action_end
    Type
    timestamp
    Description

    Дата начала действия продукта.

  • Name
    time_of_action_start
    Type
    timestamp
    Description

    Дата окончания действия продукта.

  • Name
    time_update
    Type
    timestamp
    Description

    Дата и время обновления продукта.

  • Name
    treaty_number
    Type
    string
    Description

    Номер продукта (договора).

  • Name
    unReadMessages
    Type
    integer
    Description

    Количество непрачитанных сообщений.

  • Name
    update
    Type
    boolean
    Description

    Есть ли права на изменение продукта.

  • Name
    user_update
    Type
    string
    Description

    Пользователь изменивший договор.


GET/api/v1/aiins/products/all

List all products

Эта конечная точка позволяет вам получить список всех ваших продуктов.

Обязательные атрибуты

  • Name
    public_key
    Type
    string
    Description

    API key.

Request

GET
/api/v1/aiins/products/all
curl -G https://backend.aiins.online/api/v1/aiins/products/all 
  -H "Authorization: JWT {token}" \
  -H "Accept: application/json" \
  -d "public_key={API key}"

Response

  {
    "update": true,
    "delete": true,
    "id": 4389,
    "treaty_number": "0348364441SR",
    "contact": null,
    "holding": "Не указан",
    "additional_information": "",
    "improving_conditions": null,
    "insurant_original": "АДЕПТ",
    "redundancy": null,
    "insurant": "АДЕПТ",
    "insurer": "ОСК",
    "owner": "ГК1520",
    "executor": "Оксана Таранец",
    "product_type": "Договор-полис",
    "prolongation_type": "",
    "status": "Закрыт",
    "subagent": "Не указан",
    "time_of_action_start": "10/03/2021",
    "time_of_action_end": "09/03/2022",
    "docs_count": 0,
    "insurance_type": "КАСКО",
    "user_update": "Таранец",
    "time_update": "2023-10-27 12:24:56.293",
    "unReadMessages": null,
    "policies": [
        {
            "update": true,
            "delete": true,
            "chatId": "policy_6481",
            "id": 6481,
            "CC": 2850000,
            "CP": 65000,
            "tarif": "2.2807000",
            "policy": "0348364441SR",
            "currency": "Рубль",
            "product": "0348364441SR",
            "beneficiary": "",
            "date_start": "10/03/2021",
            "date_end": "09/03/2022",
            "days_left_before_the_next_payment": "Оплачено",
            "insurance_object": "Audi A5 (UDV1U558PTXGFUESS, C444MT64)",
            "insurance_type": "КАСКО",
            "prolongation_type": "Требуется",
            "holdings": null,
            "insurer": "ОСК",
            "insurant": "АДЕПТ",
            "executor": "Оксана Таранец",
            "is_close": true,
            "user_update": "Таранец",
            "time_update": "27-10-2023 00:00::00",
            "expert_info": null,
            "insurance_objects_id": 5264,
            "insurance_conditions_options": {
                "options": [
                    {
                        "name": "damage_insurance",
                        "type": "boolean",
                        "label": "Страхование от ущерба",
                        "damage_insurance": true
                    },
                    {
                        "name": "hijacking_insurance",
                        "type": "boolean",
                        "label": "Страхование от угона",
                        "hijacking_insurance": true
                    },
                    {
                        "gap": true,
                        "name": "gap",
                        "type": "boolean",
                        "label": "GAP"
                    },
                    {
                        "name": "glasses_without_info",
                        "type": "text",
                        "label": "Стекла без справок",
                        "glasses_without_info": "1"
                    },
                    {
                        "name": "number_of_handling_without_info",
                        "type": "number",
                        "label": "Кол-во обращений без справок",
                        "number_of_handling_without_info": "1"
                    },
                    {
                        "name": "compensation_without_info_for_period",
                        "type": "number",
                        "label": "Сумма возмещения без справок за период",
                        "compensation_without_info_for_period": "1000000"
                    },
                    {
                        "name": "avarkom",
                        "type": "boolean",
                        "label": "Аварком",
                        "avarkom": true
                    },
                    {
                        "name": "technical_assistance",
                        "type": "boolean",
                        "label": "Техпомощь",
                        "technical_assistance": true
                    },
                    {
                        "name": "taxi",
                        "taxi": true,
                        "type": "boolean",
                        "label": "Такси"
                    }
                ],
                "insurance_conditions": {
                    "insurance_cover": "",
                    "individual_conditions": "",
                    "purpose_of_using_the_vehicle": "Прочее"
                }
            },
            "product_id": 4389,
            "is_withdrawn": false,
            "settlement_id": null,
            "owner": "ГК1520",
            "borrower": "",
            "creditor": null,
            "leasingTaker": null,
            "leasingGiver": null,
            "pledgeHolder": null,
            "franchise": "0",
            "franchiseType": "Без франшизы",
            "renter": null,
            "status": "Закрыт"
        }
    ],
    "chatId": "product_4389"
}

POST/api/v1/aiins/products

Create a product

Эта конечная точка позволяет вам создать новый продукт.

Обязательные атрибуты

  • Name
    public_key
    Type
    string
    Description

    API key в GET-параметре

  • Name
    body
    Type
    string
    Description

    Тело запроса

Request

POST
/api/v1/aiins/products
curl -X POST "https://backend.aiins.online/api/v1/aiins/products?public_key={API key}"
  -H "Authorization: JWT {token}" \
  -H "Accept: application/json" \
  -d 'body'

Payload

{
  "id": null,
  "treaty_number": "productNumber",
  "policies_next_num": null,
  "ready_to_request": null,
  "policy_number_prefix": null,
  "contact": null,
  "additional_information": null,
  "improving_conditions": null,
  "redundancy": null,
  "bordereau": false,
  "insurant": "АДЕПТ",
  "insurer": "ТИНЬКОФФ СТРАХОВАНИЕ",
  "owner": null,
  "executor": "Insurance",
  "status": "Действующий",
  "product_type": "Договор-полис",
  "prolongation_type": null,
  "subagent": null,
  "insurant_inn": "7814465872",
  "insurant_address": "197374, ГОРОД САНКТ-ПЕТЕРБУРГ, УЛ. МЕБЕЛЬНАЯ, Д. 12, К. 1 ЛИТЕР А, ПОМ. 20Н №38 ОФИС 254",
  "insurant_opf": "ООО",
  "insurant_ogrn": "1107847118060",
  "ownerInn": null,
  "ownerAddress": null,
  "ownerOpf": null,
  "ownerOgrn": null,
  "insurer_inn": "7704082517",
  "insurer_address": "Россия, г Москва, ул Хуторская 2-я, д 38А стр 26",
  "insurer_opf": "АО",
  "insurer_ogrn": "1027739031540",
  "subagent_inn": null,
  "subagent_address": null,
  "subagent_opf": null,
  "subagent_ogrn": null,
  "initModelWork": null,
  "_id": 1,
  "uuid": "c4e6812e-d072-449f-a3e0-4fca34e7cde7",
  "time_of_action_start": "2023-10-02",
  "time_of_action_end": "2024-10-01"
}

Response

{
  "update": true,
  "delete": true,
  "id": 6407,
  "treaty_number": "productNumber",
  "contact": null,
  "additional_information": null,
  "improving_conditions": null,
  "redundancy": null,
  "insurant": "АДЕПТ",
  "insurer": "ТИНЬКОФФ СТРАХОВАНИЕ",
  "owner": "",
  "policies_next_num": null,
  "executor": "Adept Insurance",
  "product_type": "Договор-полис",
  "prolongation_type": "",
  "status": "Действующий",
  "subagent": "",
  "holding": "",
  "user_update": "Adept Insurance",
  "time_update": "27-10-2023 13:33:21",
  "chatId": "product_6407",
  "time_of_action_start": "2023-10-02",
  "time_of_action_end": "2024-10-01",
  "ready_to_request": false,
  "policy_number_prefix": null,
  "prolonged_product_id": null,
  "initModelWork": {
      "active": true,
      "model": "FIXED_SUBSCRIPTION"
  }
}

GET/api/v1/aiins/products/:id

Retrieve a product

Эта конечная точка позволяет вам получить продукт, указав его идентификатор. Обратитесь к списку вверху этой страницы, чтобы узнать, какие свойства включены в продукт.

Обязательные атрибуты

  • Name
    public_key
    Type
    string
    Description

    API key в GET-параметре

Request

GET
/api/v1/products/:id
curl -G https://backend.aiins.online/api/v1/aiins/products/:id 
  -H "Authorization: JWT {token}" \
  -H "Accept: application/json" \
  -d "public_key={API key}"

Response

{
  "update": null,
  "delete": null,
  "id": 4608,
  "treaty_number": "1006766363TL",
  "contact": null,
  "additional_information": "",
  "improving_conditions": "12312",
  "redundancy": 3123213,
  "insurant": "ВТБ ЛИЗИНГ",
  "insurer": "САО РЕСО-ГАРАНТИЯ",
  "owner": "ЛИЗИНГОВАЯ КОМПАНИЯ КАМАЗ",
  "policies_next_num": null,
  "executor": "Адепт Инс",
  "product_type": "С многолетним полисом",
  "prolongation_type": "Требуется",
  "status": "Действующий",
  "subagent": "",
  "holding": "",
  "user_update": "Адепт Инс",
  "time_update": "26-10-2023 18:49:38",
  "chatId": "product_4608",
  "time_of_action_start": "2020-12-02",
  "time_of_action_end": "2025-12-01",
  "ready_to_request": false,
  "policy_number_prefix": null,
  "prolonged_product_id": null,
  "initModelWork": {
      "active": false,
      "model": null
  }
}

PUT/api/v1/aiins/products/:id

Update a product

Эта конечная точка позволяет вам изменить текущий продукт.

Обязательные атрибуты

  • Name
    public_key
    Type
    string
    Description

    API key в GET-параметре

  • Name
    body
    Type
    string
    Description

    Тело запроса

Request

PUT
/api/v1/aiins/products/:id
curl -X PUT "https://backend.aiins.online/api/v1/aiins/products/:id?public_key={API key}"
  -H "Authorization: JWT {token}" \
  -H "Accept: application/json" \
  -d 'body'

Payload

{
  "id": 4608,
  "prolonged_product_id": null,
  "status": "Действующий",
  "product_type": "С многолетним полисом",
  "prolongation_type": "Требуется",
  "treaty_number": "1006766363TL",
  "policies_next_num": null,
  "ready_to_request": false,
  "policy_number_prefix": null,
  "insurant": "ВТБ ЛИЗИНГ",
  "owner": "ЛИЗИНГОВАЯ КОМПАНИЯ КАМАЗ",
  "insurer": "САО РЕСО-ГАРАНТИЯ",
  "subagent": null,
  "time_of_action_start": "2020-12-02",
  "time_of_action_end": "2025-12-01",
  "improving_conditions": "12312",
  "redundancy": 3000000,
  "contact": null,
  "additional_information": "",
  "sucessFee": false
}

Response

{
  "update": true,
  "delete": true,
  "id": 4608,
  "treaty_number": "1006766363TL",
  "contact": null,
  "additional_information": "",
  "improving_conditions": "12312",
  "redundancy": 3000000,
  "insurant": "ВТБ ЛИЗИНГ",
  "insurer": "РЕСО-ГАРАНТИЯ",
  "owner": "ЛИЗИНГОВАЯ КОМПАНИЯ КАМАЗ",
  "policies_next_num": null,
  "executor": "Adept Insurance",
  "product_type": "С многолетним полисом",
  "prolongation_type": "Требуется",
  "status": "Действующий",
  "subagent": "",
  "holding": "",
  "user_update": "Adept Insurance",
  "time_update": "27-10-2023 13:40:45",
  "chatId": "product_4608",
  "time_of_action_start": "2020-12-02",
  "time_of_action_end": "2025-12-01",
  "ready_to_request": false,
  "policy_number_prefix": null,
  "prolonged_product_id": null,
  "initModelWork": {
      "active": false,
      "model": null
  }
}

DELETE/api/v1/aiins/products/:id

Delete a product

Эта конечная точка позволяет вам удалять продукты. Примечание: это также приведет к удалению всех связанных сущностей, включая файлы.

Request

DELETE
/api/v1/aiins/products/:id
curl -X DELETE "https://backend.aiins.online/api/v1/aiins/products/:id?public_key={API key}"
  -H "Authorization: JWT {token}" \
  -H "Accept: application/json"