Create a blog category
Authorizations
A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.
Headers
A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.
Body
A navigation label posts are filed under. Creating one publishes nothing to a reader on its own: an empty category is invisible on the storefront, which is why this write is safe where a post create is deliberately draft-only. IT COLLIDES RATHER THAN DUPLICATING outside the idempotency window. blog_category is UNIQUE (store_id, slug), so a create retried after the window answers 409 slug_taken instead of minting a second row. Reconcile by listing, not by re-posting. The body refuses posts, post_ids and post_count by name: a post names its category and not the other way round, so file a post with category_id on PATCH /blog-posts/{postId}. It also refuses status, published and published_at, because a category has no publish state at all; what a reader sees is the published posts filed under it.
Required. NORMALISED server-side to lowercase letters, digits and single hyphens, so the stored value may differ from what you sent; read it back from the response rather than assuming. Unique per store.
Required. Trimmed, and a blank name is a 400.
Optional. Null and absent mean the same thing here, since there is nothing stored to leave alone.
Optional, defaults to 0, which is what every category has until a merchant orders them. It is the storefront widget's display ordering and NOT the order the list pages in: that is (created_at, id), because this field is rewritten by the patch and a walk over it would drop or repeat a row mid-sync. Sort on it client-side.
Response
Created
