MENU

料金プラン

機能一覧

デモ

ご利用の流れ

お役立ちコラム



予約(Bookings)

操作ガイド

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

パス

/bookings

予約の作成

必須プロパティ

キータイプ説明
typestring予約のタイプ。使用可能な値:appointment (予約)、event (イベント)、またはpackage (コース)。
bookingsarray1つの要素を持つ配列。お客様とカスタム項目情報を含む予約オブジェクトです。
bookingStartstring予約の開始日時をYYYY-MM-DD HH:mmの形式で指定します。
paymentobjectgatewaycurrency、およびdataフィールドを持つ支払いオブジェクトです。
notifyParticipantsbooleanお客様に予約についてメールで通知するかどうか。
locationIdinteger予約の場所ID
providerIdintegerスタッフのID
serviceIdintegerサービスのID

その他のプロパティ

キータイプ説明
localestringお客様のロケール。例:en_US
timeZonestringお客様のタイムゾーン。例:Europe/Belgrade
recurringarray最初の1つを除く、すべての繰り返し予約の配列です。
couponCodestringクーポンコード。
runInstantPostBookingActionsbooleanこのAPI呼び出しで予約後のアクション(メールの送信、Googleカレンダーイベントの追加、Zoomミーティングの作成など)を実行するかどうか。デフォルトはfalseです。その場合は、代わりに/bookings/success/{booking_id}エンドポイントを呼び出します。

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data-raw '{
"type": "appointment",
"bookings": [
{
"extras": [],
"customFields": {
"1": {
"label": "text",
"type": "text",
"value": "custom field value"
}
},
"deposit": true,
"locale": "en_US",
"utcOffset": null,
"persons": 1,
"customerId": null,
"customer": {
"id": null,
"firstName": "Rob",
"lastName": "Stark",
"email": "robstark@test.test",
"phone": "",
"countryPhoneIso": "",
"externalId": null
},
"duration": 1800
}
],
"payment": {
"gateway": "onSite",
"currency": "USD",
"data": {}
},
"bookingStart": "2023-10-05 13:00",
"notifyParticipants": 1,
"locationId": 2,
"providerId": 1,
"serviceId": 1
}'
レスポンス
{
"message": "Successfully added booking",
"data": {
"type": "appointment",
"appointment": {
"id": 742,
"bookings": [
{
"id": 980,
"customerId": 64,
"customer": {
"id": 64,
"firstName": "Rob",
"lastName": "Stark",
"birthday": null,
"email": "robstark@test.test",
"phone": null,
"type": "お客様",
"status": null,
"note": null,
"zoomUserId": null,
"countryPhoneIso": null,
"externalId": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": "{\"defaultLanguage\":\"en_US\"}",
"gender": null
},
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 742,
"persons": 1,
"token": "08a4df18c0",
"payments": [
{
"id": 1001,
"customerBookingId": 980,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": null,
"actionsCompleted": false,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "approved",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": {
"id": 2,
"status": "visible",
"name": "Location2",
"description": "",
"address": "Velisava Vulovića 18, Belgrade, Serbia",
"phone": "",
"latitude": 44.767476,
"longitude": 20.455081,
"pictureFullPath": null,
"pictureThumbPath": null,
"pin": "",
"translations": null
},
"googleCalendarEventId": "hlda2snvbh7llqbupsgnels3io",
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"booking": {
"id": 980,
"customerId": 64,
"customer": {
"id": 64,
"firstName": "Rob",
"lastName": "Stark",
"birthday": null,
"email": "robstark@test.test",
"phone": null,
"type": "お客様",
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 742,
"persons": 1,
"token": "08a4df18c0",
"payments": [
{
"id": 1001,
"customerBookingId": 980,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": null,
"actionsCompleted": false,
"isUpdated": null
},
"utcTime": [
{
"start": "2023-10-05 09:00:00",
"end": "2023-10-05 09:30:00"
}
],
"appointmentStatusChanged": true,
"recurring": [],
"package": [],
"packageId": null,
"customer": {
"id": 64,
"firstName": "Rob",
"lastName": "Stark",
"birthday": null,
"email": "robstark@test.test",
"phone": null,
"type": "お客様",
"status": null,
"note": null,
"zoomUserId": null,
"countryPhoneIso": null,
"externalId": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": "{\"defaultLanguage\":\"en_US\"}",
"gender": null,
"locale": "en_US",
"timeZone": "Europe/Belgrade"
},
"bookable": {
"id": 1,
"name": "amelia service",
"description": "location address: %location_address%",
"color": "#1788FB",
"price": 23,
"deposit": 14,
"depositPayment": "fixed",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [
{
"id": 17,
"name": "extra",
"description": null,
"price": 0,
"maxQuantity": 1,
"position": 1,
"duration": 600,
"serviceId": null,
"aggregatedPrice": false,
"translations": null
}
],
"coupons": [],
"position": null,
"settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.6\"}}",
"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": null,
"recurringSub": null,
"recurringPayment": 999,
"translations": null,
"minSelectedExtras": null,
"mandatoryExtra": null,
"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\"}"
},
"paymentId": 1001,
"packageCustomerId": null,
"payment": {
"id": 1001,
"customerBookingId": 980,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
},
"customerCabinetUrl": "http://localhost/amelia/index.php/お客様マイページ"
}
}

イベントの予約

必須プロパティ

キータイプ説明
typestring予約のタイプ。使用可能な値:appointment (予約)、event (イベント)、またはpackage (コース)。
bookingsarray1つの要素を持つ配列。お客様とカスタム項目情報を含む予約オブジェクトです。
paymentobjectgatewaycurrency、およびdataフィールドを持つ支払いオブジェクトです。
eventIdintegerイベントID

その他のプロパティ

キータイプ説明
localestringお客様のロケール。例:en_US
timeZonestringお客様のタイムゾーン。例:Europe/Belgrade
couponCodestringクーポンコード。
runInstantPostBookingActionsbooleanこのAPI呼び出しで予約後のアクション(メールの送信、Googleカレンダーイベントの追加、Zoomミーティングの作成など)を実行するかどうか。デフォルトはfalseです。その場合は、代わりに/bookings/success/{booking_id}エンドポイントを呼び出します。

リクエスト
curl --location 'http://localhost/amelia2/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings' \
--data-raw '{
"type": "event",
"bookings": [
{
"customer": {
"email": "amelia@test.test",
"externalId": null,
"firstName": "Amelia",
"lastName": "Test",
"phone": "",
"countryPhoneIso": "rs"
},
"customFields": {
"1": {
"label": "text",
"value": "",
"type": "text"
}
},
"customerId": 0,
"persons": 1, // イベントがチケットを使用しない場合はpersonsを使用
"ticketsData": [ // イベントがチケットを使用する場合はticketsDataを使用
{
"eventTicketId": 25,
"persons": 0,
"price": 20
},
{
"eventTicketId": 24,
"persons": 2,
"price": 10
}
],
"utcOffset": null,
"deposit": false
}
],
"payment": {
"amount": "40.00",
"gateway": "onSite",
"currency": "USD"
},
"recaptcha": false,
"locale": "en_US",
"timeZone": "Europe/Belgrade",
"couponCode": "",
"eventId": 54
}'
レスポンス
{
"message": "Successfully added booking",
"data": {
"type": "event",
"event": {
"id": 54,
"name": "tickets event",
"description": "",
"color": "#1788FB",
"price": 0,
"deposit": 0,
"depositPayment": "disabled",
"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": []
},
"booking": {
"id": 786,
"customerId": 2,
"customer": {
"id": 2,
"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": "{\"defaultLanguage\":\"en_US\"}",
"gender": null
},
"status": "approved",
"extras": [],
"couponId": null,
"price": 40,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"\"}}",
"info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": null,
"persons": 1,
"token": "4690382d55",
"payments": [
{
"id": 1024,
"customerBookingId": 786,
"packageCustomerId": null,
"parentId": null,
"amount": 40,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2024-06-03 14:04:19",
"status": "pending",
"data": "",
"entity": "event",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [
{
"id": 150,
"customerBookingId": 786,
"eventTicketId": 25,
"price": 20,
"persons": 0,
"eventTicket": {
"id": 25,
"name": "ticket 2",
"price": 20,
"spots": 100,
"date": "2024-06-11 10:00:00",
"eventId": 54,
"translations": null
}
},
{
"id": 151,
"customerBookingId": 786,
"eventTicketId": 24,
"price": 10,
"persons": 2,
"eventTicket": {
"id": 24,
"name": "ticket 1",
"price": 10,
"spots": 100,
"date": "2024-06-11 10:00:00",
"eventId": 54,
"translations": null
}
}
],
"duration": null,
"created": "2024-06-03 12:04:19",
"actionsCompleted": false,
"isUpdated": null
},
"customer": {
"id": 2,
"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": "{\"defaultLanguage\":\"en_US\"}",
"gender": null,
"locale": "en_US",
"timeZone": "Europe/Belgrade"
},
"utcTime": [
{
"start": "2024-06-11 08:00:00",
"end": "2024-06-11 09:00:00"
}
],
"appointmentStatusChanged": true,
"recurring": [],
"package": [],
"packageId": null,
"paymentId": 1024,
"payment": {
"id": 1024,
"customerBookingId": 786,
"packageCustomerId": null,
"parentId": null,
"amount": 40,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2024-06-03 14:04:19",
"status": "pending",
"data": "",
"entity": "event",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
},
"customerCabinetUrl": "http://localhost/amelia2/index.php/お客様マイページ"
}
}

コースの予約

必須プロパティ

キータイプ説明
bookingsarrayお客様とカスタム項目情報を含む、予約オブジェクトの配列です。
paymentobjectgatewaycurrency、およびdataフィールドを持つ支払いオブジェクトです。
packageIdintegerコースID
customerobjectfirstNamelastNameemail、およびphoneフィールドを持つお客様オブジェクトです。
typestring予約のタイプ。使用可能な値:appointment (予約)、event (イベント)、またはpackage (コース)。

その他のプロパティ

キータイプ説明
localestringお客様のロケール。例:en_US
timeZonestringお客様のタイムゾーン。例:Europe/Belgrade
couponCodestringクーポンコード。
packageRulesarrayコース内の予約のルール。
runInstantPostBookingActionsbooleanこのAPI呼び出しで予約後のアクション(メールの送信、Googleカレンダーイベントの追加、Zoomミーティングの作成など)を実行するかどうか。デフォルトはfalseです。その場合は、代わりに/bookings/success/{booking_id}エンドポイントを呼び出します。

リクエスト
curl --location 'http://localhost/amelia2/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data-raw '{
"customer": {
"firstName": "Amelia",
"lastName": "Test",
"email": "amelia@test.test",
"phone": "",
"countryPhoneIso": "rs"
},
"type": "package",
"bookings": [
{
"bookingStart": "2024-06-05 11:30",
"serviceId": 1,
"providerId": 4,
"locationId": 8,
"utcOffset": 120,
"notifyParticipants": 1
},
{
"bookingStart": "2024-06-04 12:00",
"serviceId": 11,
"providerId": 3,
"locationId": 1,
"utcOffset": 120,
"notifyParticipants": 1
}
],
"payment": {
"gateway": "payPal",
"currency": "USD",
"amount": "40.00"
},
"packageId": 1,
"packageRules": [
{
"serviceId": 1,
"providerId": 4,
"locationId": 8
},
{
"serviceId": 11,
"providerId": 3,
"locationId": 1
}
],
"utcOffset": 120,
"couponCode": null
}'
レスポンス
{
"message": "Successfully added booking",
"data": {
"type": "package",
"package": [
{
"type": "appointment",
"appointment": {
"id": 580,
"bookings": [
{
"id": 766,
"customerId": 2,
"customer": {
"id": 2,
"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": "{\"defaultLanguage\":\"en_US\"}",
"gender": null
},
"status": "approved",
"extras": [],
"couponId": null,
"price": 20,
"coupon": null,
"customFields": "{\"2\":{\"label\":\"Text\",\"type\":\"text\",\"value\":\"\"}}",
"info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 580,
"persons": 1,
"token": "48dd3639c1",
"payments": [],
"utcOffset": 120,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": {
"id": 129,
"serviceId": 1,
"providerId": null,
"locationId": null,
"bookingsCount": 1,
"packageCustomer": {
"id": 104,
"packageId": 1,
"customerId": 2,
"price": 40,
"payments": [],
"start": "2024-05-27 10:35:52",
"end": "2024-06-17 12:35:52",
"purchased": "2024-05-27 10:35:52",
"status": null,
"bookingsCount": 0,
"couponId": null,
"coupon": null
}
},
"ticketsData": [],
"duration": null,
"created": "2024-05-27 12:35:52",
"actionsCompleted": false,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": null,
"status": "approved",
"serviceId": 1,
"parentId": null,
"providerId": 4,
"locationId": 8,
"provider": null,
"service": null,
"location": {
"id": 8,
"status": "visible",
"name": "lokacija5",
"description": "",
"address": "Velisava Vulovića, Belgrade, Serbia",
"phone": "",
"latitude": 44.764132,
"longitude": 20.455622,
"pictureFullPath": null,
"pictureThumbPath": null,
"pin": "",
"translations": null
},
"googleCalendarEventId": null,
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2024-06-05 09:30:00",
"bookingEnd": "2024-06-05 10:00:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"booking": {
"id": 766,
"customerId": 2,
"customer": {
"id": 2,
"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": "{\"defaultLanguage\":\"en_US\"}",
"gender": null
},
"status": "approved",
"extras": [],
"couponId": null,
"price": 20,
"coupon": null,
"customFields": "{\"2\":{\"label\":\"Text\",\"type\":\"text\",\"value\":\"\"}}",
"info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 580,
"persons": 1,
"token": "48dd3639c1",
"payments": [],
"utcOffset": 120,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": {
"id": 129,
"serviceId": 1,
"providerId": null,
"locationId": null,
"bookingsCount": 1,
"packageCustomer": {
"id": 104,
"packageId": 1,
"customerId": 2,
"price": 40,
"payments": [],
"start": "2024-05-27 10:35:52",
"end": "2024-06-17 12:35:52",
"purchased": "2024-05-27 10:35:52",
"status": null,
"bookingsCount": 0,
"couponId": null,
"coupon": null
}
},
"ticketsData": [],
"duration": null,
"created": "2024-05-27 12:35:52",
"actionsCompleted": false,
"isUpdated": null
},
"utcTime": [
{
"start": "2024-06-05 07:30:00",
"end": "2024-06-05 08:00:00"
}
],
"appointmentStatusChanged": true,
"recurring": [],
"package": [],
"packageId": null,
"customer": {
"id": 2,
"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": "{\"defaultLanguage\":\"en_US\"}",
"gender": null,
"locale": "en_US",
"timeZone": "Europe/Belgrade"
},
"bookable": {
"id": 1,
"name": "amelia service",
"description": "location address: %location_address%",
"color": "#1788FB",
"price": 23,
"deposit": 14,
"depositPayment": "fixed",
"depositPerPerson": true,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [
{
"id": 17,
"name": "extra",
"description": null,
"price": 0,
"maxQuantity": 1,
"position": 1,
"duration": 600,
"serviceId": null,
"aggregatedPrice": false,
"translations": null
}
],
"coupons": [],
"position": null,
"settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.6\"}}",
"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": null,
"recurringSub": null,
"recurringPayment": 999,
"translations": null,
"minSelectedExtras": null,
"mandatoryExtra": null,
"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\"}"
},
"paymentId": 1001,
"packageCustomerId": null,
"payment": {
"id": 1001,
"customerBookingId": 980,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
},
"customerCabinetUrl": "http://localhost/amelia/index.php/お客様マイページ"
}
]
}
}

予約後のアクション

予約後のアクション(メールの送信、Googleカレンダーイベントの作成、Zoomミーティングの作成など)を実行します。これらは、予約の追加時にrunInstantPostBookingActionsfalseに設定されていた場合に呼び出す必要があります。

メソッド

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

パス

/bookings/success/{booking_id}

リクエスト
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings/success/974' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
"message": "Successfully run post booking actions for booking",
"data": {
"actionsCompleted": true,
"status": "approved",
"type": "appointment"
}
}

日時の変更

予約の日時を変更します。

メソッド

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

パス

/bookings/reschedule/{booking_id}

必須プロパティ

キータイプ説明
bookingStartstring予約の新しい開始日時をYYYY-MM-DD HH:mmの形式で指定します。

その他のプロパティ

キータイプ説明
serviceIdinteger予約の新しいサービスID
providerIdinteger予約の新しいスタッフID
locationIdinteger予約の新しい場所ID
notifyParticipantsbooleanお客様に予約についてメールで通知するかどうか。デフォルトはtrueです。

リクエスト
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings/reschedule/974' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data-raw '{
"bookingStart": "2023-10-05 13:00",
"notifyParticipants": 1
}'
レスポンス
{
"message": "Successfully rescheduled booking",
"data": {
"type": "appointment",
"appointment": {
"id": 738,
"bookings": [
{
"id": 974,
"customerId": 64,
"customer": {
"id": 64,
"firstName": "Rob",
"lastName": "Stark",
"birthday": null,
"email": "robstark@test.test",
"phone": null,
"type": "お客様",
"status": null,
"note": null,
"zoomUserId": null,
"countryPhoneIso": null,
"externalId": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": "{\"defaultLanguage\":\"en_US\"}",
"gender": null
},
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 738,
"persons": 1,
"token": null,
"payments": [
{
"id": 995,
"customerBookingId": 974,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-25 14:06:14",
"actionsCompleted": null,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "approved",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": {
"id": 2,
"status": "visible",
"name": "Location2",
"description": "",
"address": "Velisava Vulovića 18, Belgrade, Serbia",
"phone": "",
"latitude": 44.767476,
"longitude": 20.455081,
"pictureFullPath": null,
"pictureThumbPath": null,
"pin": "",
"translations": null
},
"googleCalendarEventId": null,
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": 1,
"isFull": null,
"resources": []
},
"booking": {
"id": 974,
"customerId": 64,
"customer": {
"id": 64,
"firstName": "Rob",
"lastName": "Stark",
"birthday": null,
"email": "robstark@test.test",
"phone": null,
"type": "お客様",
"status": null,
"note": null,
"zoomUserId": null,
"countryPhoneIso": null,
"externalId": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": "{\"defaultLanguage\":\"en_US\"}",
"gender": null
},
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 738,
"persons": 1,
"token": null,
"payments": [
{
"id": 995,
"customerBookingId": 974,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-25 14:06:14",
"actionsCompleted": null,
"isUpdated": null
},
"utcTime": [
{
"start": "2023-10-05 09:00:00",
"end": "2023-10-05 09:30:00"
}
],
"appointmentStatusChanged": true,
"recurring": [],
"package": [],
"packageId": null,
"paymentId": 995,
"customerCabinetUrl": "http://localhost/amelia/index.php/お客様マイページ"
}
}

キャンセル

予約をキャンセルします。

メソッド

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

パス

/bookings/cancel/{{booking_id}}

その他のプロパティ

キータイプ説明
notifyParticipantsbooleanお客様に予約についてメールで通知するかどうか。デフォルトはtrueです。

リクエスト
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings/cancel/974' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data-raw '{
"notifyParticipants": 1
}'
レスポンス
{
"message": "Successfully cancelled booking",
"data": {
"type": "appointment",
"appointment": {
"id": 738,
"bookings": [
{
"id": 974,
"customerId": 64,
"customer": null,
"status": "canceled",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 738,
"persons": 1,
"token": null,
"payments": [
{
"id": 995,
"customerBookingId": 974,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": true,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-25 14:06:14",
"actionsCompleted": null,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "rejected",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": null,
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"appointmentStatusChanged": true,
"booking": {
"id": 974,
"customerId": 64,
"customer": null,
"status": "canceled",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 738,
"persons": 1,
"token": null,
"payments": [
{
"id": 995,
"customerBookingId": 974,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-25 14:06:14",
"actionsCompleted": null,
"isUpdated": null
},
"type": "appointment",
"status": "canceled",
"message": "Appointment status has been changed to canceled"
}
}

削除

予約を削除します。

メソッド

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

パス

/bookings/delete/{{booking_id}}

リクエスト
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings/delete/974' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
"message": "Successfully deleted booking",
"data": {
"appointment": {
"id": 738,
"bookings": [
{
"id": 974,
"customerId": 64,
"customer": null,
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 738,
"persons": 1,
"token": null,
"payments": [
{
"id": 995,
"customerBookingId": 974,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": true,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-25 14:06:14",
"actionsCompleted": null,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "rejected",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": null,
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"bookingsWithChangedStatus": [
{
"id": 974,
"customerId": 64,
"customer": null,
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"type\":\"text\",\"value\":\"custom field value\"}}",
"info": "{\"firstName\":\"Rob\",\"lastName\":\"Stark\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
"appointmentId": 738,
"persons": 1,
"token": null,
"payments": [
{
"id": 995,
"customerBookingId": 974,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 11:00:00",
"status": "pending",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-25 14:06:14",
"actionsCompleted": null,
"isUpdated": null
}
],
"bookingDeleted": true,
"appointmentDeleted": true
}
}