

操作ガイド
ここでは、サービスに関連する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リクエストを受け付けます。
パス
/services
必須プロパティ
以下のプロパティは必須です。
| キー | タイプ | 説明 |
name | string | サービスの名前。 |
categoryId | integer | サービスが属するカテゴリのID。 |
providers | array | このサービスを担当するスタッフIDの配列。 |
duration | integer | サービスの所要時間(秒単位)。 |
minCapacity | integer | サービスの最小定員。 |
maxCapacity | integer | サービスの最大定員。 |
price | float | サービスの価格。 |
オプションのプロパティ
以下のプロパティはオプションです。
| キー | タイプ | 説明 |
color | string | サービスの色(16進数値)。デフォルト:#1788FB |
description | string | サービスの説明。 |
extras | array | 追加オプション(エクストラ)の配列。 |
pictureFullPath | string | サービスの画像のフルパス。 |
pictureThumbPath | string | サービスの画像のサムネイルパス。 |
customPricing | string | カスタム価格設定ルールを含むJSON形式の文字列。 |
timeBefore | integer | サービスの前のバッファ時間(秒単位)。 |
timeAfter | integer | サービスの後のバッファ時間(秒単位)。 |
bringingAnyone | boolean | お客様が誰かを同伴できるかどうか。デフォルトはfalseです。 |
show | boolean | サービスがフォームに表示されるかどうか。デフォルトはfalseです。 |
gallery | array | サービスギャラリー用の画像パスの配列。 |
aggregatedPrice | boolean | サービスの価格が人数によって乗算されるかどうか。デフォルトはfalseです。 |
settings | string | サービス設定のJSON形式の文字列。デフォルトはNULLで、基本設定が使用されます。 |
recurringCycle | string | サービスの繰り返しタイプ。使用可能な値:disabled(無効)、all(すべて)、daily(毎日)、weekly(毎週)、またはmonthly(毎月)。デフォルトはdisabledです。 |
recurringSub | string | 繰り返し予約の日付が利用できない場合に提案する時間枠。使用可能な値:disabled(無効)、past(過去)、future(未来)、またはboth(両方)。デフォルトはfutureです。 |
recurringPayment | integer | お客様が予約時に最初の予約に対して支払うか、すべての予約に対して支払うか。最初の予約のみは0、すべては999です。デフォルトは0です。 |
position | integer | サービスの位置(並べ替えに使用)。デフォルトは最初です。 |
deposit | float | 前払金の金額。デフォルトは0です。 |
depositPayment | string | 前払金のタイプ。使用可能な値:disabled(無効)、fixed(指定額)、percentage(パーセンテージ)。デフォルトはdisabledです。 |
depositPerPerson | boolean | 前払金が人数によって乗算されるかどうか。デフォルトはfalseです。 |
fullPayment | boolean | 前払金が有効な場合、お客様が全額を支払うオプションを持つかどうか。デフォルトはfalseです。 |
translations | string | サービス名と説明の翻訳用のJSON形式の文字列。 |
minSelectedExtras | integer | 選択する必要がある追加オプションの最小数。デフォルトはなしです。 |
mandatoryExtra | boolean | 追加オプションの選択が必須かどうか。デフォルトはfalseです。 |
maxExtraPeople | integer | お客様が同伴できる追加の最大人数。 |
limitPerCustomer | string | お客様ごとの予約を制限するルールのJSON形式の文字列。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "categoryId": "4", "color": "#1788FB", "description": "", "duration": 1800, "providers": [ 3 ], "extras": [ { "description": "", "descriptionHTML": "", "duration": 1800, "maxQuantity": 1, "name": "extra1", "position": 1, "price": 100, "serviceId": 0, "translations": null } ], "maxCapacity": 1, "minCapacity": 1, "name": "Service 1", "pictureFullPath": "", "pictureThumbPath": "", "price": 0, "customPricing": "{\"enabled\": false, \"durations\": []}", "status": "visible", "timeAfter": "", "timeBefore": "", "bringingAnyone": true, "show": true, "gallery": [], "aggregatedPrice": true, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}", "recurringCycle": "disabled", "recurringSub": "future", "recurringPayment": 0, "position": 9, "deposit": 0, "depositPayment": "disabled", "depositPerPerson": 1, "fullPayment": false, "translations": null, "minSelectedExtras": null, "mandatoryExtra": false, "maxExtraPeople": null, "limitPerCustomer": "{\"enabled\": false, \"numberOfApp\": 1,\"timeFrame\": \"day\", \"period\": 1, \"from\": \"bookingDate\"}" }'
{
"message": "Successfully added new service.",
"data": {
"service": {
"id": 24,
"name": "Service 1",
"description": "",
"color": "#1788FB",
"price": 0,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [
{
"id": 18,
"name": "extra1",
"description": "",
"price": 100,
"maxQuantity": 1,
"position": 1,
"duration": 1800,
"serviceId": 24,
"aggregatedPrice": null,
"translations": null
}
],
"coupons": [],
"position": 1,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
"fullPayment": false,
"minCapacity": 1,
"maxCapacity": 1,
"duration": 1800,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": true,
"show": true,
"aggregatedPrice": true,
"status": "visible",
"categoryId": 4,
"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\"}"
}
}
}
サービス詳細を更新します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/services/{{service_id}}
オプションのプロパティ
更新したいプロパティのみを送信してください。
| キー | タイプ | 説明 |
name | string | サービスの名前。 |
categoryId | integer | サービスが属するカテゴリのID。 |
providers | array | このサービスを担当するスタッフIDの配列。 |
duration | integer | サービスの所要時間(秒単位)。 |
minCapacity | integer | サービスの最小定員。 |
maxCapacity | integer | サービスの最大定員。 |
price | float | サービスの価格。 |
applyGlobally | boolean | スタッフの価格も更新する必要があるかどうか。デフォルトはfalseです。 |
color | string | サービスの色(16進数値)。デフォルト:#1788FB |
description | string | サービスの説明。 |
extras | array | 追加オプション(エクストラ)の配列。 |
pictureFullPath | string | サービスの画像のフルパス。 |
pictureThumbPath | string | サービスの画像のサムネイルパス。 |
customPricing | string | カスタム価格設定ルールを含むJSON形式の文字列。 |
timeBefore | integer | サービスの前のバッファ時間(秒単位)。 |
timeAfter | integer | サービスの後のバッファ時間(秒単位)。 |
bringingAnyone | boolean | お客様が誰かを同伴できるかどうか。デフォルトはfalseです。 |
show | boolean | サービスがフォームに表示されるかどうか。デフォルトはfalseです。 |
gallery | array | サービスギャラリー用の画像パスの配列。 |
aggregatedPrice | boolean | サービスの価格が人数によって乗算されるかどうか。デフォルトはfalseです。 |
settings | string | サービス設定のJSON形式の文字列。デフォルトはNULLで、基本設定が使用されます。 |
recurringCycle | string | サービスの繰り返しタイプ。使用可能な値:disabled(無効)、all(すべて)、daily(毎日)、weekly(毎週)、またはmonthly(毎月)。デフォルトはdisabledです。 |
recurringSub | string | 繰り返し予約の日付が利用できない場合に提案する時間枠。使用可能な値:disabled(無効)、past(過去)、future(未来)、またはboth(両方)。デフォルトはfutureです。 |
recurringPayment | integer | お客様が予約時に最初の予約に対して支払うか、すべての予約に対して支払うか。最初の予約のみは0、すべては999です。デフォルトは0です。 |
position | integer | サービスの位置(並べ替えに使用)。デフォルトは最初です。 |
deposit | float | 前払金の金額。デフォルトは0です。 |
depositPayment | string | 前払金のタイプ。使用可能な値:disabled(無効)、fixed(指定額)、percentage(パーセンテージ)。デフォルトはdisabledです。 |
depositPerPerson | boolean | 前払金が人数によって乗算されるかどうか。デフォルトはfalseです。 |
fullPayment | boolean | 前払金が有効な場合、お客様が全額を支払うオプションを持つかどうか。デフォルトはfalseです。 |
translations | string | サービス名と説明の翻訳用のJSON形式の文字列。 |
minSelectedExtras | integer | 選択する必要がある追加オプションの最小数。デフォルトはなしです。 |
mandatoryExtra | boolean | 追加オプションの選択が必須かどうか。デフォルトはfalseです。 |
maxExtraPeople | integer | お客様が同伴できる追加の最大人数。 |
limitPerCustomer | string | お客様ごとの予約を制限するルールのJSON形式の文字列。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "id": 12, "categoryId": "4", "color": "#1788FB", "description": "", "duration": 1800, "providers": [ 3 ], "extras": [ { "description": "", "descriptionHTML": "", "duration": 1800, "maxQuantity": 1, "name": "extra1", "position": 1, "price": 100, "serviceId": 0, "translations": null } ], "maxCapacity": 1, "minCapacity": 1, "name": "Service New Name", "pictureFullPath": "", "pictureThumbPath": "", "price": 0, "customPricing": "{\"enabled\": false, \"durations\": []}", "status": "visible", "timeAfter": "", "timeBefore": "", "bringingAnyone": true, "show": true, "applyGlobally": false, "gallery": [], "aggregatedPrice": true, "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}", "recurringCycle": "disabled", "recurringSub": "future", "recurringPayment": 0, "position": 9, "deposit": 0, "depositPayment": "disabled", "depositPerPerson": 1, "fullPayment": false, "translations": null, "minSelectedExtras": null, "mandatoryExtra": false, "maxExtraPeople": null, "limitPerCustomer": "{\"enabled\": false, \"numberOfApp\": 1,\"timeFrame\": \"day\", \"period\": 1, \"from\": \"bookingDate\"}" }'
{
"message": "Successfully updated service.",
"data": {
"service": {
"id": 12,
"name": "Service New Name",
"description": "",
"color": "#1788FB",
"price": 0,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [
{
"id": 18,
"name": "extra1",
"description": "",
"price": 100,
"maxQuantity": 1,
"position": 1,
"duration": 1800,
"serviceId": 12,
"aggregatedPrice": null,
"translations": null
}
],
"coupons": [],
"position": 9,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
"fullPayment": false,
"minCapacity": 1,
"maxCapacity": 1,
"duration": 1800,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": true,
"show": true,
"aggregatedPrice": true,
"status": "visible",
"categoryId": 4,
"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\"}"
}
}
}
サービスステータスを更新します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/services/status/{{service_id}}
必須プロパティ
以下のプロパティは必須です。
| キー | タイプ | 説明 |
status | string | サービスの新しいステータス。使用可能な値:visible(表示)、hidden(非表示)、trash(ゴミ箱) |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/status/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "status": "hidden" }'
{
"message": "Successfully changed service status.",
"data": {
"service": {
"id": 12,
"name": "Service New Name",
"description": "",
"color": "#1788FB",
"price": 0,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [
{
"id": 18,
"name": "extra1",
"description": "",
"price": 100,
"maxQuantity": 1,
"position": 1,
"duration": 1800,
"serviceId": 12,
"aggregatedPrice": null,
"translations": null
}
],
"coupons": [],
"position": 9,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
"fullPayment": false,
"minCapacity": 1,
"maxCapacity": 1,
"duration": 1800,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": true,
"show": true,
"aggregatedPrice": true,
"status": "hidden",
"categoryId": 4,
"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\"}"
}
}
}
サービスの位置(並べ替え順)を更新します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/services/positions
必須プロパティ
以下のプロパティは必須です。
| キー | タイプ | 説明 |
positions | array | サービスIDと位置を含む配列。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/positions' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "positions": [ { "id": 12, "position": 2 } ] }'
{
"message": "Successfully updated services positions.",
"data": null
}
サービス詳細を取得します。
メソッド
このエンドポイントはGETリクエストを受け付けます。
パス
/services/{{service_id}}
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/12' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
"message": "Successfully retrieved service.",
"data": {
"service": {
"id": 12,
"name": "Service New Name",
"description": "",
"color": "#1788FB",
"price": 0,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [
{
"id": 18,
"name": "extra1",
"description": "",
"price": 100,
"maxQuantity": 1,
"position": 1,
"duration": 1800,
"serviceId": 12,
"aggregatedPrice": null,
"translations": null
}
],
"coupons": [],
"position": 9,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
"fullPayment": false,
"minCapacity": 1,
"maxCapacity": 1,
"duration": 1800,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": true,
"show": true,
"aggregatedPrice": true,
"status": "visible",
"categoryId": 4,
"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\"}"
}
}
}
サービスを削除した場合に影響を受ける項目を取得します。
メソッド
このエンドポイントはGETリクエストを受け付けます。
パス
/services/delete-effect/{{service_id}}
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/delete-effect/12' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
"message": "Successfully retrieved service delete effect.",
"data": {
"appointments": 0,
"packages": [
{
"id": 1,
"name": "milicas package"
}
],
"extras": [
{
"id": 18,
"name": "extra1"
}
],
"events": []
}
}
サービス詳細を取得します。
メソッド
このエンドポイントはGETリクエストを受け付けます。
パス
/services
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
"message": "Successfully retrieved services.",
"data": {
"services": [
{
"id": 12,
"name": "Service New Name",
"description": "",
"color": "#1788FB",
"price": 0,
"deposit": 0,
"depositPayment": "disabled",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [
{
"id": 18,
"name": "extra1",
"description": "",
"price": 100,
"maxQuantity": 1,
"position": 1,
"duration": 1800,
"serviceId": 12,
"aggregatedPrice": null,
"translations": null
}
],
"coupons": [],
"position": 9,
"settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
"fullPayment": false,
"minCapacity": 1,
"maxCapacity": 1,
"duration": 1800,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": true,
"show": true,
"aggregatedPrice": true,
"status": "visible",
"categoryId": 4,
"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\"}"
}
]
}
}
サービスを削除します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/services/delete/{{service_id}}
例:
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/delete/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
"message": "Successfully deleted service.",
"data": []
}