Brendan Jefferis wrote:
Dmitry Bondarev wrote:
Please provide HTTP requests and responces.
Request (with filter)
GET /admin/promotions/gift-cards?filter[service_id]=28 HTTP/1.1
Host: user-api-v2.simplybook.me
X-Company-Login: vicinitytest
X-Token:
Response
...
...
Request (no filter)
GET /admin/promotions/gift-cards HTTP/1.1
Host: user-api-v2.simplybook.me
X-Company-Login: vicinitytest
X-Token:
Response
{
"data": [
{
"id": 313,
"promotion": {
"id": 15,
"name": "Test",
"description": "",
"file_id": null,
"picture_preview": null,
"picture_large": null,
"is_active": true,
"position": 18,
"price": 1.0,
"currency": "AUD",
"tax": {
"id": 1,
"name": "GST",
"ratio": 0.1,
"is_default": true
},
"promotion_type": "gift_card",
"discount_type": "fixed_amount",
"discount": 10.0,
"duration_type": "month",
"duration": 1,
"client_type": "all",
"allow_usage_count": 1,
"is_unlimited": false,
"affect_services": true,
"affect_products": false,
"affect_paid_attributes": false,
"affect_memberships": false,
"service_restrictions": [],
"booking_restrictions": [],
"product_restrictions": [],
"paid_attribute_restrictions": [],
"memberships_restrictions": [],
"print_template_id": 1
},
"start_date": "2021-09-06",
"expired_date": "2021-10-06",
"is_used": false,
"can_be_used": true,
"can_be_used_count": -1,
"code": "gubyrequ",
"client_id": null,
"client": null,
"user_id": "1",
"user": {
"id": 1,
"login": "admin",
"firstname": "Dhanushka",
"lastname": "",
"email": "dhanushka.krishnajith@vicinity.com.au",
"phone": "+61420363881",
"company": {
"login": "vicinitytest",
"name": "Vicinity Real Estate Licence Pty Ltd",
"dashboard_url": "https://vicinitytest.secure.simplybook.me",
"public_url": "https://vicinitytest.simplybook.me",
"id": null
}
},
"status": "valid",
"used_count": "0",
"used_amount": null,
"rest_amount": 10.0,
"allowed_to_use_full_amount": true
},
{
"id": 312,
"promotion": {
"id": 7,
"name": "Porter | 1 Hour",
"description": "",
"file_id": null,
"picture_preview": null,
"picture_large": null,
"is_active": true,
"position": 12,
"price": 60.0,
"currency": "AUD",
"tax": {
"id": 1,
"name": "GST",
"ratio": 0.1,
"is_default": true
},
"promotion_type": "gift_card",
"discount_type": "percentage",
"discount": 100.0,
"duration_type": "year",
"duration": 5,
"client_type": "all",
"allow_usage_count": 1,
"is_unlimited": false,
"affect_services": true,
"affect_products": false,
"affect_paid_attributes": false,
"affect_memberships": false,
"service_restrictions": [],
"booking_restrictions": [],
"product_restrictions": [],
"paid_attribute_restrictions": [],
"memberships_restrictions": [],
"print_template_id": 1
},
"start_date": "2021-09-06",
"expired_date": "2026-09-06",
"is_used": false,
"can_be_used": true,
"can_be_used_count": 1,
"code": "ypymaqun",
"client_id": null,
"client": null,
"user_id": "1",
"user": {
"id": 1,
"login": "admin",
"firstname": "Dhanushka",
"lastname": "",
"email": "dhanushka.krishnajith@vicinity.com.au",
"phone": "+61420363881",
"company": {
"login": "vicinitytest",
"name": "Vicinity Real Estate Licence Pty Ltd",
"dashboard_url": "https://vicinitytest.secure.simplybook.me",
"public_url": "https://vicinitytest.simplybook.me",
"id": null
}
},
"status": "valid",
"used_count": "0",
"used_amount": null,
"rest_amount": null,
"allowed_to_use_full_amount": true
}
]
}