Модель ClientDiscountCard (инфо. скидочных карт клиентов)
* @property integer $id // ИД скидочной карты * @property string $number // Номер скидочной карты * @property integer $client_id // ID клиента, которому принадлежит карта * @property integer $card_type_id // ID типа скидочной карты @property integer $is_default // Активна по умолчанию? @property string $end_date // Дата окончания срока действия @property string $start_date // Дата начала срока действия @property integer $pet_id // ID питомца, если привязан
Пример получения данных по скидочной карте
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/ClientDiscountCard/1' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Record Retrieved Successfully",
"data": {
"totalCount": 1,
"clientDiscountCard": {
"id": "1",
"number": "123456",
"create_date": "2014-10-31 14:28:14",
"client_id": "4",
"card_type_id": "1",
"is_default": "1",
"end_date": null,
"pet_id": "0",
"start_date": null,
"client": {
"id": "4",
"address": "",
"home_phone": "",
"work_phone": "",
"note": "",
"type_id": null,
"how_find": null,
"balance": "0.0000000000",
"email": "",
"city": "",
"city_id": "145",
"date_register": "0000-00-00 00:00:00",
"cell_phone": "",
"zip": "",
"registration_index": null,
"vip": "0",
"last_name": "Соскидков",
"first_name": "",
"middle_name": "",
"status": "DISABLED",
"discount": "0",
"passport_series": "",
"lab_number": "",
"street_id": "0",
"apartment": "",
"unsubscribe": "0",
"in_blacklist": "0",
"last_visit_date": "0000-00-00 00:00:00",
"number_of_journal": "",
"phone_prefix": "0"
}
}
}
}Пример добавления скидочной карты
curl --location --request POST 'https://{DOMAIN NAME}/rest/api/ClientDiscountCard \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}' \
--data-raw '{
"number":”123123”,
"client_id":1,
"card_type_id":1,
}'Ответ сервера
{
"success": true,
"message": "Record(s) Created",
"data": {
"totalCount": 1,
"clientDiscountCard": [
{
"number": "123123",
"is_default": 0,
"pet_id": 0,
"client_id": "1",
"card_type_id": "1",
"id": "4",
"create_date": null,
"end_date": null,
"start_date": null
}
]
}