MENU

料金プラン

機能一覧

デモ

ご利用の流れ

お役立ちコラム



クーポン

操作ガイド

Amelia API – クーポン

ここでは、クーポンに関連するAPIエンドポイントをご覧いただけます。

すべてのAPIエンドポイントと、リクエストおよびレスポンスの例は、こちらからダウンロードできるAmelia API Postmanコレクションで確認できます。

APIエンドポイントの使用には、一定のコーディングスキルが必要であり、プラグインで提供されるサポートには含まれていません。

認証

すべてのAmeliaエンドポイントは、Ameliaという名前のヘッダープロパティを使用したAPIキー認証を採用しています。

パス

Amelia APIのパスは以下で始まります:{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1

クーポンの検証

クーポンを検証します。

メソッド

このエンドポイントはPOSTリクエストを受け付けます。

パス

/coupons/validate

必須プロパティ

これらのプロパティは必須です。

キータイプ説明
codestringクーポンコード
idintegerエンティティID(サービス、イベント、またはコースのID)
typestringエンティティタイプ。使用可能な値:service(サービス)、packageコース)、event(イベント)
userobjectfirstNamelastNameemailメール)を含むオブジェクト。お客様のクーポン利用制限に達しているかどうかのチェックに使用されます。

オプションのプロパティ

キータイプ説明
countintegerすべての繰り返し予約のクーポンを検証する際に使用されます。count = 繰り返し予約の数

リクエスト
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": "amelia@test.test"
},
"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
}
}

クーポンの追加

クーポンを作成します。

メソッド

このエンドポイントはPOSTリクエストを受け付けます。

パス

/coupons

必須プロパティ

これらのプロパティは必須です。

キータイプ説明
codestringクーポンコード
limitintegerクーポンの使用制限

オプションのプロパティ

キータイプ説明
discountintegerクーポンの割引率(パーセンテージ)。
deductionfloatクーポンの割引額。
customerLimitintegerお客様あたりの利用制限。
notificationIntervalintegerお客様が通知でクーポンを受け取る、承認された予約の回数。
notificationRecurringboolean設定されたnotificationIntervalが繰り返し適用されるかどうか。デフォルト値はfalseです。
statusstringクーポンのステータス。使用可能な値:visible(表示)、hidden(非表示)
servicesarrayクーポンが適用されるサービスIDの配列。
eventsarrayクーポンが適用されるイベントIDの配列。
packagesarrayクーポンが適用されるコースIDの配列。
expirationDatestringクーポンの有効期限。形式:YYYY-MM-DD

リクエスト
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": "指定額",
"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": "指定額",
"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": "amelia@test.test",
"phone": null,
"type": "お客様",
"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": "amelia1@test.test",
"phone": "+381601234567",
"type": "お客様",
"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": "frank@test.test",
"phone": null,
"type": "お客様",
"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
}
]
}
],
"expirationDate": "2023-10-06"
}
}
}

クーポンの更新

クーポン詳細を更新します。

メソッド

このエンドポイントはPOSTリクエストを受け付けます。

パス

/coupons/{{coupon_id}}

オプションのプロパティ

更新したいプロパティのみを送信してください。

キータイプ説明
codestringクーポンコード
discountintegerクーポンの割引率(パーセンテージ)。
deductionfloatクーポンの割引額。
limitintegerクーポンの利用制限。
customerLimitintegerお客様あたりの利用制限。
notificationIntervalintegerお客様が通知でクーポンを受け取る、承認された予約の回数。
notificationRecurringboolean設定されたnotificationIntervalが繰り返し適用されるかどうか。デフォルト値はfalseです。
statusstringクーポンのステータス。使用可能な値:visible(表示)、hidden(非表示)
servicesarrayクーポンが適用されるサービスIDの配列。
eventsarrayクーポンが適用されるイベントIDの配列。
packagesarrayクーポンが適用されるコースIDの配列。
expirationDatestringクーポンの有効期限。形式:YYYY-MM-DD

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/coupons/14' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "code": "COUPON", "discount": 0, "deduction": 20 }'
レスポンス
{
"message": "Coupon successfully updated.",
"data": {
"coupon": {
"id": 14,
"code": "COUPON",
"discount": 0,
"deduction": 20,
"limit": 20,
"customerLimit": 2,
"used": 0,
"notificationInterval": 0,
"notificationRecurring": false,
"status": "visible",
"serviceList": [],
"eventList": [],
"packageList": [],
"expirationDate": "2023-10-06"
}
}
}

クーポンの取得

クーポン詳細を取得します。

メソッド

このエンドポイントはGETリクエストを受け付けます。

パス

/coupons/{{coupon_id}}

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/coupons/5' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
"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": [
{
"id": 1,
"name": "amelia service",
"description": "location address: %location_address%",
"color": "#1788FB",
"price": 20,
"deposit": 14,
"depositPayment": "指定額",
"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": [],
"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": "2023-05-06"
}
}
}

複数のクーポンの取得

クーポン詳細を取得します。

メソッド

このエンドポイントはGETリクエストを受け付けます。

パス

/coupons

リクエスト
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": "指定額",
"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": "指定額",
"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": "指定額",
"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": [
{
"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
}
]
}
],
"expirationDate": "2023-10-06"
}
}
}

クーポンの削除

クーポンを削除します。

メソッド

このエンドポイントはPOSTリクエストを受け付けます。

パス

/coupons/delete/{{coupon_id}}

リクエスト
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": "COUPON",
"discount": 0,
"deduction": 10,
"limit": 20,
"customerLimit": 2,
"used": 0,
"notificationInterval": 0,
"notificationRecurring": false,
"status": "visible",
"serviceList": [],
"eventList": [],
"packageList": [],
"expirationDate": "2023-10-06"
}
}
}