

操作ガイド
ここでは、コースに関連する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リクエストを受け付けます。
パス
/packages
必須プロパティ
以下のプロパティは必須です。
| キー | タイプ | 説明 |
name | string | コースの名前。 |
bookable | array | コースに含まれるサービスオブジェクトの配列。オブジェクトには、service、providers、locations、quantity、minimumScheduled、maximumScheduled、allowProviderSelectionのプロパティがあります。 |
price | double | コースの価格。 |
オプションのプロパティ
以下のプロパティはオプションです。
| キー | タイプ | 説明 |
status | string | コースのステータス。使用可能な値:visible(表示)、hidden(非表示)、disabled(無効)。デフォルト値はvisibleです。 |
description | string | コースの説明。 |
color | string | コースの色。デフォルト値は#1788FBです。 |
calculatedPrice | boolean | コースの価格がサービス価格から計算されるかどうか。デフォルトはtrueです。 |
discount | double | コースの割引率。 |
gallery | array | コースのギャラリー用の画像の配列。 |
pictureFullPath | string | コースの画像のフルパス。 |
pictureThumbPath | string | コースの画像のサムネイルパス。 |
position | integer | コースの位置(並べ替えに使用)。デフォルト値は1です。 |
settings | string | コース設定のJSON形式の文字列。デフォルトでは基本設定が使用されます。 |
endDate | string | コース購入の有効期限の日時。形式:YYYY-MM-DD HH:mm |
durationCount | string | コース購入の有効期限の日数/週/月。 |
durationType | integer | durationCountのタイプ。使用可能な値:day(日)、week(週)、month(月)。 |
translations | string | コースの翻訳のJSON形式の文字列。 |
sharedCapacity | boolean | コースがサービス間で共有定員を持つかどうか。デフォルト値はfalseです。 |
quantity | integer | sharedCapacityがtrueの場合のサービスの数量。 |
limitPerCustomer | integer | お客様あたりのコース購入制限のJSON形式の文字列。 |
descriptionHtml | string | HTML形式でのコースの説明。 |
deposit | double | 前払金の金額。 |
depositPayment | string | コースの前払金のタイプ。使用可能な値:disabled(無効)、fixed(指定額)、percentage(パーセンテージ)。 |
fullPayment | boolean | 前払金が有効な場合、お客様が前払金ではなく全額を支払うオプションを持つかどうか。デフォルトはfalseです。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "bookable": [ { "service": { "id": 1 }, "providers": [], "locations": [], "quantity": 1, "minimumScheduled": 0, "maximumScheduled": 1, "allowProviderSelection": true }, { "service": { "id": 4 }, "providers": [], "locations": [], "quantity": 1, "minimumScheduled": 0, "maximumScheduled": 1, "allowProviderSelection": false } ], "color": "#1788FB", "description": "Description of package", "name": "Amelia 3 Package", "pictureFullPath": "", "pictureThumbPath": "", "price": 55, "calculatedPrice": false, "discount": 0, "status": "visible", "gallery": [], "position": 9, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}", "endDate": null, "durationCount": null, "durationType": null, "deposit": 0, "depositPayment": "disabled", "translations": null, "sharedCapacity": false, "quantity": 1, "limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}", "descriptionHtml": "Description of package" }'
{
"message": "Successfully added new package.",
"data": {
"package": {
"id": 22,
"name": "Amelia 3 Package",
"description": null,
"color": "#1788FB",
"price": 55,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": 1,
"settings": null,
"fullPayment": null,
"type": "package",
"status": "visible",
"gallery": [],
"bookable": [
{
"id": 35,
"quantity": 1,
"service": {
"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": 24,
"name": "Extra 34",
"description": "Description of extra",
"price": 20,
"maxQuantity": 1,
"position": 1,
"duration": null,
"serviceId": null,
"aggregatedPrice": false,
"translations": "{\"name\":{\"ar\":\"\",\"en_US\":\"\",\"fr_FR\":\"supplémentaire\"},\"description\":{\"ar\":\"\",\"en_US\":\"\",\"fr_FR\":\"description du supplément\",\"arHtml\":\"\",\"en_USHtml\":\"\",\"fr_FRHtml\":\"description du supplément\"}}"
},
...
],
"coupons": [],
"position": 1,
"settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"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": [],
"gallery": [],
"recurringCycle": "all",
"recurringSub": "future",
"recurringPayment": 0,
"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\"}"
},
"minimumScheduled": 0,
"maximumScheduled": 1,
"providers": [],
"locations": [],
"allowProviderSelection": true
},
{
"id": 36,
"quantity": 1,
"service": {
"id": 4,
"name": "Service 2",
"description": "",
"color": "#1788FB",
"price": 45,
"deposit": 20,
"depositPayment": "指定額",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": 16,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.2.3\"}}",
"fullPayment": false,
"minCapacity": 1,
"maxCapacity": 1,
"duration": 3600,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": true,
"show": true,
"aggregatedPrice": true,
"status": "visible",
"categoryId": 2,
"category": null,
"priority": [],
"gallery": [],
"recurringCycle": "disabled",
"recurringSub": "future",
"recurringPayment": 0,
"translations": null,
"minSelectedExtras": null,
"mandatoryExtra": false,
"customPricing": "{\"enabled\":false,\"durations\":{}}",
"maxExtraPeople": null,
"limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}"
},
"minimumScheduled": 0,
"maximumScheduled": 1,
"providers": [],
"locations": [],
"allowProviderSelection": false
}
],
"calculatedPrice": true,
"discount": 0,
"endDate": null,
"durationCount": null,
"durationType": null,
"translations": null,
"sharedCapacity": null,
"quantity": 1,
"limitPerCustomer": null
}
}
}
コース詳細を更新します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/packages/{{package_id}}
オプションのプロパティ
| キー | タイプ | 説明 |
name | string | コースの名前。 |
bookable | array | コースに含まれるサービスオブジェクトの配列。オブジェクトには、service、providers、locations、quantity、minimumScheduled、maximumScheduled、allowProviderSelectionのプロパティがあります。 |
price | double | コースの価格。 |
description | string | コースの説明。 |
color | string | コースの色。デフォルト値は#1788FBです。 |
calculatedPrice | boolean | コースの価格がサービス価格から計算されるかどうか。デフォルトはtrueです。 |
discount | double | コースの割引率。 |
gallery | array | コースのギャラリー用の画像の配列。 |
pictureFullPath | string | コースの画像のフルパス。 |
pictureThumbPath | string | コースの画像のサムネイルパス。 |
position | integer | コースの位置(並べ替えに使用)。デフォルト値は1です。 |
settings | string | コース設定のJSON形式の文字列。デフォルトでは基本設定が使用されます。 |
endDate | string | コース購入の有効期限の日時。形式:YYYY-MM-DD HH:mm |
durationCount | string | コース購入の有効期限の日数/週/月。 |
durationType | integer | durationCountのタイプ。使用可能な値:day(日)、week(週)、month(月)。 |
translations | string | コースの翻訳のJSON形式の文字列。 |
sharedCapacity | boolean | コースがサービス間で共有定員を持つかどうか。デフォルト値はfalseです。 |
quantity | integer | sharedCapacityがtrueの場合のサービスの数量。 |
limitPerCustomer | integer | お客様あたりのコース購入制限のJSON形式の文字列。 |
descriptionHtml | string | HTML形式でのコースの説明。 |
deposit | double | 前払金の金額。 |
depositPayment | string | コースの前払金のタイプ。使用可能な値:disabled(無効)、fixed(指定額)、percentage(パーセンテージ)。 |
fullPayment | boolean | 前払金が有効な場合、お客様が前払金ではなく全額を支払うオプションを持つかどうか。デフォルトはfalseです。 |
status | string | コースのステータス。使用可能な値:visible(表示)、hidden(非表示)、disabled(無効)。デフォルト値はvisibleです。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages/22' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "bookable": [ { "service": { "id": 1 }, "providers": [], "locations": [], "quantity": 1, "minimumScheduled": 0, "maximumScheduled": 1, "allowProviderSelection": true }, { "service": { "id": 4 }, "providers": [], "locations": [], "quantity": 1, "minimumScheduled": 0, "maximumScheduled": 1, "allowProviderSelection": false } ], "color": "#1788FB", "description": "Description of package", "name": "Amelia 4 Package", "pictureFullPath": "", "pictureThumbPath": "", "price": 55, "calculatedPrice": false, "discount": 0, "status": "visible", "gallery": [], "position": 9, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}", "endDate": null, "durationCount": null, "durationType": null, "deposit": 0, "depositPayment": "disabled", "translations": null, "sharedCapacity": false, "quantity": 1, "limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}", "descriptionHtml": "Description of package" }'
{
"message": "Successfully updated package.",
"data": {
"package": {
"id": 22,
"name": "Amelia 4 Package",
"description": "Description of package",
"color": "#1788FB",
"price": 55,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": 9,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}",
"fullPayment": false,
"type": "package",
"status": "visible",
"gallery": [],
"bookable": [
{
"id": null,
"quantity": 1,
"service": {
"id": 1,
"name": null,
"description": null,
"color": null,
"price": null,
"deposit": null,
"depositPayment": null,
"depositPerPerson": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": null,
"settings": null,
"fullPayment": null,
"minCapacity": null,
"maxCapacity": null,
"duration": null,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": null,
"show": null,
"aggregatedPrice": null,
"status": null,
"categoryId": null,
"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": null,
"quantity": 1,
"service": {
"id": 4,
"name": null,
"description": null,
"color": null,
"price": null,
"deposit": null,
"depositPayment": null,
"depositPerPerson": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": null,
"settings": null,
"fullPayment": null,
"minCapacity": null,
"maxCapacity": null,
"duration": null,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": null,
"show": null,
"aggregatedPrice": null,
"status": null,
"categoryId": null,
"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": false
}
],
"calculatedPrice": false,
"discount": 0,
"endDate": null,
"durationCount": null,
"durationType": null,
"translations": null,
"sharedCapacity": false,
"quantity": 1,
"limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}"
}
}
}
コース詳細を取得します。
メソッド
このエンドポイントはGETリクエストを受け付けます。
パス
/packages
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
"message": "Successfully retrieved packages.",
"data": {
"packages": [
{
"id": 22,
"name": "Amelia 4 Package",
"description": "Description of package",
"color": "#1788FB",
"price": 55,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": 9,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}",
"fullPayment": false,
"type": "package",
"status": "visible",
"gallery": [],
"bookable": [
{
"id": 35,
"quantity": 1,
"service": {
"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": 24,
"name": "Extra 34",
"description": "Description of extra",
"price": 20,
"maxQuantity": 1,
"position": 1,
"duration": null,
"serviceId": null,
"aggregatedPrice": false,
"translations": "{\"name\":{\"ar\":\"\",\"en_US\":\"\",\"fr_FR\":\"supplémentaire\"},\"description\":{\"ar\":\"\",\"en_US\":\"\",\"fr_FR\":\"description du supplément\",\"arHtml\":\"\",\"en_USHtml\":\"\",\"fr_FRHtml\":\"description du supplément\"}}"
},
...
],
"coupons": [],
"position": 1,
"settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"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": [],
"gallery": [],
"recurringCycle": "all",
"recurringSub": "future",
"recurringPayment": 0,
"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\"}"
},
"minimumScheduled": 0,
"maximumScheduled": 1,
"providers": [],
"locations": [],
"allowProviderSelection": true
},
{
"id": 36,
"quantity": 1,
"service": {
"id": 4,
"name": "Service 2",
"description": "",
"color": "#1788FB",
"price": 45,
"deposit": 20,
"depositPayment": "指定額",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": 16,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.2.3\"}}",
"fullPayment": false,
"minCapacity": 1,
"maxCapacity": 1,
"duration": 3600,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": true,
"show": true,
"aggregatedPrice": true,
"status": "visible",
"categoryId": 2,
"category": null,
"priority": [],
"gallery": [],
"recurringCycle": "disabled",
"recurringSub": "future",
"recurringPayment": 0,
"translations": null,
"minSelectedExtras": null,
"mandatoryExtra": false,
"customPricing": "{\"enabled\":false,\"durations\":{}}",
"maxExtraPeople": null,
"limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}"
},
"minimumScheduled": 0,
"maximumScheduled": 1,
"providers": [],
"locations": [],
"allowProviderSelection": false
}
],
"calculatedPrice": false,
"discount": 0,
"endDate": null,
"durationCount": null,
"durationType": null,
"translations": null,
"sharedCapacity": false,
"quantity": 1,
"limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}"
}
]
}
}
コースを安全に削除できるかどうか、その影響を確認します。
メソッド
このエンドポイントはGETリクエストを受け付けます。
パス
/packages/delete-effect/{{package_id}}
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages/delete-effect/22' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
"message": "Successfully retrieved package delete effect.",
"data": {
"customers": 0,
"appointments": 0,
"payments": 0
}
}
コースを削除します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/packages/delete/{{package_id}}
例:
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages/delete/22' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
"message": "Successfully deleted package.",
"data": []
}