Palm

Hello summer! SAVE UP TO 50% OFF!

Grab Amelia
Palm 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

Appointment booking

Required Properties

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

Event booking

Required Properties

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.
payment object Payment object with the following fields: gateway, currency and data.
eventId integer Event ID

Other Properties

Key Type Description
locale string Locale of the customer. Example: “en_US”
timeZone string Timezone of the customer. Example: “Europe/Belgrade“
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/amelia2/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings' \
--data-raw '{
    "type": "event",
    "bookings": [
        {
            "customer": {
                "email": "[email protected]",
                "externalId": null,
                "firstName": "Amelia",
                "lastName": "Test",
                "phone": "",
                "countryPhoneIso": "rs"
            },
            "customFields": {
                "1": {
                    "label": "text",
                    "value": "",
                    "type": "text"
                }
            },
            "customerId": 0,
            "persons": 1,  // use persons if the event does not use tickets
            "ticketsData": [  // use ticketsData if event uses tickets
                {
                    "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": [
                {
                    "id": 262,
                    "customerId": 11,
                    "customer": {
                        "id": 11,
                        "firstName": "Amelia",
                        "lastName": "Test",
                        "birthday": null,
                        "email": "[email protected]",
                        "phone": null,
                        "type": "customer",
                        "status": null,
                        "note": null,
                        "zoomUserId": null,
                        "countryPhoneIso": "rs",
                        "externalId": null,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "translations": "{\"defaultLanguage\":\"en_US\"}",
                        "gender": null
                    },
                    "status": "approved",
                    "extras": [],
                    "couponId": null,
                    "price": 20,
                    "coupon": null,
                    "customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
                    "info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
                    "appointmentId": null,
                    "persons": 0,
                    "token": "eace84d090",
                    "payments": [
                        {
                            "id": 303,
                            "customerBookingId": 262,
                            "packageCustomerId": null,
                            "parentId": null,
                            "amount": 0,
                            "gateway": "onSite",
                            "gatewayTitle": "",
                            "dateTime": "2023-05-17 09:00:00",
                            "status": "pending",
                            "data": "",
                            "entity": "event",
                            "created": null,
                            "actionsCompleted": null,
                            "wcOrderId": null,
                            "wcOrderUrl": null,
                            "wcItemCouponValue": null,
                            "wcItemTaxValue": null
                        }
                    ],
                    "utcOffset": null,
                    "aggregatedPrice": true,
                    "isChangedStatus": null,
                    "isLastBooking": null,
                    "packageCustomerService": null,
                    "ticketsData": [
                        {
                            "id": null,
                            "eventTicketId": 25,
                            "customerBookingId": null,
                            "persons": null,
                            "price": 20
                        },
                        {
                            "id": null,
                            "eventTicketId": 24,
                            "customerBookingId": null,
                            "persons": 2,
                            "price": 10
                        }
                    ],
                    "duration": null,
                    "created": null,
                    "actionsCompleted": false
                }
            ],
            "periods": [
                {
                    "id": 54,
                    "eventId": 54,
                    "periodStart": "2023-05-17 09:00:00",
                    "periodEnd": "2023-05-17 20:30:00",
                    "zoomMeeting": null,
                    "lessonSpace": null,
                    "bookings": [],
                    "googleCalendarEventId": null,
                    "googleMeetUrl": null,
                    "outlookCalendarEventId": null
                }
            ],
            "bookingOpens": null,
            "bookingCloses": null,
            "bookingOpensRec": "same",
            "bookingClosesRec": "same",
            "ticketRangeRec": "calculate",
            "status": "approved",
            "recurring": null,
            "maxCapacity": 1,
            "maxCustomCapacity": null,
            "show": true,
            "tags": [],
            "customTickets": [
                {
                    "id": 25,
                    "eventId": 54,
                    "name": "ticket2",
                    "enabled": true,
                    "price": 20,
                    "dateRangePrice": null,
                    "spots": 20,
                    "dateRanges": "[]",
                    "sold": 0,
                    "translations": null
                },
                {
                    "id": 24,
                    "eventId": 54,
                    "name": "ticket1",
                    "enabled": true,
                    "price": 10,
                    "dateRangePrice": null,
                    "spots": 10,
                    "dateRanges": "[]",
                    "sold": 0,
                    "translations": null
                }
            ],
            "gallery": [],
            "providers": [],
            "notifyParticipants": 1,
            "locationId": null,
            "location": null,
            "customLocation": null,
            "parentId": null,
            "created": "2023-04-28 16:05:24",
            "zoomUserId": null,
            "organizerId": null,
            "type": "event",
            "bringingAnyone": true,
            "bookMultipleTimes": true,
            "translations": null,
            "customPricing": true,
            "closeAfterMin": null,
            "closeAfterMinBookings": false,
            "maxExtraPeople": null,
            "initialEventStart": null,
            "initialEventEnd": null
        },
        "booking": {
            "id": 262,
            "customerId": 11,
            "customer": {
                "id": 11,
                "firstName": "Amelia",
                "lastName": "Test",
                "birthday": null,
                "email": "[email protected]",
                "phone": null,
                "type": "customer",
                "status": null,
                "note": null,
                "zoomUserId": null,
                "countryPhoneIso": "rs",
                "externalId": null,
                "pictureFullPath": null,
                "pictureThumbPath": null,
                "translations": "{\"defaultLanguage\":\"en_US\"}",
                "gender": null
            },
            "status": "approved",
            "extras": [],
            "couponId": null,
            "price": 20,
            "coupon": null,
            "customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
            "info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
            "appointmentId": null,
            "persons": 0,
            "token": "eace84d090",
            "payments": [
                {
                    "id": 303,
                    "customerBookingId": 262,
                    "packageCustomerId": null,
                    "parentId": null,
                    "amount": 0,
                    "gateway": "onSite",
                    "gatewayTitle": "",
                    "dateTime": "2023-05-17 09:00:00",
                    "status": "pending",
                    "data": "",
                    "entity": "event",
                    "created": null,
                    "actionsCompleted": null,
                    "wcOrderId": null,
                    "wcOrderUrl": null,
                    "wcItemCouponValue": null,
                    "wcItemTaxValue": null
                }
            ],
            "utcOffset": null,
            "aggregatedPrice": true,
            "isChangedStatus": null,
            "isLastBooking": null,
            "packageCustomerService": null,
            "ticketsData": [
                {
                    "id": null,
                    "eventTicketId": 25,
                    "customerBookingId": null,
                    "persons": null,
                    "price": 20
                },
                {
                    "id": null,
                    "eventTicketId": 24,
                    "customerBookingId": null,
                    "persons": 2,
                    "price": 10
                }
            ],
            "duration": null,
            "created": null,
            "actionsCompleted": false
        },
        "utcTime": [
            {
                "start": "2023-05-17 07:00:00",
                "end": "2023-05-17 18:30:00"
            }
        ],
        "appointmentStatusChanged": false,
        "recurring": [],
        "package": [],
        "packageId": null,
        "customer": {
            "id": 11,
            "firstName": "Amelia",
            "lastName": "Test",
            "birthday": null,
            "email": "[email protected]",
            "phone": null,
            "type": "customer",
            "status": null,
            "note": null,
            "zoomUserId": null,
            "countryPhoneIso": "rs",
            "externalId": null,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "translations": "{\"defaultLanguage\":\"en_US\"}",
            "gender": null,
            "locale": "en_US",
            "timeZone": "Europe/Belgrade"
        },
        "bookable": {
            "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": [
                {
                    "id": 259,
                    "customerId": 11,
                    "customer": null,
                    "status": "approved",
                    "extras": [],
                    "couponId": null,
                    "price": 40,
                    "coupon": null,
                    "customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
                    "info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
                    "appointmentId": null,
                    "persons": 0,
                    "token": null,
                    "payments": [],
                    "utcOffset": null,
                    "aggregatedPrice": true,
                    "isChangedStatus": null,
                    "isLastBooking": null,
                    "packageCustomerService": null,
                    "ticketsData": [
                        {
                            "id": 45,
                            "eventTicketId": 25,
                            "customerBookingId": 259,
                            "persons": 2,
                            "price": 20
                        }
                    ],
                    "duration": null,
                    "created": null,
                    "actionsCompleted": null
                },
                {
                    "id": 262,
                    "customerId": 11,
                    "customer": {
                        "id": 11,
                        "firstName": "Amelia",
                        "lastName": "Test",
                        "birthday": null,
                        "email": "[email protected]",
                        "phone": null,
                        "type": "customer",
                        "status": null,
                        "note": null,
                        "zoomUserId": null,
                        "countryPhoneIso": "rs",
                        "externalId": null,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "translations": "{\"defaultLanguage\":\"en_US\"}",
                        "gender": null
                    },
                    "status": "approved",
                    "extras": [],
                    "couponId": null,
                    "price": 20,
                    "coupon": null,
                    "customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
                    "info": "{\"firstName\":\"Amelia\",\"lastName\":\"Test\",\"phone\":null,\"locale\":\"en_US\",\"timeZone\":\"Europe\\/Belgrade\",\"urlParams\":null}",
                    "appointmentId": null,
                    "persons": 0,
                    "token": "eace84d090",
                    "payments": [
                        {
                            "id": 303,
                            "customerBookingId": 262,
                            "packageCustomerId": null,
                            "parentId": null,
                            "amount": 0,
                            "gateway": "onSite",
                            "gatewayTitle": "",
                            "dateTime": "2023-05-17 09:00:00",
                            "status": "pending",
                            "data": "",
                            "entity": "event",
                            "created": null,
                            "actionsCompleted": null,
                            "wcOrderId": null,
                            "wcOrderUrl": null,
                            "wcItemCouponValue": null,
                            "wcItemTaxValue": null
                        }
                    ],
                    "utcOffset": null,
                    "aggregatedPrice": true,
                    "isChangedStatus": null,
                    "isLastBooking": null,
                    "packageCustomerService": null,
                    "ticketsData": [
                        {
                            "id": null,
                            "eventTicketId": 25,
                            "customerBookingId": null,
                            "persons": null,
                            "price": 20
                        },
                        {
                            "id": null,
                            "eventTicketId": 24,
                            "customerBookingId": null,
                            "persons": 2,
                            "price": 10
                        }
                    ],
                    "duration": null,
                    "created": null,
                    "actionsCompleted": false
                }
            ],
            "periods": [
                {
                    "id": 54,
                    "eventId": 54,
                    "periodStart": "2023-05-17 09:00:00",
                    "periodEnd": "2023-05-17 20:30:00",
                    "zoomMeeting": null,
                    "lessonSpace": null,
                    "bookings": [],
                    "googleCalendarEventId": null,
                    "googleMeetUrl": null,
                    "outlookCalendarEventId": null
                }
            ],
            "bookingOpens": null,
            "bookingCloses": null,
            "bookingOpensRec": "same",
            "bookingClosesRec": "same",
            "ticketRangeRec": "calculate",
            "status": "approved",
            "recurring": null,
            "maxCapacity": 1,
            "maxCustomCapacity": null,
            "show": true,
            "tags": [],
            "customTickets": [
                {
                    "id": 25,
                    "eventId": 54,
                    "name": "ticket2",
                    "enabled": true,
                    "price": 20,
                    "dateRangePrice": null,
                    "spots": 20,
                    "dateRanges": "[]",
                    "sold": 0,
                    "translations": null
                },
                {
                    "id": 24,
                    "eventId": 54,
                    "name": "ticket1",
                    "enabled": true,
                    "price": 10,
                    "dateRangePrice": null,
                    "spots": 10,
                    "dateRanges": "[]",
                    "sold": 0,
                    "translations": null
                }
            ],
            "gallery": [],
            "providers": [],
            "notifyParticipants": 1,
            "locationId": null,
            "location": null,
            "customLocation": null,
            "parentId": null,
            "created": "2023-04-28 16:05:24",
            "zoomUserId": null,
            "organizerId": null,
            "type": "event",
            "bringingAnyone": true,
            "bookMultipleTimes": true,
            "translations": null,
            "customPricing": true,
            "closeAfterMin": null,
            "closeAfterMinBookings": false,
            "maxExtraPeople": null,
            "initialEventStart": null,
            "initialEventEnd": null
        },
        "paymentId": 303,
        "packageCustomerId": null,
        "payment": {
            "id": 303,
            "customerBookingId": 262,
            "packageCustomerId": null,
            "parentId": null,
            "amount": 0,
            "gateway": "onSite",
            "gatewayTitle": "",
            "dateTime": "2023-05-17 09:00:00",
            "status": "pending",
            "data": "",
            "entity": "event",
            "created": null,
            "actionsCompleted": null,
            "wcOrderId": null,
            "wcOrderUrl": null,
            "wcItemCouponValue": null,
            "wcItemTaxValue": null
        },
        "customerCabinetUrl": "http://localhost/static_amelia/index.php/customer-panel"
    }
}

Package booking

Required Properties

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.
payment object Payment object with the following fields: gateway, currency and data.
packageId integer Package ID
package array Array of all the booked package appointments.

Other Properties

Key Type Description
locale string Locale of the customer. Example: “en_US”
timeZone string Timezone of the customer. Example: “Europe/Belgrade“
couponCode string Coupon code.
packageRules array Chosen employee and location for each service in the package. These employees will be used when the customer continues booking appointments in their package on the customer panel, if choosing the employee is disabled
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/amelia2/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/bookings' \
--header 'Content-Type: application/json' \
--header 'Amelia: s7nC4/uAb0dPHnFevx06GKJGryzFxnVeiCwPNmZRD/a+' \
--data-raw '{
    "type": "package",
    "bookings": [
        {
            "customFields": {
                "2": {
                    "label": "Text",
                    "type": "text",
                    "value": ""
                }
            },
            "deposit": true,
            "locale": "en_US",
            "utcOffset": null,
            "customerId": null,
            "customer": {
                "firstName": "Amelia",
                "lastName": "Test",
                "email": "[email protected]",
                "phone": "",
                "countryPhoneIso": "",
                "externalId": null,
                "translations": null
            },
            "persons": 1
        }
    ],
    "payment": {
        "gateway": "onSite",
        "currency": "USD",
        "data": {}
    },
    "locale": "en_US",
    "timeZone": "Europe/Belgrade",
    "package": [
        {
            "bookingStart": "2024-06-05 07:30",
            "serviceId": 1,
            "providerId": 4,
            "locationId": 8,
            "utcOffset": 120,
            "notifyParticipants": 1
        },
        {
            "bookingStart": "2024-06-04 10:00",
            "serviceId": 11,
            "providerId": 4,
            "locationId": 8,
            "utcOffset": 120,
            "notifyParticipants": 1
        }
    ],
    "packageId": 1,
    "packageRules": [
        {
            "serviceId": 1,
            "providerId": 2,
            "locationId": 1
        },
        {
            "serviceId": 11,
            "providerId": null,
            "locationId": null
        }
    ],
    "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": "[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": 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": "[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": 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": false
            },
            {
                "type": "appointment",
                "appointment": {
                    "id": 581,
                    "bookings": [
                        {
                            "id": 767,
                            "customerId": 2,
                            "customer": {
                                "id": 2,
                                "firstName": "Amelia",
                                "lastName": "Test",
                                "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": 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": 581,
                            "persons": 1,
                            "token": "163935398a",
                            "payments": [],
                            "utcOffset": 120,
                            "aggregatedPrice": true,
                            "isChangedStatus": null,
                            "isLastBooking": null,
                            "packageCustomerService": {
                                "id": 130,
                                "serviceId": 11,
                                "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": 11,
                    "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-04 12:00:00",
                    "bookingEnd": "2024-06-04 12:30:00",
                    "type": "appointment",
                    "isRescheduled": null,
                    "isFull": null,
                    "resources": []
                },
                "booking": {
                    "id": 767,
                    "customerId": 2,
                    "customer": {
                        "id": 2,
                        "firstName": "Amelia",
                        "lastName": "Test",
                        "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": 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": 581,
                    "persons": 1,
                    "token": "163935398a",
                    "payments": [],
                    "utcOffset": 120,
                    "aggregatedPrice": true,
                    "isChangedStatus": null,
                    "isLastBooking": null,
                    "packageCustomerService": {
                        "id": 130,
                        "serviceId": 11,
                        "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-04 10:00:00",
                        "end": "2024-06-04 10:30:00"
                    }
                ],
                "appointmentStatusChanged": false
            }
        ],
        "booking": null,
        "utcTime": [],
        "appointmentStatusChanged": false,
        "recurring": [],
        "packageId": 1,
        "customer": {
            "id": 2,
            "firstName": "Amelia",
            "lastName": "Test",
            "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 package",
            "description": "description",
            "color": "#1788FB",
            "price": 40,
            "deposit": 10,
            "depositPayment": "fixed",
            "depositPerPerson": null,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "extras": [],
            "coupons": [],
            "position": 2,
            "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null}}}",
            "fullPayment": true,
            "type": "package",
            "status": "visible",
            "gallery": [],
            "bookable": [
                {
                    "id": 1,
                    "quantity": 1,
                    "service": {
                        "id": 1,
                        "name": "service1",
                        "description": null,
                        "color": null,
                        "price": 20,
                        "deposit": null,
                        "depositPayment": null,
                        "depositPerPerson": null,
                        "pictureFullPath": "http://localhost/amelia2/wp-content/uploads/2023/12/ocean.jpg",
                        "pictureThumbPath": "http://localhost/amelia2/wp-content/uploads/2023/12/ocean.jpg",
                        "extras": [],
                        "coupons": [],
                        "position": null,
                        "settings": null,
                        "fullPayment": null,
                        "minCapacity": 1,
                        "maxCapacity": 4,
                        "duration": 1800,
                        "timeBefore": 1800,
                        "timeAfter": 1800,
                        "bringingAnyone": null,
                        "show": true,
                        "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
                    },
                    "minimumScheduled": 1,
                    "maximumScheduled": 1,
                    "providers": [
                        {
                            "id": 4,
                            "firstName": "Milica",
                            "lastName": "Employee",
                            "birthday": null,
                            "email": "[email protected]",
                            "phone": null,
                            "type": "provider",
                            "status": "visible",
                            "note": null,
                            "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": null,
                            "badgeId": null
                        }
                    ],
                    "locations": [],
                    "allowProviderSelection": true,
                    "position": null
                },
                {
                    "id": 8,
                    "quantity": 1,
                    "service": {
                        "id": 11,
                        "name": "service3 20$",
                        "description": null,
                        "color": null,
                        "price": 20,
                        "deposit": null,
                        "depositPayment": null,
                        "depositPerPerson": null,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": null,
                        "settings": null,
                        "fullPayment": null,
                        "minCapacity": 1,
                        "maxCapacity": 100,
                        "duration": 1800,
                        "timeBefore": null,
                        "timeAfter": null,
                        "bringingAnyone": null,
                        "show": true,
                        "aggregatedPrice": null,
                        "status": "visible",
                        "categoryId": 12,
                        "category": null,
                        "priority": [],
                        "gallery": [],
                        "recurringCycle": null,
                        "recurringSub": null,
                        "recurringPayment": null,
                        "translations": null,
                        "minSelectedExtras": null,
                        "mandatoryExtra": null,
                        "customPricing": null,
                        "maxExtraPeople": null,
                        "limitPerCustomer": null
                    },
                    "minimumScheduled": 1,
                    "maximumScheduled": 1,
                    "providers": [
                        {
                            "id": 4,
                            "firstName": "Milica",
                            "lastName": "Employee",
                            "birthday": null,
                            "email": "[email protected]",
                            "phone": null,
                            "type": "provider",
                            "status": "visible",
                            "note": null,
                            "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": null,
                            "badgeId": null
                        }
                    ],
                    "locations": [],
                    "allowProviderSelection": true,
                    "position": null
                }
            ],
            "calculatedPrice": true,
            "discount": 0,
            "endDate": null,
            "durationCount": 3,
            "durationType": "week",
            "translations": "{\"name\":{\"fr_FR\":\"amelia paket french\",\"en_GB\":\"\"},\"description\":{\"fr_FR\":\"desc french\",\"en_GB\":\"\",\"fr_FRHtml\":\"desc french\",\"en_GBHtml\":\"\"}}",
            "sharedCapacity": false,
            "quantity": 1,
            "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}"
        },
        "paymentId": 782,
        "packageCustomerId": 104,
        "payment": {
            "id": 782,
            "customerBookingId": null,
            "packageCustomerId": 104,
            "parentId": null,
            "amount": 0,
            "gateway": "onSite",
            "gatewayTitle": "",
            "dateTime": "2024-05-27 12:35:52",
            "status": "pending",
            "data": "",
            "entity": "package",
            "created": null,
            "actionsCompleted": null,
            "triggeredActions": null,
            "wcOrderId": null,
            "wcOrderItemId": null,
            "wcOrderUrl": null,
            "wcItemCouponValue": null,
            "wcItemTaxValue": null,
            "transactionId": null
        },
        "isCart": false,
        "customerCabinetUrl": "http://localhost/amelia2/?page_id=82"
    }
}

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