-60% OFF ON Amelia’s birthday

Grab Amelia
Grab Amelia

Amelia API – Services

Here you can see API endpoints related to services.

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 service

Create a service.

Method

This endpoint accepts POST requests.

Path

/services

Required Properties

The following properties are required.

Key Type Description
name string The name of the service.
categoryId integer The id of the category which the service belongs to.
providers array The array of employee ids which work on this service.
duration integer The duration of the service in seconds.
minCapacity integer The minimum capacity of the service.
maxCapacity integer The maximum capacity of the service.
price float The price of the service.

Optional Properties

The following properties are optional:

Key Type Description
color string The hex value of the service color. By default: #1788FB
description string The description of the service.
extras
array The array of extras.
duration integer The duration of the service in seconds.
pictureFullPath
string The path of the picture of the service.
pictureThumbPath string The path of the picture of the service.
customPricing string JSON encoded string with custom pricing rules.
timeBefore integer The buffer time before the service in seconds.
timeAfter integer The buffer time after the service in seconds.
bringingAnyone boolean Whether customers can bring anyone with them. False by default.
show boolean Whether the service should be visible on the form. False by default.
gallery array Array of image paths for the service gallery.
aggregatedPrice boolean Whether the service price will be multiplied by the number of people. False by default.
settings string JSON encoded string of the service settings. NULL by default and general settings will be used.
recurringCycle string The recurring type of the service. Possible values: “disabled”, “all”, “daily”, “weekly” or “monthly”. “Disabled” by default.
recurringSub string Which timeslots to suggest when the recurring appointment date is unavailable. Possible values: “disabled”, “past”, “future” or “both”. “Future” by default.
recurringPayment integer Whether customer pay for the first appointment when booking or for all of the appointments. 0 for only first, 999 for all. Zero by default.
position integer The position of the service, used for sorting. First by default.
deposit float The deposit amount. Zero by default.
depositPayment string The deposit type. Possible values: “disabled”, “fixed” and “percentage”. “Disabled” by default.
depositPerPerson boolean Whether the deposit will be multiplies by the number of people. False by default.
fullPayment boolean Whether the customer has an option to pay the full amount when the deposit is enabled. False by default.
translations string JSON encoded string for the translation of the service name and description.
minSelectedExtras integer The minimum extras to choose. None by default.
mandatoryExtra boolean Whether it is mandatory to select an extra. False by default.
maxExtraPeople integer The maximum number of additional people a customer can bring.
limitPerCustomer string JSON encoded string of the rules for limiting appointments per customer

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "categoryId": "4",
    "color": "#1788FB",
    "description": "",
    "duration": 1800,
    "providers": [
        3
    ],
    "extras": [
        {
            "description": "",
            "descriptionHTML": "",
            "duration": 1800,
            "maxQuantity": 1,
            "name": "extra1",
            "position": 1,
            "price": 100,
            "serviceId": 0,
            "translations": null
        }
    ],
    "maxCapacity": 1,
    "minCapacity": 1,
    "name": "Service 1",
    "pictureFullPath": "",
    "pictureThumbPath": "",
    "price": 0,
    "customPricing": "{\"enabled\": false, \"durations\": []}",
    "status": "visible",
    "timeAfter": "",
    "timeBefore": "",
    "bringingAnyone": true,
    "show": true,
    "gallery": [],
    "aggregatedPrice": true,
    "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
    "recurringCycle": "disabled",
    "recurringSub": "future",
    "recurringPayment": 0,
    "position": 9,
    "deposit": 0,
    "depositPayment": "disabled",
    "depositPerPerson": 1,
    "fullPayment": false,
    "translations": null,
    "minSelectedExtras": null,
    "mandatoryExtra": false,
    "maxExtraPeople": null,
    "limitPerCustomer": "{\"enabled\": false, \"numberOfApp\": 1,\"timeFrame\": \"day\", \"period\": 1, \"from\": \"bookingDate\"}"
}'
{
    "message": "Successfully added new service.",
    "data": {
        "service": {
            "id": 24,
            "name": "Service 1",
            "description": "",
            "color": "#1788FB",
            "price": 0,
            "deposit": 0,
            "depositPayment": "disabled",
            "depositPerPerson": true,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "extras": [
                {
                    "id": 18,
                    "name": "extra1",
                    "description": "",
                    "price": 100,
                    "maxQuantity": 1,
                    "position": 1,
                    "duration": 1800,
                    "serviceId": 24,
                    "aggregatedPrice": null,
                    "translations": null
                }
            ],
            "coupons": [],
            "position": 1,
            "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
            "fullPayment": false,
            "minCapacity": 1,
            "maxCapacity": 1,
            "duration": 1800,
            "timeBefore": null,
            "timeAfter": null,
            "bringingAnyone": true,
            "show": true,
            "aggregatedPrice": true,
            "status": "visible",
            "categoryId": 4,
            "category": null,
            "priority": [],
            "gallery": [],
            "recurringCycle": "disabled",
            "recurringSub": "future",
            "recurringPayment": 0,
            "translations": null,
            "minSelectedExtras": null,
            "mandatoryExtra": false,
            "customPricing": "{\"enabled\": false, \"durations\": []}",
            "maxExtraPeople": null,
            "limitPerCustomer": "{\"enabled\": false, \"numberOfApp\": 1,\"timeFrame\": \"day\", \"period\": 1, \"from\": \"bookingDate\"}"
        }
    }
}

Update service

Update service details.

Method

This endpoint accepts POST requests.

Path

/services/{{service_id}}

Optional Properties

Send only the properties you want updated.

Key Type Description
name string The name of the service.
categoryId integer The id of the category which the service belongs to.
providers array The array of employee ids which work on this service.
duration integer The duration of the service in seconds.
minCapacity integer The minimum capacity of the service.
maxCapacity integer The maximum capacity of the service.
price float The price of the service.
applyGlobally boolean Whether the employees’ price should be updated as well. False by default.
color string The hex value of the service color. By default: #1788FB
description string The description of the service.
extras
array The array of extras.
duration integer The duration of the service in seconds.
pictureFullPath
string The path of the picture of the service.
pictureThumbPath string The path of the picture of the service.
customPricing string JSON encoded string with custom pricing rules.
timeBefore integer The buffer time before the service in seconds.
timeAfter integer The buffer time after the service in seconds.
bringingAnyone boolean Whether customers can bring anyone with them. False by default.
show boolean Whether the service should be visible on the form. False by default.
gallery array Array of image paths for the service gallery.
aggregatedPrice boolean Whether the service price will be multiplied by the number of people. False by default.
settings string JSON encoded string of the service settings. NULL by default and general settings will be used.
recurringCycle string The recurring type of the service. Possible values: disabled, all, daily, weekly or monthly. Disabled by default.
recurringSub string Which timeslots to suggest when the recurring appointment date is unavailable. Possible values: disabled, past, future or both. Future by default.
recurringPayment integer Whether customer pay for the first appointment when booking or for all of the appointments. 0 for only first, 999 for all. Zero by default.
position integer The position of the service, used for sorting. First by default.
deposit float The deposit amount. Zero by default.
depositPayment string The deposit type. Possible values: disabled, fixed and percentage. Disabled by default.
depositPerPerson boolean Whether the deposit will be multiplies by the number of people. False by default.
fullPayment boolean Whether the customer has an option to pay the full amount when the deposit is enabled. False by default.
translations string JSON encoded string for the translation of the service name and description.
minSelectedExtras integer The minimum extras to choose. None by default.
mandatoryExtra boolean Whether it is mandatory to select an extra. False by default.
maxExtraPeople integer The maximum number of additional people a customer can bring.
limitPerCustomer string JSON encoded string of the rules for limiting appointments per customer

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "id": 12,
    "categoryId": "4",
    "color": "#1788FB",
    "description": "",
    "duration": 1800,
    "providers": [
        3
    ],
    "extras": [
        {
            "description": "",
            "descriptionHTML": "",
            "duration": 1800,
            "maxQuantity": 1,
            "name": "extra1",
            "position": 1,
            "price": 100,
            "serviceId": 0,
            "translations": null
        }
    ],
    "maxCapacity": 1,
    "minCapacity": 1,
    "name": "Service New Name",
    "pictureFullPath": "",
    "pictureThumbPath": "",
    "price": 0,
    "customPricing": "{\"enabled\": false, \"durations\": []}",
    "status": "visible",
    "timeAfter": "",
    "timeBefore": "",
    "bringingAnyone": true,
    "show": true,
    "applyGlobally": false,
    "gallery": [],
    "aggregatedPrice": true,
    "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
    "recurringCycle": "disabled",
    "recurringSub": "future",
    "recurringPayment": 0,
    "position": 9,
    "deposit": 0,
    "depositPayment": "disabled",
    "depositPerPerson": 1,
    "fullPayment": false,
    "translations": null,
    "minSelectedExtras": null,
    "mandatoryExtra": false,
    "maxExtraPeople": null,
    "limitPerCustomer": "{\"enabled\": false, \"numberOfApp\": 1,\"timeFrame\": \"day\", \"period\": 1, \"from\": \"bookingDate\"}"
}'
{
    "message": "Successfully updated service.",
    "data": {
        "service": {
            "id": 12,
            "name": "Service New Name",
            "description": "",
            "color": "#1788FB",
            "price": 0,
            "deposit": 0,
            "depositPayment": "disabled",
            "depositPerPerson": true,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "extras": [
                {
                    "id": 11,
                    "name": "extra1",
                    "description": "",
                    "price": 100,
                    "maxQuantity": 1,
                    "position": 1,
                    "duration": 1800,
                    "serviceId": 12,
                    "aggregatedPrice": null,
                    "translations": null
                }
            ],
            "coupons": [],
            "position": 9,
            "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.2.3\"}}",
            "fullPayment": false,
            "minCapacity": 1,
            "maxCapacity": 1,
            "duration": 1800,
            "timeBefore": null,
            "timeAfter": null,
            "bringingAnyone": true,
            "show": true,
            "aggregatedPrice": true,
            "status": "visible",
            "categoryId": 4,
            "category": null,
            "priority": [],
            "gallery": [],
            "recurringCycle": "disabled",
            "recurringSub": "future",
            "recurringPayment": 0,
            "translations": null,
            "minSelectedExtras": null,
            "mandatoryExtra": false,
            "customPricing": "{\"enabled\": false, \"durations\": []}",
            "maxExtraPeople": null,
            "limitPerCustomer": "{\"enabled\": false, \"numberOfApp\": 1,\"timeFrame\": \"day\", \"period\": 1, \"from\": \"bookingDate\"}"
        }
    }
}

Update service status

Update service status.

Method

This endpoint accepts POST requests.

Path

/services/status/{{service_id}}

Required Properties

The following properties are required.

Key Type Description
status string The new status of the service. Possible values: “visible”, “hidden”, “disabled”

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/status/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
   "status": "visible" 
}'
{
    "message": "Successfully updated service",
    "data": true
}

Update services positions

Update services position.

Method

This endpoint accepts POST requests.

Path

/services/positions

Required Properties

The following properties are required.

Key Type Description
sorting string Type of sorting to be done. Possible values: “custom”, “priceAsc”, “priceDesc”, “nameAsc”, “nameDesc”
services array Array of service ids sorted in a custom way. Used when the sorting type is set as custom

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/positions' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "services": [
        {"id": 4}, {"id": 12}
    ],
    "sorting": "custom" 
}'
{
    "message": "Successfully updated bookable services positions.",
    "data": null
}

Get service

Retrieve service details.

Method

This endpoint accepts GET requests.

Path

/services/{{service_id}}

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved service.",
    "data": {
        "service": {
            "id": 12,
            "name": "Service New Name",
            "description": "",
            "color": "#1788FB",
            "price": 0,
            "deposit": 0,
            "depositPayment": "disabled",
            "depositPerPerson": true,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "extras": [
                {
                    "id": 10,
                    "name": "extra1",
                    "description": "",
                    "price": 100,
                    "maxQuantity": 1,
                    "position": 1,
                    "duration": 1800,
                    "serviceId": null,
                    "aggregatedPrice": false,
                    "translations": null
                },
                {
                    "id": 11,
                    "name": "extra1",
                    "description": "",
                    "price": 100,
                    "maxQuantity": 1,
                    "position": 1,
                    "duration": 1800,
                    "serviceId": null,
                    "aggregatedPrice": false,
                    "translations": null
                }
            ],
            "coupons": [],
            "position": 9,
            "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.2.3\"}}",
            "fullPayment": false,
            "minCapacity": 1,
            "maxCapacity": 1,
            "duration": 1800,
            "timeBefore": null,
            "timeAfter": null,
            "bringingAnyone": true,
            "show": true,
            "aggregatedPrice": true,
            "status": "visible",
            "categoryId": 2,
            "category": null,
            "priority": [],
            "gallery": [],
            "recurringCycle": "disabled",
            "recurringSub": "future",
            "recurringPayment": 0,
            "translations": null,
            "minSelectedExtras": null,
            "mandatoryExtra": false,
            "customPricing": "{\"enabled\":false,\"durations\":{}}",
            "maxExtraPeople": null,
            "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}"
        },
        "futureAppointmentsProvidersIds": []
    }
}

Get service delete effect

See if a service can be deleted safely, based on future appointments.

Method

This endpoint accepts GET requests.

Path

/services/effect/{{service_id}}

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/effect/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved message.",
    "data": {
        "valid": false,
        "message": "Could not delete service. \n            This service has 20 appointments in the future."
    }
}

Get services

Retrieve services details.

Method

This endpoint accepts GET requests.

Path

/services

Optional Properties

You can use the following query parameters to filter the services returned.

Key Type Description
page integer The page number.
categoryId integer The id of the category for which to return the services

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services&page=1&categoryId=2' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved services.",
    "data": {
        "services": [
            {
                "id": 15,
                "name": "just service",
                "description": "",
                "color": "#1788FB",
                "price": 330,
                "deposit": 0,
                "depositPayment": "disabled",
                "depositPerPerson": true,
                "pictureFullPath": null,
                "pictureThumbPath": null,
                "extras": [],
                "coupons": [],
                "position": 3,
                "settings": "{\"payments\":{\"payPal\":{\"enabled\":false},\"razorpay\":{\"enabled\":false},\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"stripe\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.6\"}}",
                "fullPayment": false,
                "minCapacity": 1,
                "maxCapacity": 1,
                "duration": 3600,
                "timeBefore": null,
                "timeAfter": null,
                "bringingAnyone": true,
                "show": true,
                "aggregatedPrice": true,
                "status": "visible",
                "categoryId": 2,
                "category": null,
                "priority": "least_expensive",
                "gallery": [],
                "recurringCycle": "disabled",
                "recurringSub": "future",
                "recurringPayment": 0,
                "translations": null,
                "minSelectedExtras": null,
                "mandatoryExtra": false,
                "customPricing": "{\"enabled\":true,\"durations\":{\"1800\":{\"price\":20,\"rules\":[]},\"5400\":{\"price\":500,\"rules\":[]}}}",
                "maxExtraPeople": null,
                "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}"
            }
        ],
        "countFiltered": 4,
        "countTotal": 18
    }
}

Delete service

Delete service.

Method

This endpoint accepts POST requests.

Path

/services/delete/{{service_id}}

Example

curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/services/delete/12' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully deleted service.",
    "data": []
}