Here you can see API endpoints related to coupons.
You can see all the API endpoints with examples of requests and responses in the Amelia API Postman collection which you can download here.
Authorization
All Amelia endpoints use an API key authorization, using the header property named “Amelia”.
Path
Amelia API paths start with: {{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
Validate coupon
Validate coupon.
Method
This endpoint accepts POST requests.
Path
/coupons/validate
Required Properties
These properties are required:
Key | Type | Description |
---|---|---|
code | string | Coupon code |
id | integer | Entity ID (service, event or package ID) |
type | string | Entity type. Possible values: service, package, event |
user | object | Object with the following values: firstName, lastName and email. Used to check if coupon limit is reached for a user |
Optional Properties
Key | Type | Description |
---|---|---|
count | integer |
Used when validating coupons for all recurring bookings; count = number of recurring bookings
|
Example
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/coupons/validate' \ --header 'Content-Type: application/json' \ --header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \ --data-raw '{ "code": "COUPON", "id": 1, "type": "appointment", "user": { "firstName": "Amelia", "lastName": "Test", "email": "[email protected]" }, "count": 1 }'
{ "message": "Successfully retrieved coupon.", "data": { "coupon": { "id": 5, "code": "COUPON", "discount": 0, "deduction": 10, "limit": 100, "customerLimit": 2, "used": 0, "notificationInterval": 0, "notificationRecurring": false, "status": "visible", "serviceList": [], "eventList": [], "expirationDate": "2023-05-06" }, "limit": 2 } }
Add coupon
Create a coupon.
Method
This endpoint accepts POST requests.
Path
/coupons
Required Properties
These properties are required:
Key | Type | Description |
---|---|---|
code | string | Coupon code |
limit | integer | Usage limit of the coupon |
Optional Properties
Key | Type | Description |
---|---|---|
discount
|
integer | The discount of the coupon in percentage. |
deduction
|
float | The deduction of the coupon. |
customerLimit
|
integer | Limit per customer. |
notificationInterval
|
integer | The number of approved bookings a customer after which the customer will receive a coupon in the notification. |
notificationRecurring
|
boolean | Whether the notificationInterval set will be recurring. Default value is false. |
status
|
string | The status of the coupon. Possible values: visible, hidden |
services
|
array | Array of service ids for which the coupon applies to. |
events
|
array | Array of event ids for which the coupon applies to. |
packages
|
array | Array of package ids for which the coupon applies to. |
expirationDate
|
string | The expiration date of the coupon. The format is: YYYY-MM-DD |
Example
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/coupons' \ --header 'Content-Type: application/json' \ --header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \ --data '{ "code": "COUPON", "discount": 0, "deduction": 10, "limit": 20, "customerLimit": 2, "notificationInterval": 0, "notificationRecurring": false, "status": "visible", "events": [ 80 ], "services": [ 1 ], "packages": [ 1 ], "expirationDate": "2023-10-06" }'
{ "message": "New coupon successfully created.", "data": { "coupon": { "id": 14, "code": "COUPON", "discount": 0, "deduction": 10, "limit": 20, "customerLimit": 2, "used": 0, "notificationInterval": 0, "notificationRecurring": false, "status": "visible", "serviceList": [ { "id": 1, "name": "amelia service", "description": "location address: %location_address%", "color": "#1788FB", "price": 20, "deposit": 14, "depositPayment": "fixed", "depositPerPerson": true, "pictureFullPath": null, "pictureThumbPath": null, "extras": [ { "id": 17, "name": "Extra 3", "description": "Extra description", "price": 20, "maxQuantity": 1, "position": 1, "duration": 1800, "serviceId": null, "aggregatedPrice": false, "translations": null } ], "coupons": [], "position": 1, "settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"razorpay\":{\"enabled\":true},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.7\"}}", "fullPayment": true, "minCapacity": 1, "maxCapacity": 10, "duration": 1800, "timeBefore": 1800, "timeAfter": 1800, "bringingAnyone": true, "show": true, "aggregatedPrice": true, "status": "visible", "categoryId": 1, "category": null, "priority": [], "gallery": [], "recurringCycle": "all", "recurringSub": "future", "recurringPayment": 999, "translations": null, "minSelectedExtras": 1, "mandatoryExtra": false, "customPricing": "{\"enabled\":false,\"durations\":{\"3600\":{\"price\":30,\"rules\":[]},\"5400\":{\"price\":40,\"rules\":[]}}}", "maxExtraPeople": null, "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}" } ], "eventList": [ { "id": 80, "name": "event 123", "description": "", "color": "#1788FB", "price": 330, "deposit": 110, "depositPayment": "fixed", "depositPerPerson": true, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"general\":{\"minimumTimeRequirementPriorToCanceling\":null,\"redirectUrlAfterAppointment\":null},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}", "fullPayment": false, "bookings": [ { "id": 905, "customerId": 46, "customer": { "id": 46, "firstName": "Amelia", "lastName": "Test", "birthday": null, "email": "[email protected]", "phone": null, "type": "customer", "status": null, "note": null, "zoomUserId": null, "countryPhoneIso": null, "externalId": null, "pictureFullPath": null, "pictureThumbPath": null, "translations": null, "gender": null }, "status": "approved", "extras": [], "couponId": null, "price": 330, "coupon": null, "customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}", "info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}", "appointmentId": null, "persons": 1, "token": null, "payments": [], "utcOffset": null, "aggregatedPrice": true, "isChangedStatus": null, "isLastBooking": null, "packageCustomerService": null, "ticketsData": [], "duration": null, "created": null, "actionsCompleted": null, "isUpdated": null }, { "id": 899, "customerId": 23, "customer": { "id": 23, "firstName": "Amelia", "lastName": "New Last Name", "birthday": null, "email": "[email protected]", "phone": "+381601234567", "type": "customer", "status": null, "note": "Note about customer", "zoomUserId": null, "countryPhoneIso": null, "externalId": null, "pictureFullPath": null, "pictureThumbPath": null, "translations": null, "gender": "female" }, "status": "approved", "extras": [], "couponId": null, "price": 0, "coupon": null, "customFields": "{\"7\":{\"label\":\"My address\",\"value\":\"\",\"type\":\"address\"}}", "info": "{\"firstName\":\"Amelia\",\"lastName\":\"New Last Name\",\"phone\":\"+381601234567\",\"locale\":\"\",\"timeZone\":null,\"urlParams\":null}", "appointmentId": null, "persons": 1, "token": null, "payments": [], "utcOffset": null, "aggregatedPrice": true, "isChangedStatus": null, "isLastBooking": null, "packageCustomerService": null, "ticketsData": [], "duration": null, "created": null, "actionsCompleted": null, "isUpdated": null }, { "id": 898, "customerId": 38, "customer": { "id": 38, "firstName": "Frank", "lastName": "DeAlvarez", "birthday": null, "email": "[email protected]", "phone": null, "type": "customer", "status": null, "note": null, "zoomUserId": null, "countryPhoneIso": null, "externalId": null, "pictureFullPath": null, "pictureThumbPath": null, "translations": null, "gender": null }, "status": "approved", "extras": [], "couponId": null, "price": 330, "coupon": null, "customFields": "{\"7\":{\"label\":\"My address\",\"value\":\"\",\"type\":\"address\"}}", "info": "{\"firstName\":\"Frank\",\"lastName\":\"DeAlvarez\",\"phone\":null,\"locale\":\"\",\"timeZone\":null,\"urlParams\":null}", "appointmentId": null, "persons": 1, "token": null, "payments": [], "utcOffset": null, "aggregatedPrice": true, "isChangedStatus": null, "isLastBooking": null, "packageCustomerService": null, "ticketsData": [], "duration": null, "created": null, "actionsCompleted": null, "isUpdated": null } ], "periods": [ { "id": 80, "eventId": 80, "periodStart": "2023-08-25 17:00:00", "periodEnd": "2023-08-27 23:40:00", "zoomMeeting": null, "lessonSpace": null, "bookings": [], "googleCalendarEventId": null, "googleMeetUrl": null, "outlookCalendarEventId": null } ], "bookingOpens": null, "bookingCloses": null, "bookingOpensRec": "same", "bookingClosesRec": "same", "ticketRangeRec": null, "status": "approved", "recurring": null, "maxCapacity": 11, "maxCustomCapacity": null, "show": true, "tags": [], "customTickets": [], "gallery": [], "providers": [], "notifyParticipants": 1, "locationId": null, "location": null, "customLocation": null, "parentId": null, "created": "2023-08-24 15:20:44", "zoomUserId": null, "organizerId": 35, "type": "event", "bringingAnyone": true, "bookMultipleTimes": true, "translations": null, "customPricing": false, "closeAfterMin": null, "closeAfterMinBookings": false, "maxExtraPeople": null, "initialEventStart": null, "initialEventEnd": null, "aggregatedPrice": true } ], "packageList": [ { "id": 1, "name": "milicas package", "description": "", "color": "#1788FB", "price": 200, "deposit": 20, "depositPayment": "percentage", "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": 5, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}", "fullPayment": false, "type": "package", "status": "visible", "gallery": [], "bookable": [ { "id": 1, "quantity": 1, "service": { "id": 2, "name": "milica service", "description": null, "color": null, "price": 0, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "minCapacity": 1, "maxCapacity": 1, "duration": 1800, "timeBefore": null, "timeAfter": null, "bringingAnyone": null, "show": true, "aggregatedPrice": null, "status": "visible", "categoryId": 1, "category": null, "priority": [], "gallery": [], "recurringCycle": null, "recurringSub": null, "recurringPayment": null, "translations": null, "minSelectedExtras": null, "mandatoryExtra": null, "customPricing": null, "maxExtraPeople": null, "limitPerCustomer": null }, "minimumScheduled": 0, "maximumScheduled": 1, "providers": [], "locations": [], "allowProviderSelection": true }, { "id": 2, "quantity": 1, "service": { "id": 3, "name": "milica2 service", "description": null, "color": null, "price": 20.45, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "minCapacity": 1, "maxCapacity": 1, "duration": 1800, "timeBefore": null, "timeAfter": null, "bringingAnyone": null, "show": true, "aggregatedPrice": null, "status": "visible", "categoryId": 1, "category": null, "priority": [], "gallery": [], "recurringCycle": null, "recurringSub": null, "recurringPayment": null, "translations": null, "minSelectedExtras": null, "mandatoryExtra": null, "customPricing": null, "maxExtraPeople": null, "limitPerCustomer": null }, "minimumScheduled": 0, "maximumScheduled": 1, "providers": [], "locations": [], "allowProviderSelection": true } ], "calculatedPrice": false, "discount": 10, "endDate": null, "durationCount": null, "durationType": null, "translations": null, "sharedCapacity": false, "quantity": 1, "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}" } ], "expirationDate": "2023-10-06" } } }
Update coupon
Update a coupon.
Method
This endpoint accepts POST requests.
Path
/coupons/{{coupon_id}}
Optional Properties
Send only properties which should be updated.
Key | Type | Description |
---|---|---|
code
|
string | The coupon code. |
limit
|
integer | Usage limit of the coupon. |
discount
|
integer | The discount of the coupon in percentage. |
deduction
|
float | The deduction of the coupon. |
customerLimit
|
integer | Limit per customer. |
notificationInterval
|
integer | The number of approved bookings a customer after which the customer will receive a coupon in the notification. |
notificationRecurring
|
boolean | Whether the notificationInterval set will be recurring. Default value is false. |
status
|
string | The status of the coupon. Possible values: visible, hidden |
services
|
array | Array of service ids for which the coupon applies to. |
events
|
array | Array of event ids for which the coupon applies to. |
packages
|
array | Array of package ids for which the coupon applies to. |
expirationDate
|
string | The expiration date of the coupon. The format is: YYYY-MM-DD |
Example
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/coupons/14' \ --data '{ "code": "COUPON2", "discount": 0, "deduction": 20, "limit": 50, "customerLimit": 1, "notificationInterval": 0, "notificationRecurring": false, "status": "visible", "events": [ 16 ], "services": [ 1 ], "packages": [ 1 ], "expirationDate": "2023-05-06" }'
{ "message": "Coupon successfully updated.", "data": { "coupon": { "id": 14, "code": "COUPON2", "discount": 0, "deduction": 20, "limit": 50, "customerLimit": 1, "used": 0, "notificationInterval": 0, "notificationRecurring": false, "status": "visible", "serviceList": [ { "id": 1, "name": "amelia service", "description": "location address: %location_address%", "color": "#1788FB", "price": 20, "deposit": 14, "depositPayment": "fixed", "depositPerPerson": true, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": 1, "settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"razorpay\":{\"enabled\":true},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.7\"}}", "fullPayment": true, "minCapacity": 1, "maxCapacity": 10, "duration": 1800, "timeBefore": 1800, "timeAfter": 1800, "bringingAnyone": true, "show": true, "aggregatedPrice": true, "status": "visible", "categoryId": 1, "category": null, "priority": "least_expensive", "gallery": [], "recurringCycle": "all", "recurringSub": "future", "recurringPayment": 999, "translations": null, "minSelectedExtras": 1, "mandatoryExtra": false, "customPricing": "{\"enabled\":false,\"durations\":{\"3600\":{\"price\":30,\"rules\":[]},\"5400\":{\"price\":40,\"rules\":[]}}}", "maxExtraPeople": null, "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}" } ], "eventList": [ { "id": 16, "name": "test5", "description": "", "color": "#1788FB", "price": 20, "deposit": 0, "depositPayment": "disabled", "depositPerPerson": true, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"general\":{\"minimumTimeRequirementPriorToCanceling\":null,\"redirectUrlAfterAppointment\":null},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true}}", "fullPayment": false, "bookings": [], "periods": [], "bookingOpens": null, "bookingCloses": null, "bookingOpensRec": "same", "bookingClosesRec": "same", "ticketRangeRec": "calculate", "status": "approved", "recurring": null, "maxCapacity": 70, "maxCustomCapacity": null, "show": true, "tags": [], "customTickets": [], "gallery": [], "providers": [], "notifyParticipants": 1, "locationId": null, "location": null, "customLocation": null, "parentId": 14, "created": "2023-03-17 16:17:27", "zoomUserId": null, "organizerId": null, "type": "event", "bringingAnyone": false, "bookMultipleTimes": true, "translations": null, "customPricing": false, "closeAfterMin": null, "closeAfterMinBookings": false, "maxExtraPeople": null, "initialEventStart": null, "initialEventEnd": null, "aggregatedPrice": true } ], "packageList": [ { "id": 1, "name": "milicas package", "description": "", "color": "#1788FB", "price": 200, "deposit": 20, "depositPayment": "percentage", "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": 5, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}", "fullPayment": false, "type": "package", "status": "visible", "gallery": [], "bookable": [], "calculatedPrice": false, "discount": 10, "endDate": null, "durationCount": null, "durationType": null, "translations": null, "sharedCapacity": false, "quantity": 1, "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}" } ], "expirationDate": "2023-05-06" } } }
Get coupon
Retrieve coupon details.
Method
This endpoint accepts GET requests.
Path
/coupons/{{coupon_id}}
Example
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/coupons/14' \ --header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{ "message": "Successfully retrieved coupon.", "data": { "coupon": { "id": 14, "code": "COUPON2", "discount": 0, "deduction": 20, "limit": 40, "customerLimit": 1, "used": 0, "notificationInterval": 0, "notificationRecurring": false, "status": "hidden", "serviceList": [ { "id": 1, "name": "amelia service", "description": "location address: %location_address%", "color": "#1788FB", "price": 20, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "minCapacity": 1, "maxCapacity": 10, "duration": 1800, "timeBefore": null, "timeAfter": null, "bringingAnyone": null, "show": null, "aggregatedPrice": null, "status": "visible", "categoryId": 1, "category": null, "priority": [], "gallery": [], "recurringCycle": null, "recurringSub": null, "recurringPayment": null, "translations": null, "minSelectedExtras": null, "mandatoryExtra": null, "customPricing": null, "maxExtraPeople": null, "limitPerCustomer": null }, { "id": 2, "name": "milica service", "description": "", "color": "#1788FB", "price": 0, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "minCapacity": 1, "maxCapacity": 1, "duration": 1800, "timeBefore": null, "timeAfter": null, "bringingAnyone": null, "show": null, "aggregatedPrice": null, "status": "visible", "categoryId": 1, "category": null, "priority": [], "gallery": [], "recurringCycle": null, "recurringSub": null, "recurringPayment": null, "translations": null, "minSelectedExtras": null, "mandatoryExtra": null, "customPricing": null, "maxExtraPeople": null, "limitPerCustomer": null } ], "eventList": [ { "id": 80, "name": "event 123", "description": null, "color": null, "price": 330, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "bookings": [], "periods": [], "bookingOpens": null, "bookingCloses": null, "bookingOpensRec": null, "bookingClosesRec": null, "ticketRangeRec": null, "status": null, "recurring": null, "maxCapacity": null, "maxCustomCapacity": null, "show": null, "tags": [], "customTickets": [], "gallery": [], "providers": [], "notifyParticipants": null, "locationId": null, "location": null, "customLocation": null, "parentId": null, "created": null, "zoomUserId": null, "organizerId": null, "type": "event", "bringingAnyone": null, "bookMultipleTimes": null, "translations": null, "customPricing": null, "closeAfterMin": null, "closeAfterMinBookings": null, "maxExtraPeople": null, "initialEventStart": null, "initialEventEnd": null, "aggregatedPrice": null } ], "packageList": [], "expirationDate": "2023-05-06" } } }
Get coupons
Retrieve coupons details.
Method
This endpoint accepts GET requests.
Path
/coupons
Example
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/coupons' \ --header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{ "message": "Successfully retrieved coupons.", "data": { "coupons": [ { "id": 14, "code": "COUPON2", "discount": 0, "deduction": 20, "limit": 40, "customerLimit": 1, "used": 0, "notificationInterval": 0, "notificationRecurring": false, "status": "hidden", "serviceList": [ { "id": 1, "name": "amelia service", "description": "location address: %location_address%", "color": "#1788FB", "price": 20, "deposit": 14, "depositPayment": "fixed", "depositPerPerson": true, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": 1, "settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"razorpay\":{\"enabled\":true},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.7\"},\"general\":{\"minimumTimeRequirementPriorToCanceling\":null}}", "fullPayment": true, "minCapacity": 1, "maxCapacity": 10, "duration": 1800, "timeBefore": 1800, "timeAfter": 1800, "bringingAnyone": true, "show": true, "aggregatedPrice": true, "status": "visible", "categoryId": 1, "category": null, "priority": "least_expensive", "gallery": [], "recurringCycle": "all", "recurringSub": "future", "recurringPayment": 999, "translations": null, "minSelectedExtras": 1, "mandatoryExtra": false, "customPricing": "{\"enabled\":false,\"durations\":{\"3600\":{\"price\":30,\"rules\":[]},\"5400\":{\"price\":40,\"rules\":[]}}}", "maxExtraPeople": null, "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}" }, { "id": 2, "name": "milica service", "description": "", "color": "#1788FB", "price": 0, "deposit": 20, "depositPayment": "fixed", "depositPerPerson": false, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": 5, "settings": "{\"payments\":{\"onSite\":true,\"stripe\":{\"enabled\":true},\"razorpay\":{\"enabled\":false},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"payPal\":{\"enabled\":false},\"mollie\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.6\"}}", "fullPayment": false, "minCapacity": 1, "maxCapacity": 1, "duration": 1800, "timeBefore": null, "timeAfter": null, "bringingAnyone": true, "show": true, "aggregatedPrice": true, "status": "visible", "categoryId": 1, "category": null, "priority": "least_expensive", "gallery": [], "recurringCycle": "all", "recurringSub": "future", "recurringPayment": 999, "translations": null, "minSelectedExtras": null, "mandatoryExtra": false, "customPricing": "{\"enabled\":true,\"durations\":{\"3600\":{\"price\":150,\"rules\":[]},\"5400\":{\"price\":200,\"rules\":[]}}}", "maxExtraPeople": null, "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":null,\"period\":null,\"timeFrame\":null,\"from\":null}" } ], "eventList": [ { "id": 80, "name": "event 123", "description": "", "color": "#1788FB", "price": 330, "deposit": 110, "depositPayment": "fixed", "depositPerPerson": true, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"general\":{\"minimumTimeRequirementPriorToCanceling\":null,\"redirectUrlAfterAppointment\":null},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}", "fullPayment": false, "bookings": [], "periods": [], "bookingOpens": null, "bookingCloses": null, "bookingOpensRec": "same", "bookingClosesRec": "same", "ticketRangeRec": "calculate", "status": "approved", "recurring": null, "maxCapacity": 11, "maxCustomCapacity": null, "show": true, "tags": [], "customTickets": [], "gallery": [], "providers": [], "notifyParticipants": 1, "locationId": null, "location": null, "customLocation": null, "parentId": null, "created": "2023-08-24 15:20:44", "zoomUserId": null, "organizerId": 35, "type": "event", "bringingAnyone": true, "bookMultipleTimes": true, "translations": null, "customPricing": false, "closeAfterMin": null, "closeAfterMinBookings": false, "maxExtraPeople": null, "initialEventStart": null, "initialEventEnd": null, "aggregatedPrice": true } ], "packageList": [], "expirationDate": "2023-05-06" }, { "id": 15, "code": "COUPON123", "discount": 10, "deduction": 10.5, "limit": 100, "customerLimit": 0, "used": 0, "notificationInterval": 0, "notificationRecurring": false, "status": "visible", "serviceList": [ { "id": 1, "name": "amelia service", "description": "location address: %location_address%", "color": "#1788FB", "price": 20, "deposit": 14, "depositPayment": "fixed", "depositPerPerson": true, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": 1, "settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"razorpay\":{\"enabled\":true},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.7\"},\"general\":{\"minimumTimeRequirementPriorToCanceling\":null}}", "fullPayment": true, "minCapacity": 1, "maxCapacity": 10, "duration": 1800, "timeBefore": 1800, "timeAfter": 1800, "bringingAnyone": true, "show": true, "aggregatedPrice": true, "status": "visible", "categoryId": 1, "category": null, "priority": "least_expensive", "gallery": [], "recurringCycle": "all", "recurringSub": "future", "recurringPayment": 999, "translations": null, "minSelectedExtras": 1, "mandatoryExtra": false, "customPricing": "{\"enabled\":false,\"durations\":{\"3600\":{\"price\":30,\"rules\":[]},\"5400\":{\"price\":40,\"rules\":[]}}}", "maxExtraPeople": null, "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}" } ], "eventList": [], "packageList": [], "expirationDate": null } ], "filteredCount": 6, "totalCount": 6 } }
Delete coupon
Delete coupon.
Method
This endpoint accepts POST requests.
Path
/coupons/delete/{{coupon_id}}
Example
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/coupons/delete/14' \ --header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{ "message": "Coupon successfully deleted.", "data": { "coupon": { "id": 14, "code": "COUPON2", "discount": 0, "deduction": 20, "limit": 40, "customerLimit": 1, "used": 0, "notificationInterval": 0, "notificationRecurring": false, "status": "hidden", "serviceList": [ { "id": 1, "name": "amelia service", "description": "location address: %location_address%", "color": "#1788FB", "price": 20, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "minCapacity": 1, "maxCapacity": 10, "duration": 1800, "timeBefore": null, "timeAfter": null, "bringingAnyone": null, "show": null, "aggregatedPrice": null, "status": "visible", "categoryId": 1, "category": null, "priority": [], "gallery": [], "recurringCycle": null, "recurringSub": null, "recurringPayment": null, "translations": null, "minSelectedExtras": null, "mandatoryExtra": null, "customPricing": null, "maxExtraPeople": null, "limitPerCustomer": null }, { "id": 2, "name": "milica service", "description": "", "color": "#1788FB", "price": 0, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "minCapacity": 1, "maxCapacity": 1, "duration": 1800, "timeBefore": null, "timeAfter": null, "bringingAnyone": null, "show": null, "aggregatedPrice": null, "status": "visible", "categoryId": 1, "category": null, "priority": [], "gallery": [], "recurringCycle": null, "recurringSub": null, "recurringPayment": null, "translations": null, "minSelectedExtras": null, "mandatoryExtra": null, "customPricing": null, "maxExtraPeople": null, "limitPerCustomer": null } ], "eventList": [ { "id": 80, "name": "event 123", "description": null, "color": null, "price": 330, "deposit": null, "depositPayment": null, "depositPerPerson": null, "pictureFullPath": null, "pictureThumbPath": null, "extras": [], "coupons": [], "position": null, "settings": null, "fullPayment": null, "bookings": [], "periods": [], "bookingOpens": null, "bookingCloses": null, "bookingOpensRec": null, "bookingClosesRec": null, "ticketRangeRec": null, "status": null, "recurring": null, "maxCapacity": null, "maxCustomCapacity": null, "show": null, "tags": [], "customTickets": [], "gallery": [], "providers": [], "notifyParticipants": null, "locationId": null, "location": null, "customLocation": null, "parentId": null, "created": null, "zoomUserId": null, "organizerId": null, "type": "event", "bringingAnyone": null, "bookMultipleTimes": null, "translations": null, "customPricing": null, "closeAfterMin": null, "closeAfterMinBookings": null, "maxExtraPeople": null, "initialEventStart": null, "initialEventEnd": null, "aggregatedPrice": null } ], "packageList": [], "expirationDate": "2023-05-06" } } }