Skip to main content
Version: Thelia 3

API Endpoints Reference

Reference documentation for Thelia's core API endpoints.

Endpoint overview

Admin endpoints (/api/admin/)

Full CRUD operations requiring authentication.

ResourceEndpointOperations
Products/api/admin/productsGET, POST, PUT, PATCH, DELETE
Categories/api/admin/categoriesGET, POST, PUT, PATCH, DELETE
Customers/api/admin/customersGET, POST, PUT, PATCH, DELETE
Orders/api/admin/ordersGET, POST, PUT, PATCH, DELETE
Brands/api/admin/brandsGET, POST, PUT, PATCH, DELETE
Tax Rules/api/admin/tax_rulesGET, POST, PUT, PATCH, DELETE
Features/api/admin/featuresGET, POST, PUT, PATCH, DELETE
Attributes/api/admin/attributesGET, POST, PUT, PATCH, DELETE
Contents/api/admin/contentsGET, POST, PUT, PATCH, DELETE
Folders/api/admin/foldersGET, POST, PUT, PATCH, DELETE
Currencies/api/admin/currenciesGET, POST, PUT, PATCH, DELETE
Countries/api/admin/countriesGET, POST, PUT, PATCH, DELETE
Modules/api/admin/modulesGET, POST, PUT, DELETE

Front endpoints (/api/front/)

Mostly read-only public access. A few operations write data (cart management, account creation, account updates) and several require a customer JWT.

ResourceEndpointOperations
Products/api/front/productsGET (collection, item)
Categories/api/front/categoriesGET (collection, item)
Brands/api/front/brandsGET (collection, item)
Contents/api/front/contentsGET (collection, item)
Feature products/api/front/feature_productsGET (collection, item)
Cart/api/front/cartsPOST, GET (item), PUT, DELETE
Current cart/api/front/cartGET
Customers/api/front/customersPOST
Customer account/api/front/account/customers/{id}GET, PUT
Orders/api/front/account/ordersGET (collection)
Order detail/api/front/account/orders/{id}GET
Countries/api/front/countriesGET (collection, item)
note

The current-cart shortcut /api/front/cart returns the cart bound to the current session through a dedicated controller, so you do not need to know its id. The collection-style /api/front/carts/{id} operations require customer authentication.

caution

Customer and order personal-data routes (/api/front/account/customers/{id}, /api/front/account/orders, /api/front/account/orders/{id}) require a customer JWT and only expose the authenticated customer's own data. The POST /api/front/customers operation is the public account-creation endpoint.

Common patterns

Collection request

GET /api/front/products?visible=true&itemsPerPage=20&page=1
Accept: application/ld+json

Collection response

{
"@context": "/api/contexts/Product",
"@id": "/api/front/products",
"@type": "hydra:Collection",
"hydra:totalItems": 150,
"hydra:member": [
{
"@id": "/api/front/products/1",
"@type": "Product",
"id": 1,
"ref": "PROD-001",
"visible": true,
"i18ns": {
"title": "Product Title",
"description": "..."
}
}
],
"hydra:view": {
"@id": "/api/front/products?page=1",
"hydra:first": "/api/front/products?page=1",
"hydra:last": "/api/front/products?page=8",
"hydra:next": "/api/front/products?page=2"
}
}

Single item request

GET /api/front/products/1
Accept: application/ld+json

Single item response

{
"@context": "/api/contexts/Product",
"@id": "/api/front/products/1",
"@type": "Product",
"id": 1,
"ref": "PROD-001",
"visible": true,
"position": 1,
"createdAt": "2024-01-15T10:30:00+00:00",
"i18ns": {
"title": "Product Title",
"description": "Full product description...",
"chapo": "Short description",
"postscriptum": "Additional notes"
},
"productCategories": [...],
"productSaleElements": [...],
"featureProducts": [...]
}

Create request (admin)

POST /api/admin/products
Content-Type: application/json
Authorization: Bearer {token}

{
"ref": "NEW-PROD-001",
"visible": true,
"taxRule": "/api/admin/tax_rules/1",
"productCategories": [
{
"category": "/api/admin/categories/5",
"defaultCategory": true
}
],
"i18ns": {
"en_US": {
"title": "New Product",
"description": "Product description"
}
}
}

Update request (admin)

PUT /api/admin/products/1
Content-Type: application/json
Authorization: Bearer {token}

{
"visible": false,
"i18ns": {
"en_US": {
"title": "Updated Title"
}
}
}

Delete request (admin)

DELETE /api/admin/products/1
Authorization: Bearer {token}

Error responses

note

Error responses use the Hydra format regardless of the Accept header you send.

400 Bad Request

{
"@context": "/api/contexts/ConstraintViolationList",
"@type": "ConstraintViolationList",
"hydra:title": "An error occurred",
"hydra:description": "ref: This value should not be blank.",
"violations": [
{
"propertyPath": "ref",
"message": "This value should not be blank."
}
]
}

404 Not Found

{
"@context": "/api/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "Not Found"
}

401 Unauthorized

{
"@context": "/api/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "Full authentication is required to access this resource."
}

Available formats

FormatAccept HeaderDescription
JSON-LDapplication/ld+jsonCanonical format, with Hydra metadata (pagination info)
JSONapplication/jsonPlain JSON, enabled by default
HTMLtext/htmlServes the interactive OpenAPI documentation
note

JSON-LD (application/ld+json) is the canonical format Thelia configures for its API and the one used throughout the examples below.

OpenAPI documentation

Thelia's API is documented with OpenAPI. The interactive documentation is available at:

/api/docs

It offers:

  • "Try it out" functionality
  • Complete schema definitions
  • Authentication testing
  • Example requests and responses