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 and be active. An unknown or archived 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 by default, ordered by handle. Pass status=archived to list archived categories. 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. Archive removes a category from active pickers but preserves product and bundle membership. Flint blocks archive while live targeting references exist.

Delete is available only when assignment and targeting counts are all zero. Use it to remove a category created by mistake. Both archive and delete return the category resource.

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
activearchiveddeleted
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/categoriesRequires scope: commerce.catalog.read or commerce.catalog.write

List categories.

Query parameters
statusenum

Filter by category status.

activearchived
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.

Response · 200
dataarray of objectrequired
metaobject
next_page_tokenstring
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_CATEGORY_STATUSINVALID_PAGE_SIZEINVALID_PAGE_TOKENINVALID_REQUESTRATE_LIMIT_EXCEEDEDUNSUPPORTED_QUERY_PARAM
Bash
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/categoriesIdempotentRequires 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

Error codes

AUTH_REQUIREDCATEGORY_HANDLE_EXISTSIDEMPOTENCY_CLEAR_FAILEDIDEMPOTENCY_KEY_IN_PROGRESSIDEMPOTENCY_KEY_REUSEDIDEMPOTENCY_LOAD_FAILEDIDEMPOTENCY_PERSIST_FAILEDIDEMPOTENCY_RECOVERY_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_CATEGORY_DESCRIPTIONINVALID_CATEGORY_HANDLEINVALID_CATEGORY_NAMEINVALID_IDEMPOTENCY_KEYINVALID_METADATAINVALID_REQUESTNULL_NOT_ALLOWEDRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
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

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
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}IdempotentRequires 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

Error codes

AUTH_REQUIREDCATEGORY_MODIFIEDIDEMPOTENCY_CLEAR_FAILEDIDEMPOTENCY_KEY_IN_PROGRESSIDEMPOTENCY_KEY_REUSEDIDEMPOTENCY_LOAD_FAILEDIDEMPOTENCY_PERSIST_FAILEDIDEMPOTENCY_RECOVERY_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_CATEGORY_DESCRIPTIONINVALID_CATEGORY_NAMEINVALID_IDEMPOTENCY_KEYINVALID_METADATAINVALID_REQUESTNO_FIELDS_TO_UPDATENULL_NOT_ALLOWEDRATE_LIMIT_EXCEEDEDRESOURCE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
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}IdempotentRequires 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

Error codes

AUTH_REQUIREDCATEGORY_REFERENCEDIDEMPOTENCY_CLEAR_FAILEDIDEMPOTENCY_KEY_IN_PROGRESSIDEMPOTENCY_KEY_REUSEDIDEMPOTENCY_LOAD_FAILEDIDEMPOTENCY_PERSIST_FAILEDIDEMPOTENCY_RECOVERY_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_IDEMPOTENCY_KEYINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X DELETE https://api.withflintpay.com/v1/categories/ctg_01J00000000000000000000000 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
Rate this doc