Categories

Categories give products and bundles reusable identities for grouping and targeting. Each category has a server-generated category_id, a stable handle, and a renameable display name.

Create a category explicitly with POST /v1/categories, or let a product or bundle write create one from a display name. Flint normalizes an implicit name into a lowercase, hyphenated handle. Values that normalize to the same handle resolve to the same category. If a name cannot produce a handle, supply a valid handle when you create the category.

Use category_handles when a promotion, return reason, or return policy targets categories. The category must already exist. An unknown or deleted handle returns UNKNOWN_CATEGORY_HANDLE. Product and bundle writes accept handles or display names through categories, with handles taking precedence when a value also matches another category's name. Send no more than 100 categories in one write.

GET /v1/categories returns active categories, ordered by handle. The assignment counts show how many products and bundles carry a category. The targeting reference count shows whether a promotion or return configuration still points at it.

Renaming a category changes only its display name. Its handle stays fixed so existing integrations and targeting rules keep working.

Delete permanently removes a category and returns its last snapshot with status=deleted. Delete is available only when the category has no product or bundle assignments and no promotion, return reason, or return policy references. Deleted promotions do not block deletion. Use it to remove a category created by mistake.

Category names and handles can contain at most 100 characters and cannot contain >. Flint reserves that character for future category paths.

The Category object#

Every field on a category, as returned by retrieve and carried by the endpoints below.

Attributes

assigned_bundle_countintegerRequired
assigned_product_countintegerRequired
category_idstringRequired
created_atstringRequired

RFC3339 timestamp.

descriptionstring
external_reference_idstring

Caller-owned identifier for this resource in an external system.

handlestringRequired
merchant_idstring
metadatamap of string
namestringRequired
statusenumRequired
  • active
  • deleted
targeting_reference_countintegerRequired
updated_atstringRequired

RFC3339 timestamp.

JSON
{
  "assigned_bundle_count": 1,
  "assigned_product_count": 2,
  "category_id": "ctg_01J00000000000000000000000",
  "created_at": "2026-03-17T14:30:00Z",
  "handle": "events",
  "merchant_id": "mer_123",
  "metadata": {
    "department": "admissions"
  },
  "name": "Events",
  "status": "active",
  "targeting_reference_count": 0,
  "updated_at": "2026-03-17T14:30:00Z"
}

List categories#

GET/v1/categories

Requires scope commerce.catalog.read or commerce.catalog.write

List categories.

Query parameters

page_sizeinteger

Page size, default 20, max 100.

page_tokenstring

Cursor returned by the previous list response.

external_reference_idstring

Exact-match filter on the caller-owned external reference ID.

querystring

Search across category ID, external reference ID, handle, name, and description. Text fields match any part of the value, and %, _ and \ are ordinary characters, not wildcards. IDs match from the start and need the type prefix, such as ord_01.

Response · 200

dataarray of objectRequired
metaobject
next_page_tokenstring
request_idstring
curl https://api.withflintpay.com/v1/categories \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": [
    {
      "assigned_bundle_count": 1,
      "assigned_product_count": 2,
      "category_id": "ctg_01J00000000000000000000000",
      "created_at": "2026-03-17T14:30:00Z",
      "handle": "events",
      "merchant_id": "mer_123",
      "metadata": {
        "department": "admissions"
      },
      "name": "Events",
      "status": "active",
      "targeting_reference_count": 0,
      "updated_at": "2026-03-17T14:30:00Z"
    }
  ],
  "next_page_token": "Zm9yd2FyZC1vbmx5LW9wYXF1ZS1jdXJzb3I",
  "request_id": "bce56cba-0827-44aa-bb56-4f200ba15ee6"
}

Create category#

POST/v1/categoriesIdempotent

Requires scope commerce.catalog.write

Creates a reusable category. If handle is omitted, Flint derives it from the name and never changes it on rename.

Request body

descriptionstring
external_reference_idstring

Caller-owned identifier for this resource in an external system.

handlestring
metadatamap of string
namestringRequired

Response · 201

dataobjectRequired
metaobject
request_idstring
curl -X POST https://api.withflintpay.com/v1/categories \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "handle": "events",
    "name": "Events"
  }'

Get category#

GET/v1/categories/{category_id}

Requires scope commerce.catalog.read or commerce.catalog.write

Get category.

Path parameters

category_idstringRequired

Flint category ID.

Response · 200

dataobjectRequired
metaobject
request_idstring
curl https://api.withflintpay.com/v1/categories/ctg_01J00000000000000000000000 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": {
    "assigned_bundle_count": 1,
    "assigned_product_count": 2,
    "category_id": "ctg_01J00000000000000000000000",
    "created_at": "2026-03-17T14:30:00Z",
    "handle": "events",
    "merchant_id": "mer_123",
    "metadata": {
      "department": "admissions"
    },
    "name": "Events",
    "status": "active",
    "targeting_reference_count": 0,
    "updated_at": "2026-03-17T14:30:00Z"
  },
  "request_id": "bce56cba-0827-44aa-bb56-4f200ba15ee6"
}

Update category#

PATCH/v1/categories/{category_id}Idempotent

Requires scope commerce.catalog.write

Update category.

Path parameters

category_idstringRequired

Flint category ID.

Request body

descriptionstring
external_reference_idstring

Caller-owned identifier for this resource in an external system.

metadatamap of string or null

Caller-owned metadata. Omit this field to leave metadata unchanged. Send an object to merge by key, set a key to null to remove it, or set metadata to null to clear all metadata. An empty object makes no change. Empty strings are stored. Keys starting with flint_ are reserved and cannot be written through the public API.

namestring

Response · 200

dataobjectRequired
metaobject
request_idstring
curl -X PATCH https://api.withflintpay.com/v1/categories/ctg_01J00000000000000000000000 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{}'

Delete category#

DELETE/v1/categories/{category_id}Idempotent

Requires scope commerce.catalog.write

Permanently deletes an unreferenced category and returns it with status deleted. Deleted categories cannot be retrieved or listed. Remove all product, bundle, promotion, and return configuration references before deleting.

Path parameters

category_idstringRequired

Flint category ID.

Response · 200

dataobjectRequired
metaobject
request_idstring
curl -X DELETE https://api.withflintpay.com/v1/categories/ctg_01J00000000000000000000000 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Was this helpful?