Don’t miss our Special Offer!

Up to 50% off
Grab Amelia
Grab Amelia

Amelia API – Categories

Here you can see API endpoints related to categories.

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 category

Create a category.

Method

This endpoint accepts POST requests.

Path

/categories

Required Properties

The following properties are required.

Key Type Description
name string The name of the category.
status string The status of the category. Possible values: “hidden”, “visible”
position integer The position of the category, related to sorting position.

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/categories' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "status": "visible",
    "name": "Category 3",
    "position": 1
}'
{
    "message": "Successfully added new category.",
    "data": {
        "category": {
            "id": 5,
            "status": "visible",
            "name": "Category 3",
            "serviceList": [],
            "position": 1,
            "translations": null
        }
    }
}

Update category

Update category details.

Method

This endpoint accepts POST requests.

Path

/categroies/{{category_id}}

Optional Properties

Send only the properties you want updated.

Key Type Description
name string The name of the category.
status string The status of the category. Possible values: “hidden”, “visible”
position integer The position of the category, related to sorting position.
translations JSON encoded string The translations of the category.

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/categories/4' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "name": "Category 5",
    "translations": "{\"name\":{\"fr_FR\":\"catégorie\"}}"
}'
{
    "message": "Successfully updated bookable category.",
    "data": {
        "category": {
            "id": 4,
            "status": "visible",
            "name": "Category 5",
            "serviceList": [],
            "position": 1,
            "translations": "{\"name\":{\"fr_FR\":\"catégorie\"}}"
        }
    }
}

Get category

Retrieve category details.

Method

This endpoint accepts GET requests.

Path

/categories/{{category_id}}

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/categories/4' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved category.",
    "data": {
        "category": {
            "id": 4,
            "status": "visible",
            "name": "Category 5",
            "serviceList": [
                {
                    "id": 8,
                    "name": "new api service",
                    "description": "",
                    "color": "#1788FB",
                    "price": 0,
                    "deposit": 0,
                    "depositPayment": "disabled",
                    "depositPerPerson": true,
                    "pictureFullPath": null,
                    "pictureThumbPath": null,
                    "extras": [],
                    "coupons": [],
                    "position": 7,
                    "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":true},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.6\"}}",
                    "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\"}"
                },
                {
                    "id": 10,
                    "name": "new api service 2",
                    "description": "",
                    "color": "#1788FB",
                    "price": 0,
                    "deposit": 0,
                    "depositPayment": "disabled",
                    "depositPerPerson": true,
                    "pictureFullPath": null,
                    "pictureThumbPath": null,
                    "extras": [],
                    "coupons": [],
                    "position": 8,
                    "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.4\"}}",
                    "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\"}"
                }
            ],
            "position": 1,
            "translations": "{\"name\":{\"fr_FR\":\"catégorie\"}}"
        }
    }
}

Get categories

Retrieve categories details.

Method

This endpoint accepts GET requests.

Path

/categories

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/categories' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved categories.",
    "data": {
        "categories": [
            {
                "id": 1,
                "status": "visible",
                "name": "Category 2",
                "serviceList": [
                    {
                        "id": 1,
                        "name": "amelia service",
                        "description": "location address: %location_address%",
                        "color": "#1788FB",
                        "price": 20,
                        "deposit": 14,
                        "depositPayment": "fixed",
                        "depositPerPerson": true,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [
                            {
                                "id": 17,
                                "name": "extra",
                                "description": "",
                                "price": 0,
                                "maxQuantity": 1,
                                "position": 1,
                                "duration": 600,
                                "serviceId": null,
                                "aggregatedPrice": false,
                                "translations": null
                            }
                        ],
                        "coupons": [],
                        "position": 1,
                        "settings": "{\"payments\":{\"mollie\":{\"enabled\":true},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"razorpay\":{\"enabled\":true},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.7\"}}",
                        "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": "all",
                        "recurringSub": "future",
                        "recurringPayment": 999,
                        "translations": null,
                        "minSelectedExtras": 1,
                        "mandatoryExtra": false,
                        "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\"}"
                    }
                ],
                "position": 1,
                "translations": null
            },
            {
                "id": 4,
                "status": "visible",
                "name": "Category Name 2",
                "serviceList": [
                    {
                        "id": 8,
                        "name": "new api service",
                        "description": "",
                        "color": "#1788FB",
                        "price": 0,
                        "deposit": 0,
                        "depositPayment": "disabled",
                        "depositPerPerson": true,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": 7,
                        "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":true},\"razorpay\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.6\"}}",
                        "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\"}"
                    },
                    {
                        "id": 10,
                        "name": "new api service 2",
                        "description": "",
                        "color": "#1788FB",
                        "price": 0,
                        "deposit": 0,
                        "depositPayment": "disabled",
                        "depositPerPerson": true,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": 8,
                        "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.4\"}}",
                        "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\"}"
                    }
                ],
                "position": 2,
                "translations": null
            },
            {
                "id": 2,
                "status": "visible",
                "name": "kategorija2",
                "serviceList": [
                    {
                        "id": 14,
                        "name": "rec service",
                        "description": "",
                        "color": "#1788FB",
                        "price": 22,
                        "deposit": 10,
                        "depositPayment": "fixed",
                        "depositPerPerson": true,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": 11,
                        "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false}}",
                        "fullPayment": true,
                        "minCapacity": 1,
                        "maxCapacity": 1,
                        "duration": 3600,
                        "timeBefore": null,
                        "timeAfter": null,
                        "bringingAnyone": true,
                        "show": true,
                        "aggregatedPrice": true,
                        "status": "visible",
                        "categoryId": 2,
                        "category": null,
                        "priority": [],
                        "gallery": [],
                        "recurringCycle": "all",
                        "recurringSub": "future",
                        "recurringPayment": 999,
                        "translations": null,
                        "minSelectedExtras": null,
                        "mandatoryExtra": false,
                        "customPricing": "{\"enabled\":false,\"durations\":{}}",
                        "maxExtraPeople": null,
                        "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}"
                    },
                    {
                        "id": 4,
                        "name": "Service 2",
                        "description": "",
                        "color": "#1788FB",
                        "price": 45,
                        "deposit": 20,
                        "depositPayment": "fixed",
                        "depositPerPerson": true,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": 12,
                        "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.2.3\"}}",
                        "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": [],
                        "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\"}"
                    }
                ],
                "position": 3,
                "translations": null
            }
        ]
    }
}

Delete category

Delete category.

Method

This endpoint accepts POST requests.

Path

/categories/delete/{{category_id}}

Example

curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/categories/delete/4' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'

{
    "message": "Successfully deleted bookable category.",
    "data": null
}