Don’t miss our Special Offer!

Up to 50% off
Grab Amelia
Grab Amelia

Amelia API – Bookings

Here you can see API endpoints related to bookings.

You can see all the API endpoints with examples of requests and responses in the Amelia API Postman collection which you can download here.

Please note: The API Endpoints are included only in the Elite license plans. Using API Endpoints requires a certain level of coding skills, and is not included in the provided support for the plugin.

Authorization

All Amelia endpoints use an API key authorization, using the header property named “Amelia”.

Path

Amelia API paths start with: {{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1

Add booking

Create an appointment, event or package booking.

Method

This endpoint accepts POST requests.

Path

/bookings

Required Properties

The following properties are required.

Key Type Description
type string Type of appointment. Possible values: appointment, event or package.
bookings array Array of with one element, the booking object which contains customer and custom fields information.
bookingStart string The starting date and time of the appointment in the format: “YYYY-MM-DD HH:mm”
payment object Payment object with the following fields: gateway, currency and data.
notifyParticipants boolean Whether the customers should be notified about the appointment.
locationId integer Location ID of the appointment
providerId integer Employee ID of the appointment
serviceId integer Service ID of the appointment

Other Properties

Key Type Description
locale string Locale of the customer. Example: “en_US”
timeZone string Timezone of the customer. Example: “Europe/Belgrade“
recurring array Array of all the recurring appointments, without the first one.
package array Array of all the booked package appointments.
couponCode string Coupon code.
runInstantPostBookingActions boolean Whether to run post booking actions (sending emails, adding google calendar events, creating a zoom meeting etc) in this API call; false by default, call /bookings/success/{booking_id} endpoint in that case

Example

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": "[email protected]",
			"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": "[email protected]",
                        "phone": null,
                        "type": "customer",
                        "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": "[email protected]",
                "phone": null,
                "type": "customer",
                "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
        },
        "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": "[email protected]",
            "phone": null,
            "type": "customer",
            "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/customer-panel"
    }
}

Post-booking actions

Run post-booking actions (sending notifications, creating google/outlook calendar events, creating a zoom meeting, calling webhooks)

Method

This endpoint accepts POST requests.

Path

/bookings/success/{{booking_id}}

Required Properties

The following properties are required.

Key Type Description
type string Type of appointment. Possible values: appointment, event or package.
appointmentStatusChanged boolean Whether the appointment status has changed after adding the booking.
customerId integer Customer id.
paymentId integer Payment id.
packageCustomerId integer Package booking id. Required if customer booked a package.
packageId integer Package id. Required if customer booked a package.
recurring array Array of recurring appointments. Required if customer made recurring appointments.

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings/success/900' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
	"type": "appointment",
	"appointmentStatusChanged": false,
	"recurring": [],
	"packageId": null,
	"customerId": 11,
	"paymentId": 916,
	"packageCustomerId": null
}'
{
    "message": "Successfully get booking",
    "data": []
}

Reschedule booking

Reschedule an appointment date and time.

Method

This endpoint accepts POST requests.

Path

/bookings/reassign/{{booking_id}}

Required Properties

The following properties are required.

Key Type Description
bookingStart string New booking start date and time. String in date time format: “YYYY-MM-DD HH:mm”

Other Properties

Key Type Description
utcOffset integer UTC offset in minutes.
timeZone string Time zone. Example: “Europe/Belgrade“

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings/reassign/975' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "bookingStart": "2023-09-05 09:30", 
    "utcOffset": null,
    "timeZone": "Europe/Belgrade"
}'
{
  "message": "Successfully updated appointment",
  "data": {
    "booking": {
      "id": 975,
      "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\":null,\"timeZone\":null,\"urlParams\":null}",
      "appointmentId": 737,
      "persons": 1,
      "token": null,
      "payments": [
        {
          "id": 996,
          "customerBookingId": 975,
          "packageCustomerId": null,
          "parentId": null,
          "amount": 0,
          "gateway": "onSite",
          "gatewayTitle": "",
          "dateTime": "2023-10-05 13: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:09:47",
      "actionsCompleted": null,
      "isUpdated": null
    },
    "newAppointment": null,
    "oldAppointment": {
      "id": 739,
      "bookings": [],
      "notifyParticipants": 1,
      "internalNotes": "",
      "status": "canceled",
      "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 13:00:00",
      "bookingEnd": "2023-10-05 13:30:00",
      "type": "appointment",
      "isRescheduled": null,
      "isFull": null,
      "resources": []
    },
    "oldAppointmentStatusChanged": true,
    "existingAppointment": {
      "id": 737,
      "bookings": [
        {
          "id": 973,
          "customerId": 64,
          "customer": {
            "id": 64,
            "firstName": "Rob",
            "lastName": "Stark",
            "birthday": null,
            "email": "[email protected]",
            "phone": null,
            "type": "customer",
            "status": "visible",
            "note": null,
            "zoomUserId": null,
            "countryPhoneIso": null,
            "externalId": null,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "translations": null,
            "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": 737,
          "persons": 1,
          "token": null,
          "payments": [
            {
              "id": 994,
              "customerBookingId": 973,
              "packageCustomerId": null,
              "parentId": null,
              "amount": 0,
              "gateway": "onSite",
              "gatewayTitle": "",
              "dateTime": "2023-10-05 09:30:00",
              "status": "pending",
              "data": "",
              "entity": null,
              "created": "2023-09-25 12:03:22",
              "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:03:22",
          "actionsCompleted": null,
          "isUpdated": null
        },
        {
          "id": 977,
          "customerId": 74,
          "customer": {
            "id": 74,
            "firstName": "Viola",
            "lastName": "Smith",
            "birthday": null,
            "email": "[email protected]",
            "phone": null,
            "type": "customer",
            "status": "visible",
            "note": null,
            "zoomUserId": null,
            "countryPhoneIso": null,
            "externalId": null,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "translations": null,
            "gender": null
          },
          "status": "approved",
          "extras": [],
          "couponId": null,
          "price": 23,
          "coupon": null,
          "customFields": "{\"2\":{\"label\":\"Select1\",\"type\":\"select\",\"value\":\"\"},\"7\":{\"label\":\"My address\",\"type\":\"address\",\"value\":\"\"},\"8\":{\"label\":\"My address 2\",\"type\":\"address\",\"value\":\"\"},\"11\":{\"label\":\"Select custom field\",\"type\":\"select\",\"value\":\"\"}}",
          "info": "{\"firstName\":\"Viola\",\"lastName\":\"Smith\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
          "appointmentId": 737,
          "persons": 1,
          "token": null,
          "payments": [
            {
              "id": 998,
              "customerBookingId": 977,
              "packageCustomerId": null,
              "parentId": 997,
              "amount": 0,
              "gateway": "onSite",
              "gatewayTitle": "",
              "dateTime": "2023-10-05 09:30:00",
              "status": "pending",
              "data": "",
              "entity": null,
              "created": "2023-09-25 12:27:12",
              "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:27:12",
          "actionsCompleted": null,
          "isUpdated": null
        },
        {
          "id": 975,
          "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\":null,\"timeZone\":null,\"urlParams\":null}",
          "appointmentId": 737,
          "persons": 1,
          "token": null,
          "payments": [
            {
              "id": 996,
              "customerBookingId": 975,
              "packageCustomerId": null,
              "parentId": null,
              "amount": 0,
              "gateway": "onSite",
              "gatewayTitle": "",
              "dateTime": "2023-10-05 13: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:09:47",
          "actionsCompleted": null,
          "isUpdated": null
        }
      ],
      "notifyParticipants": 1,
      "internalNotes": "",
      "status": "approved",
      "serviceId": 1,
      "parentId": null,
      "providerId": 1,
      "locationId": 2,
      "provider": {
        "id": 1,
        "firstName": "Milica",
        "lastName": "Employee",
        "birthday": null,
        "email": "[email protected]",
        "phone": "+381631652656",
        "type": "provider",
        "status": null,
        "note": "note 123345678900",
        "zoomUserId": null,
        "countryPhoneIso": null,
        "externalId": null,
        "pictureFullPath": null,
        "pictureThumbPath": null,
        "translations": null,
        "weekDayList": [],
        "serviceList": [],
        "dayOffList": [],
        "specialDayList": [],
        "locationId": null,
        "googleCalendar": null,
        "outlookCalendar": null,
        "timeZone": null,
        "description": ""
      },
      "service": {
        "id": 1,
        "name": "amelia service",
        "description": "location address: %location_address%",
        "color": "#1788FB",
        "price": 20,
        "deposit": null,
        "depositPayment": null,
        "depositPerPerson": null,
        "pictureFullPath": null,
        "pictureThumbPath": null,
        "extras": [],
        "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": null,
        "minCapacity": 1,
        "maxCapacity": 10,
        "duration": 1800,
        "timeBefore": 1800,
        "timeAfter": 1800,
        "bringingAnyone": null,
        "show": null,
        "aggregatedPrice": null,
        "status": "visible",
        "categoryId": 1,
        "category": null,
        "priority": [],
        "gallery": [],
        "recurringCycle": null,
        "recurringSub": null,
        "recurringPayment": null,
        "translations": null,
        "minSelectedExtras": null,
        "mandatoryExtra": null,
        "customPricing": null,
        "maxExtraPeople": null,
        "limitPerCustomer": null
      },
      "location": null,
      "googleCalendarEventId": "2r1fl3hh5boboa5gjpv62qt8fo",
      "googleMeetUrl": null,
      "outlookCalendarEventId": "AQMkADAwATYwMAItZTk0ZS1lMGRmLTAwAi0wMAoARgAAA3egvCudOo1GsyywV8xCQ2wHANjP2dT7pGFAu0b6VBSGJOoAAAIBDQAAANjP2dT7pGFAu0b6VBSGJOoABsaEPmsAAAA=",
      "zoomMeeting": {
        "id": 79464261133,
        "startUrl": "https://us04web.zoom.us/s/79464261133?zak=eyJ0eXAiOiJKV1QiLCJzdiI6IjAwMDAwMSIsInptX3NrbSI6InptX28ybSIsImFsZyI6IkhTMjU2In0.eyJhdWQiOiJjbGllbnRzbSIsInVpZCI6IlBNUVVXdlVXVEJLMVh6cW11YVM2LUEiLCJpc3MiOiJ3ZWIiLCJzayI6Ijg0OTc4OTYwMzQ5OTI5NjU2NDUiLCJzdHkiOjEwMCwid2NkIjoidXMwNCIsImNsdCI6MCwibW51bSI6Ijc5NDY0MjYxMTMzIiwiZXhwIjoxNjk1NjUyMDQ2LCJpYXQiOjE2OTU2NDQ4NDYsImFpZCI6Ing4ejhiTG1WUzJLODA0aktOa09lTmciLCJjaWQiOiIifQ.-q8VOFskNomSWyPirMguRQy194srA5EWboF7hh4_lkk",
        "joinUrl": "https://us04web.zoom.us/j/79464261133?pwd=9gv9Dk1Hq7zhceLuUFEldlIzdTfsyh.1"
      },
      "lessonSpace": null,
      "bookingStart": "2023-10-05 09:30:00",
      "bookingEnd": "2023-10-05 10:00:00",
      "type": "appointment",
      "isRescheduled": null,
      "isFull": null,
      "resources": []
    },
    "existingAppointmentStatusChanged": false,
    "initialAppointmentDateTime": {
      "bookingStart": "2023-10-05 13:00:00",
      "bookingEnd": "2023-10-05 13:30:00"
    }
  }
}

Cancel booking

Cancel booking.

Method

This endpoint accepts POST requests.

Path

/bookings/cancel/{{booking_id}}

Required Properties

The following properties are required.

Key Type Description
type string Appointment type. Possible values: appointment, event and package

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings/cancel/965' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "type": "appointment"
}'

{
    "message": "Successfully updated booking status",
    "data": {
        "appointment": {
            "id": 730,
            "bookings": [
                {
                    "id": 965,
                    "customerId": 17,
                    "customer": null,
                    "status": "canceled",
                    "extras": [],
                    "couponId": null,
                    "price": 0,
                    "coupon": null,
                    "customFields": "{\"2\":{\"label\":\"Select1\",\"value\":\"\",\"type\":\"select\"},\"5\":{\"label\":\"text3\",\"value\":\"\",\"type\":\"text\"},\"7\":{\"label\":\"My address\",\"value\":\"\",\"type\":\"address\"},\"8\":{\"label\":\"My address 2\",\"value\":\"\",\"type\":\"address\"},\"10\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
                    "info": "{\"firstName\":\"Avatar\",\"lastName\":\"Last Airbender\",\"phone\":null,\"locale\":null,\"timeZone\":null,\"urlParams\":null}",
                    "appointmentId": 730,
                    "persons": 1,
                    "token": null,
                    "payments": [
                        {
                            "id": 987,
                            "customerBookingId": 965,
                            "packageCustomerId": 86,
                            "parentId": null,
                            "amount": 0,
                            "gateway": "onSite",
                            "gatewayTitle": "",
                            "dateTime": "2023-09-25 09:54:46",
                            "status": "paid",
                            "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": {
                        "id": 138,
                        "serviceId": null,
                        "providerId": null,
                        "locationId": null,
                        "bookingsCount": null,
                        "packageCustomer": {
                            "id": 86,
                            "packageId": 2,
                            "customerId": null,
                            "price": null,
                            "payments": [],
                            "start": null,
                            "end": null,
                            "purchased": null,
                            "status": null,
                            "bookingsCount": null,
                            "couponId": null,
                            "coupon": null
                        }
                    },
                    "ticketsData": [],
                    "duration": 1800,
                    "created": "2023-09-25 10:01:51",
                    "actionsCompleted": null,
                    "isUpdated": null
                }
            ],
            "notifyParticipants": 1,
            "internalNotes": "",
            "status": "canceled",
            "serviceId": 2,
            "parentId": null,
            "providerId": 35,
            "locationId": 2,
            "provider": null,
            "service": null,
            "location": null,
            "googleCalendarEventId": null,
            "googleMeetUrl": null,
            "outlookCalendarEventId": null,
            "zoomMeeting": null,
            "lessonSpace": null,
            "bookingStart": "2023-09-28 13:00:00",
            "bookingEnd": "2023-09-28 13:00:00",
            "type": "appointment",
            "isRescheduled": null,
            "isFull": null,
            "resources": []
        },
        "appointmentStatusChanged": false,
        "booking": {
            "id": 965,
            "customerId": 17,
            "customer": {
                "id": 17,
                "firstName": "Avatar",
                "lastName": "Last Airbender",
                "birthday": null,
                "email": "[email protected]",
                "phone": null,
                "type": "customer",
                "status": null,
                "note": null,
                "zoomUserId": null,
                "countryPhoneIso": null,
                "externalId": null,
                "pictureFullPath": null,
                "pictureThumbPath": null,
                "translations": null,
                "gender": null
            },
            "status": "canceled",
            "extras": [],
            "couponId": null,
            "price": 0,
            "coupon": null,
            "customFields": "{\"2\":{\"label\":\"Select1\",\"value\":\"\",\"type\":\"select\"},\"5\":{\"label\":\"text3\",\"value\":\"\",\"type\":\"text\"},\"7\":{\"label\":\"My address\",\"value\":\"\",\"type\":\"address\"},\"8\":{\"label\":\"My address 2\",\"value\":\"\",\"type\":\"address\"},\"10\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
            "info": "{\"firstName\":\"Avatar\",\"lastName\":\"Last Airbender\",\"phone\":null,\"locale\":null,\"timeZone\":null,\"urlParams\":null}",
            "appointmentId": 730,
            "persons": 1,
            "token": "e95992b098",
            "payments": [],
            "utcOffset": null,
            "aggregatedPrice": true,
            "isChangedStatus": null,
            "isLastBooking": null,
            "packageCustomerService": null,
            "ticketsData": [],
            "duration": 1800,
            "created": null,
            "actionsCompleted": null,
            "isUpdated": null
        },
        "type": "appointment",
        "status": "canceled",
        "message": "Appointment status has been changed to canceled"
    }
}

Delete booking

Delete booking.

Method

This endpoint accepts POST requests.

Path

/bookings/delete/{{booking_id}}

Example

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
   }
}