Skip to content
View Markdown

Loading documentation…

Categories

Organize ticket products into groups with shared registration questions.

Read categories

GET /{event_id}/categories/index.json returns an array of Category wrappers with CategoryField question definitions. Categories are ordered by Category.order. Use category and question UUIDs as keys. Product records use category_id to identify their group.

[{"Category":{"id":"55555555-5555-4555-8555-555555555555","name":"Tickets","order":0,"hide":0},"CategoryField":[]}]

Create a category

POST /{event_id}/categories/add.json with {"Category":{"name":"Workshops"}}. Names must contain 2–100 characters. The server assigns the event, ID and next ordering position.

Creation uses a legacy HTTP 302 redirect to the category list. Its JSON body can contain {"error":"invalid_request"} even after a successful save. Keep redirect following disabled and read categories/index.json again to find and confirm the new category. Validation failures return HTTP 400 with ok:false and validation_errors. Read before retrying an uncertain creation to avoid duplicate groups.

You can also create a category while creating a product using Product.category_new.

Update and hide

Method and path after the event UUID Behavior
PUT /categories/edit/{category_id}.json Submit {"Category":{"name":"Tickets","order":0}}. Name is required; only name/order are writable. Require ok:true.
POST /categories/showhide/{category_id}.json Toggle visibility; returns the resulting hidden boolean. A repeated request toggles it again.

The route ID and event are authoritative. Missing or foreign categories return HTTP 404. Refresh the list after changes. Product positioning across groups uses the complete product ordering map.

Delete a category

POST /{event_id}/categories/delete/{category_id}.json deletes an unused category. The last category and categories containing products are protected with HTTP 409. Require ok:true and refresh the list. Category questions are related records; review them before removing a group.

Manage category questions

Use the category questions guide to read, create, edit, remove and reorder definitions. Updating the current definition and refreshing previously purchased ticket snapshots are separate actions.