Categories

View as Markdown

Product categories and their safety requirements.

The category object

A product category. Categories form a two-level tree and decide which safety requirements a product must meet.

Attributes

  • idstring

    Unique identifier of the category, prefixed with cat_. Treat it as an opaque string: store it and compare it, never parse it.

  • objectstring

    Names the type of this object. Always category.

  • namestring

    Display name.

  • slugstring

    URL-safe name, unique across categories.

  • descriptionstring or null

    Longer explanation of what belongs here, when provided.

  • parentobject or null

    The top-level category this one belongs to. Null for a top-level category. Products may use either level.

  • complianceCategoryCompliance

    EU/UK product safety (GPSR) requirements for products in this category, with everything inherited from the parent category already applied.

The category object
{
  ,
  ,
  ,
  ,
  ,
  ,
  
}

List product categories

GET/v2/categories

Public: no API key needed.

Credentials
None: the endpoint is public.
For
Designers and Integrators
Operation id
list_categories

Lists every product category as a flat list; each subcategory points at its parent. Public: no credentials needed. Use it to pick a category for a product and to see the safety requirements that come with it.

Query parameters

  • parentstring

    Only return the subcategories of this top-level category.

  • limitinteger

    How many results per page, from 1 to 100.

    Range 1 to 100. Defaults to 20.
  • cursorstring

    Where to continue from: the next_cursor of the previous page. Omit for the first page.

Returns200 OK

A page of categories, in display order.

Responses

  • 200

    A page of categories, in display order.

  • 400

    The request is invalid. details.errors lists each problem (validation_failed), or an expand[] path is unknown (invalid_expand).

  • 429

    Too many requests (rate_limited): the limit is 120 per minute per IP address. Wait for the number of seconds in the Retry-After header, then retry; details has limit, window_seconds, reset_at and retry_after_seconds.

Errors use the error object.

GET/v2/categories
curl "https://public-api.dapi.digital/v2/categories"
Response
{
  "object": "list",
  "data": [
    {
      "id": "cat_bfP0GSqKoZFrD72H5Os0rc7HV9XP6eQJu",
      "object": "category",
      "name": "Action Figures & Dolls",
      "slug": "toys-and-games--action-figures-and-dolls",
      "description": null,
      "parent": {
        "id": "cat_9Qa1GSqKoZFrD72H5Os0rc7HV9XP6eQJu",
        "object": "category",
        "name": "Toys & Games"
      },
      "compliance": {
        "risk_level": "high",
        "ce_marking_required": false,
        "age_restriction": null,
        "safety_warnings_required": true,
        "safety_flags": [
          "choking_hazard",
          "age_restriction"
        ],
        "mandatory_warnings": [
          "Warning. Not suitable for children under 36 months. Small parts. Choking hazard."
        ],
        "required_documents": [
          {
            "key": "material-toxicity-assessment",
            "name": "Material Toxicity Assessment"
          },
          {
            "key": "technical-file-and-risk-assessment",
            "name": "Technical File & Risk Assessment"
          }
        ]
      }
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Get a product category

GET/v2/categories/{id}

Public: no API key needed.

Credentials
None: the endpoint is public.
For
Designers and Integrators
Operation id
get_category

Returns one category with its resolved safety requirements. Public: no credentials needed.

Path parameters

  • idstringRequired

    Unique identifier of the category, prefixed with cat_. Treat it as an opaque string: store it and compare it, never parse it.

Returns200 OK

The category. Returns the category object.

Responses

  • 200

    The category.

  • 404

    No category has this id (category_not_found).

  • 429

    Too many requests (rate_limited): the limit is 120 per minute per IP address. Wait for the number of seconds in the Retry-After header, then retry; details has limit, window_seconds, reset_at and retry_after_seconds.

Errors use the error object.

GET/v2/categories/{id}
curl "https://public-api.dapi.digital/v2/categories/cat_bfP0GSqKoZFrD72H5Os0rc7HV9XP6eQJu"
Response
{
  "id": "cat_bfP0GSqKoZFrD72H5Os0rc7HV9XP6eQJu",
  "object": "category",
  "name": "Action Figures & Dolls",
  "slug": "toys-and-games--action-figures-and-dolls",
  "description": null,
  "parent": {
    "id": "cat_9Qa1GSqKoZFrD72H5Os0rc7HV9XP6eQJu",
    "object": "category",
    "name": "Toys & Games"
  },
  "compliance": {
    "risk_level": "high",
    "ce_marking_required": false,
    "age_restriction": null,
    "safety_warnings_required": true,
    "safety_flags": [
      "choking_hazard",
      "age_restriction"
    ],
    "mandatory_warnings": [
      "Warning. Not suitable for children under 36 months. Small parts. Choking hazard."
    ],
    "required_documents": [
      {
        "key": "material-toxicity-assessment",
        "name": "Material Toxicity Assessment"
      },
      {
        "key": "technical-file-and-risk-assessment",
        "name": "Technical File & Risk Assessment"
      }
    ]
  }
}