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リクエストを受け付けます。

パス

/packages

必須プロパティ

以下のプロパティは必須です。

キータイプ説明
namestringコースの名前。
bookablearrayコースに含まれるサービスオブジェクトの配列。オブジェクトには、serviceproviderslocationsquantityminimumScheduledmaximumScheduledallowProviderSelectionのプロパティがあります。
pricedoubleコースの価格。

オプションのプロパティ

以下のプロパティはオプションです。

キータイプ説明
statusstringコースのステータス。使用可能な値:visible(表示)、hidden(非表示)、disabled(無効)。デフォルト値はvisibleです。
descriptionstringコースの説明。
colorstringコースの色。デフォルト値は#1788FBです。
calculatedPricebooleanコースの価格がサービス価格から計算されるかどうか。デフォルトはtrueです。
discountdoubleコースの割引率。
galleryarrayコースのギャラリー用の画像の配列。
pictureFullPathstringコースの画像のフルパス。
pictureThumbPathstringコースの画像のサムネイルパス。
positionintegerコースの位置(並べ替えに使用)。デフォルト値は1です。
settingsstringコース設定のJSON形式の文字列。デフォルトでは基本設定が使用されます。
endDatestringコース購入の有効期限の日時。形式:YYYY-MM-DD HH:mm
durationCountstringコース購入の有効期限の日数/週/月。
durationTypeintegerdurationCountのタイプ。使用可能な値:day(日)、week(週)、month(月)。
translationsstringコースの翻訳のJSON形式の文字列。
sharedCapacitybooleanコースがサービス間で共有定員を持つかどうか。デフォルト値はfalseです。
quantityintegersharedCapacitytrueの場合のサービスの数量。
limitPerCustomerintegerお客様あたりのコース購入制限のJSON形式の文字列。
descriptionHtmlstringHTML形式でのコースの説明。
depositdouble前払金の金額。
depositPaymentstringコース前払金のタイプ。使用可能な値:disabled(無効)、fixed指定額)、percentage(パーセンテージ)。
fullPaymentboolean前払金が有効な場合、お客様前払金ではなく全額を支払うオプションを持つかどうか。デフォルトは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}}

オプションのプロパティ

キータイプ説明
namestringコースの名前。
bookablearrayコースに含まれるサービスオブジェクトの配列。オブジェクトには、serviceproviderslocationsquantityminimumScheduledmaximumScheduledallowProviderSelectionのプロパティがあります。
pricedoubleコースの価格。
descriptionstringコースの説明。
colorstringコースの色。デフォルト値は#1788FBです。
calculatedPricebooleanコースの価格がサービス価格から計算されるかどうか。デフォルトはtrueです。
discountdoubleコースの割引率。
galleryarrayコースのギャラリー用の画像の配列。
pictureFullPathstringコースの画像のフルパス。
pictureThumbPathstringコースの画像のサムネイルパス。
positionintegerコースの位置(並べ替えに使用)。デフォルト値は1です。
settingsstringコース設定のJSON形式の文字列。デフォルトでは基本設定が使用されます。
endDatestringコース購入の有効期限の日時。形式:YYYY-MM-DD HH:mm
durationCountstringコース購入の有効期限の日数/週/月。
durationTypeintegerdurationCountのタイプ。使用可能な値:day(日)、week(週)、month(月)。
translationsstringコースの翻訳のJSON形式の文字列。
sharedCapacitybooleanコースがサービス間で共有定員を持つかどうか。デフォルト値はfalseです。
quantityintegersharedCapacitytrueの場合のサービスの数量。
limitPerCustomerintegerお客様あたりのコース購入制限のJSON形式の文字列。
descriptionHtmlstringHTML形式でのコースの説明。
depositdouble前払金の金額。
depositPaymentstringコース前払金のタイプ。使用可能な値:disabled(無効)、fixed指定額)、percentage(パーセンテージ)。
fullPaymentboolean前払金が有効な場合、お客様前払金ではなく全額を支払うオプションを持つかどうか。デフォルトはfalseです。
statusstringコースのステータス。使用可能な値: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": []
}