Special deal!
SAVE UP TO 50% OFF!
Grab now

Amelia API – Packages

Here you can see API endpoints related to packages.

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 package

Create a package.

Method

This endpoint accepts POST requests.

Path

/packages

Required Properties

The following properties are required.

Key Type Description
name string The name of the package.
bookable array An array of the services objects in the package. The object has the following properties: “service”, “providers”, “locations”, “quantity”, “minimumScheduled”, “maximumScheduled”, “allowProviderSelection”
price double The price of the package.

Optional Properties

The following properties are optional

Key Type Description
status string The status of the package. Possible values: “visible”, “hidden”, “disabled”. The default value is “visible”.
description
string The description of the package.
color
string The color of the package. The default values is “#1788FB”.
calculatedPrice
boolean Whether the price of the package is a calculated price of the services. True by default.
discount
double The discount of the package.
gallery
array An array of the pictures for the gallery of the package.
pictureFullPath
string The path for the picture of the package.
pictureThumbPath
string The path for the picture of the package.
position
integer The position of the package, used for sorting. The default value is 1.
settings
string JSON encoded string of the package settings. By default the general settings will be used.
endDate
string The date and time of the expiration date of a package purchase. The format is: “YYYY-MM-DD HH:mm”
durationCount
string The number of days/weeks/months of the expiration of a package purchase
durationType
integer The type of durationCount. Possible values “day”, “week”, “month”.
translations
string JSON encoded string of the package translations.
sharedCapacity
boolean Whether the package has a shared capacity between the services or not. The default values is false.
quantity
integer The quantity of the services in case of sharedCapacity being true.
limitPerCustomer
integer JSON encoded string of the limit per customer package purchases.
descriptionHtml
string The description of the package in HTML
deposit
double The deposit amount.
depositPayment
string The type of the package deposit. Possible values: “disabled”, “fixed”, “percentage”.
fullPayment
boolean Whether the client will have an option to pay for the full amount instead of just the deposit. False by default..

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "bookable": [
        {
            "service": {
                "id": 1
            },
            "providers": [],
            "locations": [],
            "quantity": 1,
            "minimumScheduled": 0,
            "maximumScheduled": 1,
            "allowProviderSelection": true
        },
        {
            "service": {
                "id": 4
            },
            "providers": [],
            "locations": [],
            "quantity": 1,
            "minimumScheduled": 0,
            "maximumScheduled": 1,
            "allowProviderSelection": false
        }
    ],
    "color": "#1788FB",
    "description": "Description of package",
    "name": "Amelia 3 Package",
    "pictureFullPath": "",
    "pictureThumbPath": "",
    "price": 55,
    "calculatedPrice": false,
    "discount": 0,
    "status": "visible",
    "gallery": [],
    "position": 9,
    "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}",
    "endDate": null,
    "durationCount": null,
    "durationType": null,
    "deposit": 0,
    "depositPayment": "disabled",
    "translations": null,
    "sharedCapacity": false,
    "quantity": 1,
    "limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}",
    "descriptionHtml": "Description of package"
}'
{
    "message": "Successfully added new package.",
    "data": {
        "package": {
            "id": 22,
            "name": "Amelia 3 Package",
            "description": null,
            "color": "#1788FB",
            "price": 55,
            "deposit": 0,
            "depositPayment": "disabled",
            "depositPerPerson": null,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "extras": [],
            "coupons": [],
            "position": 1,
            "settings": null,
            "fullPayment": null,
            "type": "package",
            "status": "visible",
            "gallery": [],
            "bookable": [
                {
                    "id": 35,
                    "quantity": 1,
                    "service": {
                        "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": 24,
                                "name": "Extra 34",
                                "description": "Description of extra",
                                "price": 20,
                                "maxQuantity": 1,
                                "position": 1,
                                "duration": null,
                                "serviceId": null,
                                "aggregatedPrice": false,
                                "translations": "{\"name\":{\"ar\":\"\",\"en_US\":\"\",\"fr_FR\":\"supplémentaire\"},\"description\":{\"ar\":\"\",\"en_US\":\"\",\"fr_FR\":\"description du supplément\",\"arHtml\":\"\",\"en_USHtml\":\"\",\"fr_FRHtml\":\"description du supplément\"}}"
                            },
                            {
                                "id": 17,
                                "name": "Extra 3",
                                "description": "Extra description",
                                "price": 20,
                                "maxQuantity": 1,
                                "position": 1,
                                "duration": 1800,
                                "serviceId": null,
                                "aggregatedPrice": false,
                                "translations": null
                            },
                            {
                                "id": 21,
                                "name": "Extra 37",
                                "description": "Extra description",
                                "price": 20,
                                "maxQuantity": 1,
                                "position": 1,
                                "duration": null,
                                "serviceId": null,
                                "aggregatedPrice": false,
                                "translations": null
                            },
                            {
                                "id": 22,
                                "name": "Extra 37",
                                "description": "Extra description",
                                "price": 20,
                                "maxQuantity": 1,
                                "position": 1,
                                "duration": null,
                                "serviceId": null,
                                "aggregatedPrice": false,
                                "translations": null
                            },
                            {
                                "id": 23,
                                "name": "Extra 39",
                                "description": "Extra description",
                                "price": 20,
                                "maxQuantity": 1,
                                "position": 1,
                                "duration": null,
                                "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\":true},\"razorpay\":{\"enabled\":true},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.7\"},\"general\":{\"minimumTimeRequirementPriorToCanceling\":null}}",
                        "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": 0,
                        "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\"}"
                    },
                    "minimumScheduled": 0,
                    "maximumScheduled": 1,
                    "providers": [],
                    "locations": [],
                    "allowProviderSelection": true
                },
                {
                    "id": 36,
                    "quantity": 1,
                    "service": {
                        "id": 4,
                        "name": "Service 2",
                        "description": "",
                        "color": "#1788FB",
                        "price": 45,
                        "deposit": 20,
                        "depositPayment": "fixed",
                        "depositPerPerson": true,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": 16,
                        "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\"}"
                    },
                    "minimumScheduled": 0,
                    "maximumScheduled": 1,
                    "providers": [],
                    "locations": [],
                    "allowProviderSelection": false
                }
            ],
            "calculatedPrice": true,
            "discount": 0,
            "endDate": null,
            "durationCount": null,
            "durationType": null,
            "translations": null,
            "sharedCapacity": null,
            "quantity": 1,
            "limitPerCustomer": null
        }
    }
}

Update package

Update package details.

Method

This endpoint accepts POST requests.

Path

/packages/{{package_id}}

Optional Properties

Key Type Description
name string The name of the package.
bookable array An array of the services objects in the package. The object has the following properties: “service”, “providers”, “locations”, “quantity”, “minimumScheduled”, “maximumScheduled”, “allowProviderSelection”
price double The price of the package.
description
string The description of the package.
color
string The color of the package. The default values is “#1788FB”.
calculatedPrice
boolean Whether the price of the package is a calculated price of the services. True by default.
discount
double The discount of the package.
gallery
array An array of the pictures for the gallery of the package.
pictureFullPath
string The path for the picture of the package.
pictureThumbPath
string The path for the picture of the package.
position
integer The position of the package, used for sorting. The default value is 1.
settings
string JSON encoded string of the package settings. By default the general settings will be used.
endDate
string The date and time of the expiration date of a package purchase. The format is: “YYYY-MM-DD HH:mm”
durationCount
string The number of days/weeks/months of the expiration of a package purchase
durationType
integer The type of durationCount. Possible values “day”, “week”, “month”.
translations
string JSON encoded string of the package translations.
sharedCapacity
boolean Whether the package has a shared capacity between the services or not. The default values is false.
quantity
integer The quantity of the services in case of sharedCapacity being true.
limitPerCustomer
integer JSON encoded string of the limit per customer package purchases.
descriptionHtml
string The description of the package in HTML
deposit
double The deposit amount.
depositPayment
string The type of the package deposit. Possible values: “disabled”, “fixed”, “percentage”.
fullPayment
boolean Whether the client will have an option to pay for the full amount instead of just the deposit. False by default..
status string The status of the package. Possible values: “visible”, “hidden”, “disabled”. The default value is “visible”.

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages/22' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
    "bookable": [
        {
            "service": {
                "id": 1
            },
            "providers": [],
            "locations": [],
            "quantity": 1,
            "minimumScheduled": 0,
            "maximumScheduled": 1,
            "allowProviderSelection": true
        },
        {
            "service": {
                "id": 4
            },
            "providers": [],
            "locations": [],
            "quantity": 1,
            "minimumScheduled": 0,
            "maximumScheduled": 1,
            "allowProviderSelection": false
        }
    ],
    "color": "#1788FB",
    "description": "Description of package",
    "name": "Amelia 4 Package",
    "pictureFullPath": "",
    "pictureThumbPath": "",
    "price": 55,
    "calculatedPrice": false,
    "discount": 0,
    "status": "visible",
    "gallery": [],
    "position": 9,
    "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}",
    "endDate": null,
    "durationCount": null,
    "durationType": null,
    "deposit": 0,
    "depositPayment": "disabled",
    "translations": null,
    "sharedCapacity": false,
    "quantity": 1,
    "limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}",
    "descriptionHtml": "Description of package"
}'
{
    "message": "Successfully updated package.",
    "data": {
        "package": {
            "id": 22,
            "name": "Amelia 4 Package",
            "description": "Description of package",
            "color": "#1788FB",
            "price": 55,
            "deposit": 0,
            "depositPayment": "disabled",
            "depositPerPerson": null,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "extras": [],
            "coupons": [],
            "position": 9,
            "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}",
            "fullPayment": false,
            "type": "package",
            "status": "visible",
            "gallery": [],
            "bookable": [
                {
                    "id": null,
                    "quantity": 1,
                    "service": {
                        "id": 1,
                        "name": null,
                        "description": null,
                        "color": null,
                        "price": null,
                        "deposit": null,
                        "depositPayment": null,
                        "depositPerPerson": null,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": null,
                        "settings": null,
                        "fullPayment": null,
                        "minCapacity": null,
                        "maxCapacity": null,
                        "duration": null,
                        "timeBefore": null,
                        "timeAfter": null,
                        "bringingAnyone": null,
                        "show": null,
                        "aggregatedPrice": null,
                        "status": null,
                        "categoryId": null,
                        "category": null,
                        "priority": [],
                        "gallery": [],
                        "recurringCycle": null,
                        "recurringSub": null,
                        "recurringPayment": null,
                        "translations": null,
                        "minSelectedExtras": null,
                        "mandatoryExtra": null,
                        "customPricing": null,
                        "maxExtraPeople": null,
                        "limitPerCustomer": null
                    },
                    "minimumScheduled": 0,
                    "maximumScheduled": 1,
                    "providers": [],
                    "locations": [],
                    "allowProviderSelection": true
                },
                {
                    "id": null,
                    "quantity": 1,
                    "service": {
                        "id": 4,
                        "name": null,
                        "description": null,
                        "color": null,
                        "price": null,
                        "deposit": null,
                        "depositPayment": null,
                        "depositPerPerson": null,
                        "pictureFullPath": null,
                        "pictureThumbPath": null,
                        "extras": [],
                        "coupons": [],
                        "position": null,
                        "settings": null,
                        "fullPayment": null,
                        "minCapacity": null,
                        "maxCapacity": null,
                        "duration": null,
                        "timeBefore": null,
                        "timeAfter": null,
                        "bringingAnyone": null,
                        "show": null,
                        "aggregatedPrice": null,
                        "status": null,
                        "categoryId": null,
                        "category": null,
                        "priority": [],
                        "gallery": [],
                        "recurringCycle": null,
                        "recurringSub": null,
                        "recurringPayment": null,
                        "translations": null,
                        "minSelectedExtras": null,
                        "mandatoryExtra": null,
                        "customPricing": null,
                        "maxExtraPeople": null,
                        "limitPerCustomer": null
                    },
                    "minimumScheduled": 0,
                    "maximumScheduled": 1,
                    "providers": [],
                    "locations": [],
                    "allowProviderSelection": false
                }
            ],
            "calculatedPrice": false,
            "discount": 0,
            "endDate": null,
            "durationCount": null,
            "durationType": null,
            "translations": null,
            "sharedCapacity": false,
            "quantity": 1,
            "limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}"
        }
    }
}

Get package delete effect

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

Method

This endpoint accepts GET requests.

Path

/packages/effect/{{package_id}}

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages/effect/22' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved message.",
    "data": {
        "valid": true,
        "message": ""
    }
}

Get packages

Retrieve packages.

Method

This endpoint accepts GET requests.

Path

/packages

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages&page=1&sort=name' 
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved packages.",
    "data": {
        "packages": [
            {
                "id": 9,
                "name": "new pack",
                "description": "",
                "color": "#1788FB",
                "price": 53.89,
                "deposit": 0,
                "depositPayment": "disabled",
                "depositPerPerson": null,
                "pictureFullPath": null,
                "pictureThumbPath": null,
                "extras": [],
                "coupons": [],
                "position": 2,
                "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":false},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}",
                "fullPayment": false,
                "type": "package",
                "status": "visible",
                "gallery": [],
                "bookable": [],
                "calculatedPrice": true,
                "discount": 0,
                "endDate": null,
                "durationCount": null,
                "durationType": null,
                "translations": null,
                "sharedCapacity": false,
                "quantity": 1,
                "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}"
            },
            {
                "id": 14,
                "name": "amelia package",
                "description": "",
                "color": "#1788FB",
                "price": 180,
                "deposit": 0,
                "depositPayment": "disabled",
                "depositPerPerson": null,
                "pictureFullPath": null,
                "pictureThumbPath": null,
                "extras": [],
                "coupons": [],
                "position": 11,
                "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":false,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":true}}}",
                "fullPayment": false,
                "type": "package",
                "status": "visible",
                "gallery": [],
                "bookable": [],
                "calculatedPrice": true,
                "discount": 0,
                "endDate": null,
                "durationCount": null,
                "durationType": null,
                "translations": null,
                "sharedCapacity": false,
                "quantity": 1,
                "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}"
            },
            {
                "id": 22,
                "name": "Amelia 4 Package",
                "description": "Description of package",
                "color": "#1788FB",
                "price": 55,
                "deposit": 0,
                "depositPayment": "disabled",
                "depositPerPerson": null,
                "pictureFullPath": null,
                "pictureThumbPath": null,
                "extras": [],
                "coupons": [],
                "position": 9,
                "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":false},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false}}}",
                "fullPayment": false,
                "type": "package",
                "status": "visible",
                "gallery": [],
                "bookable": [],
                "calculatedPrice": false,
                "discount": 0,
                "endDate": null,
                "durationCount": null,
                "durationType": null,
                "translations": null,
                "sharedCapacity": false,
                "quantity": 1,
                "limitPerCustomer": "{\"enabled\":true,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1}"
            }
        ]
    }
}

Delete package

Delete package.

Method

This endpoint accepts POST requests.

Path

/packages/delete/{{package_id}}

Example

curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/packages/delete/22' 
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully deleted package.",
    "data": []
}