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

パス

/services

必須プロパティ

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

キータイプ説明
namestringサービスの名前。
categoryIdintegerサービスが属するカテゴリのID。
providersarrayこのサービスを担当するスタッフIDの配列。
durationintegerサービスの所要時間(秒単位)。
minCapacityintegerサービスの最小定員。
maxCapacityintegerサービスの最大定員。
pricefloatサービスの価格。

オプションのプロパティ

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

キータイプ説明
colorstringサービスの色(16進数値)。デフォルト:#1788FB
descriptionstringサービスの説明。
extrasarray追加オプション(エクストラ)の配列。
pictureFullPathstringサービスの画像のフルパス。
pictureThumbPathstringサービスの画像のサムネイルパス。
customPricingstringカスタム価格設定ルールを含むJSON形式の文字列。
timeBeforeintegerサービスの前のバッファ時間(秒単位)。
timeAfterintegerサービスの後のバッファ時間(秒単位)。
bringingAnyonebooleanお客様が誰かを同伴できるかどうか。デフォルトはfalseです。
showbooleanサービスがフォームに表示されるかどうか。デフォルトはfalseです。
galleryarrayサービスギャラリー用の画像パスの配列。
aggregatedPricebooleanサービスの価格が人数によって乗算されるかどうか。デフォルトはfalseです。
settingsstringサービス設定のJSON形式の文字列。デフォルトはNULLで、基本設定が使用されます。
recurringCyclestringサービスの繰り返しタイプ。使用可能な値:disabled(無効)、all(すべて)、daily(毎日)、weekly(毎週)、またはmonthly(毎月)。デフォルトはdisabledです。
recurringSubstring繰り返し予約の日付が利用できない場合に提案する時間枠。使用可能な値:disabled(無効)、past(過去)、future(未来)、またはboth(両方)。デフォルトはfutureです。
recurringPaymentintegerお客様が予約時に最初の予約に対して支払うか、すべての予約に対して支払うか。最初の予約のみは0、すべては999です。デフォルトは0です。
positionintegerサービスの位置(並べ替えに使用)。デフォルトは最初です。
depositfloat前払金の金額。デフォルトは0です。
depositPaymentstring前払金のタイプ。使用可能な値:disabled(無効)、fixed指定額)、percentage(パーセンテージ)。デフォルトはdisabledです。
depositPerPersonboolean前払金が人数によって乗算されるかどうか。デフォルトはfalseです。
fullPaymentboolean前払金が有効な場合、お客様が全額を支払うオプションを持つかどうか。デフォルトはfalseです。
translationsstringサービス名と説明の翻訳用のJSON形式の文字列。
minSelectedExtrasinteger選択する必要がある追加オプションの最小数。デフォルトはなしです。
mandatoryExtraboolean追加オプションの選択が必須かどうか。デフォルトはfalseです。
maxExtraPeopleintegerお客様が同伴できる追加の最大人数。
limitPerCustomerstringお客様ごとの予約を制限するルールの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}}

オプションのプロパティ

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

キータイプ説明
namestringサービスの名前。
categoryIdintegerサービスが属するカテゴリのID。
providersarrayこのサービスを担当するスタッフIDの配列。
durationintegerサービスの所要時間(秒単位)。
minCapacityintegerサービスの最小定員。
maxCapacityintegerサービスの最大定員。
pricefloatサービスの価格。
applyGloballybooleanスタッフの価格も更新する必要があるかどうか。デフォルトはfalseです。
colorstringサービスの色(16進数値)。デフォルト:#1788FB
descriptionstringサービスの説明。
extrasarray追加オプション(エクストラ)の配列。
pictureFullPathstringサービスの画像のフルパス。
pictureThumbPathstringサービスの画像のサムネイルパス。
customPricingstringカスタム価格設定ルールを含むJSON形式の文字列。
timeBeforeintegerサービスの前のバッファ時間(秒単位)。
timeAfterintegerサービスの後のバッファ時間(秒単位)。
bringingAnyonebooleanお客様が誰かを同伴できるかどうか。デフォルトはfalseです。
showbooleanサービスがフォームに表示されるかどうか。デフォルトはfalseです。
galleryarrayサービスギャラリー用の画像パスの配列。
aggregatedPricebooleanサービスの価格が人数によって乗算されるかどうか。デフォルトはfalseです。
settingsstringサービス設定のJSON形式の文字列。デフォルトはNULLで、基本設定が使用されます。
recurringCyclestringサービスの繰り返しタイプ。使用可能な値:disabled(無効)、all(すべて)、daily(毎日)、weekly(毎週)、またはmonthly(毎月)。デフォルトはdisabledです。
recurringSubstring繰り返し予約の日付が利用できない場合に提案する時間枠。使用可能な値:disabled(無効)、past(過去)、future(未来)、またはboth(両方)。デフォルトはfutureです。
recurringPaymentintegerお客様が予約時に最初の予約に対して支払うか、すべての予約に対して支払うか。最初の予約のみは0、すべては999です。デフォルトは0です。
positionintegerサービスの位置(並べ替えに使用)。デフォルトは最初です。
depositfloat前払金の金額。デフォルトは0です。
depositPaymentstring前払金のタイプ。使用可能な値:disabled(無効)、fixed指定額)、percentage(パーセンテージ)。デフォルトはdisabledです。
depositPerPersonboolean前払金が人数によって乗算されるかどうか。デフォルトはfalseです。
fullPaymentboolean前払金が有効な場合、お客様が全額を支払うオプションを持つかどうか。デフォルトはfalseです。
translationsstringサービス名と説明の翻訳用のJSON形式の文字列。
minSelectedExtrasinteger選択する必要がある追加オプションの最小数。デフォルトはなしです。
mandatoryExtraboolean追加オプションの選択が必須かどうか。デフォルトはfalseです。
maxExtraPeopleintegerお客様が同伴できる追加の最大人数。
limitPerCustomerstringお客様ごとの予約を制限するルールの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}}

必須プロパティ

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

キータイプ説明
statusstringサービスの新しいステータス。使用可能な値: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

必須プロパティ

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

キータイプ説明
positionsarrayサービス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": []
}