# Cases (help requests)

A signed-in shopper's help requests: list, read, open one about an order, and write in it.

A case is a help request between a signed-in shopper and the store: it has a number in the store (`reference`, such as C-1042), a `status` and messages. The shopper opens one about an order ("Get help with this order") or not, writes in it, and reads the store's answers. The same cases reach the store's Inbox, and the store's emails about them quote the number.

## Who the shopper is

Cases belong to the signed-in customer of the shopper session: the storefront's own cookie on the store's pages, or a headless site's signed-in shopper session (`Tringify-Shop-Session`, with a storefront or server key of the headless storefront that started it; see Customer accounts). A guest gets `401 STOREFRONT_CUST_SIGN_IN_REQUIRED`. A shopper sees only their own cases in this store; another store's or another customer's case number answers `404 SHOP_API_NOT_FOUND`. Writes take `Content-Type: application/json` only, and with the cookie only from the store's own pages.

## Endpoints

| Request | Does |
| --- | --- |
| `GET /cases?page=` | The shopper's cases, 20 a page, most recently updated first: `cases` [{`number`, `reference`, `status`, `subject`, `preview`, `order_number`, `orders` [{`id`, `number`}], `created_at`, `updated_at`, `created_at_display`, `updated_at_display`}], `total`, `page`, `pages`. The `_at` fields are ISO 8601 in the store's timezone; each `_display` is the same moment as text in the request's `language` and the date style of its `country` (the storefront's own when absent), with the time zone named, such as "5 Dec 2026, 9:12 pm IST". |
| `GET /cases/{number}` | One case (`C-1042` or `1042`) with `messages` [{`id`, `author_kind`, `author_name`, `body`, `created_at`, `created_at_display`}], oldest first, at most the latest 200. `author_kind` is `shopper`, `staff` or `assistant`; staff are named by first name. The store's internal notes and system messages are never included. |
| `POST /cases` | Body `{order_id, subject, body}`: opens a case (201) and returns it like `GET /cases/{number}`. `order_id` is optional and must be one of the shopper's orders (`404 SHOP_API_NOT_FOUND` otherwise). A case about the same order that is not solved gets the message instead (200). `body` is required, up to 5,000 characters (`STOREFRONT_CONTACT_MESSAGE_REQUIRED`, `STOREFRONT_CONTACT_MESSAGE_TOO_LONG`); a shopper can open 10 cases a day (`429 STOREFRONT_CONTACT_RATE_LIMITED`). |
| `POST /cases/{number}/messages` | Body `{body}`: adds the shopper's message and returns the case. A waiting or solved case goes back to `open`. |

## Statuses

| Status | Means |
| --- | --- |
| `open` | The store is on it. |
| `waiting_on_customer` | The store answered and waits for the shopper. Seven days without a reply solve it. |
| `solved` | Closed. A new message from the shopper opens it again. |

Statuses are values; word them in your own translations. Themes get the same cases in `customer.cases` and `customer.case` on the account page (/account/cases and /account/cases/{number}) and post replies to `customer.case.reply_url`.

