Categories

The categories endpoints allow you to navigate through the hierarchical structure of categories and their subcategories. You can list all categories, get subcategories for a specific category, or retrieve detailed information about a specific subcategory.

The category model

The category model represents the top-level categories in the system.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the category.

  • Name
    name
    Type
    string
    Description

    The name of the category.

  • Name
    slug
    Type
    string
    Description

    URL-friendly version of the category name.

  • Name
    subcategories
    Type
    array
    Description

    List of subcategories belonging to this category.

The subcategory model

The subcategory model provides more detailed information about specific subcategories.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the subcategory.

  • Name
    category_id
    Type
    string
    Description

    ID of the parent category this subcategory belongs to.

  • Name
    name
    Type
    string
    Description

    The name of the subcategory.

  • Name
    requires_images
    Type
    boolean
    Description

    Indicates whether images are required for this subcategory.

  • Name
    subcategories_config_key
    Type
    string
    Description

    Configuration key for the subcategory.

  • Name
    fields
    Type
    array
    Description

    Array of fields specific to this subcategory.

GET/api/categories

List all categories

Retrieve a paginated list of all available categories with their basic information. By default, the endpoint returns 10 items per page.

Query Parameters

  • Name
    page
    Type
    integer
    Description

    The page number to retrieve. Defaults to 1.

  • Name
    per_page
    Type
    integer
    Description

    Number of items per page. Defaults to 10, maximum 100.

Request

GET
/api/categories
curl https://app.offerteadviseur.nl/api/categories \
  -H "Authorization: Bearer eyJ..." \
  -H "Accept: application/json" \
  -G \
  -d page=1 \
  -d per_page=10

Response

{
  "data": [
    {
      "id": "1",
      "name": "Zonnepanelen",
      "slug": "zonnepanelen",
      "subcategories": [
        // ...
      ]
    },
    // ...
  ],
  "links": {
    // ...
  },
  "meta": {
    // ...
  }
}
GET/api/categories/:id/subcategories/:subcategory_id

Get subcategory details

Get detailed information about a specific subcategory within a category, including its fields and configuration.

Request

GET
/api/categories/1/subcategories/1
curl https://app.offerteadviseur.nl/api/categories/1/subcategories/1 \
  -H "Authorization: Bearer eyJ..." \
  -H "Accept: application/json"

Response

{
  "data": {
    "id": "1",
    "category_id": "1",
    "name": "Zonnepanelen Kopen",
    "requires_images": false,
    "subcategories_config_key": "solar_panels_consumer",
    "fields": [
      // ...
    ]
  }
}

Was this page helpful?