> ## Documentation Index
> Fetch the complete documentation index at: https://www.twicecommerce.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Settings - Orders

> Set the format and sequence every order reference is built from.

export const viewAccessDefinition = "The view operation: read a record without changing it.";

export const manageAccessDefinition = "The manage operation: update an existing record. Creating and deleting are separate operations.";

export const deleteAccessDefinition = "The delete operation: remove a record. Most areas archive instead of deleting.";

export const createAccessDefinition = "The create operation: add a new record. Updating an existing one is the manage operation.";

<Frame caption="Settings > Operations > Orders">
  <img src="https://mintcdn.com/twicecommerce/-H8IY0yinSxV8WqR/images/settings-order-numbering.webp?fit=max&auto=format&n=-H8IY0yinSxV8WqR&q=85&s=5fb50a2799011912ad5384a96808af78" alt="Order numbering card with a custom format configured and the next order reference previewed" width="1920" height="1080" data-path="images/settings-order-numbering.webp" />
</Frame>

<Info>
  This view can look different dependent on your user role. <br />See [Visibility & Permissions](#visibility-and-permissions) for details.
</Info>

## Primary Purpose

Orders sits under **Operations** in Settings and holds one card: **Order numbering**. It sets the account-wide format and sequence that every order reference is built from. Individual [locations](/docs/settings/locations) can override either half.

Each order carries two values. The **number** is the raw sequence value — `1042`. The **reference** is what the number is rendered as — `#1042`, `S-001042`, or whatever your format produces — and it is the value shown in the admin, on emails and documents, and in the customer portal. Both are allocated when the order leaves `pending`, so an abandoned checkout never consumes a number.

<AccordionGroup>
  <Accordion title="Custom format">
    Off by default, which numbers orders `#1`, `#2`, `#3`. Turn it on to build the reference yourself from a prefix, a suffix, and a minimum number length.

    A custom format with **every field left empty is not "no format"** — it produces the bare number (`42`), and that is how you drop the `#` entirely.
  </Accordion>

  <Accordion title="Format fields">
    | Field                     | Rule                                                                                                                |
    | :------------------------ | :------------------------------------------------------------------------------------------------------------------ |
    | **Prefix**                | Up to 16 characters, placed before the number — for example `S-`                                                    |
    | **Suffix**                | Up to 16 characters, placed after the number — for example `-Z`                                                     |
    | **Minimum number length** | 0–20. Numbers shorter than this are padded up to it. Longer numbers are never shortened. Leave empty for no padding |
    | **Padding character**     | One character, used to pad. Defaults to `0` when a minimum length is set and this is left empty                     |

    Prefix, suffix, and padding are capped so that the longest reference a format can produce still fits the **Order reference** field on the [customer portal](/docs/concepts/orders/subscription-portal) recovery form — a reference a customer cannot type back in would lock them out of their own order.
  </Accordion>

  <Accordion title="Next value">
    The number the next order receives, unless its location draws from its own sequence. Allocation hands out this value and then increments.

    Editing it restarts numbering from that point. This is a deliberate operation — usually paired with a new prefix, for example a yearly `2026-` reset — and it re-issues numbers that existing orders may already carry, so change it only when you mean to. The form sends this value only when you actually edited it, so saving a prefix change never rewinds a counter that moved while the page was open.
  </Accordion>

  <Accordion title="Next order preview">
    Below the fields, **Next order** renders the reference your current settings produce for the next value. It uses the same formatting the server uses when allocating, so the preview and the real reference cannot drift.
  </Accordion>
</AccordionGroup>

### Worked examples

| Custom format | Prefix    | Minimum number length | Padding character | Number `42` renders as |
| :------------ | :-------- | :-------------------- | :---------------- | :--------------------- |
| Off           | —         | —                     | —                 | `#42`                  |
| On            | *(empty)* | *(empty)*             | *(empty)*         | `42`                   |
| On            | `S-`      | `6`                   | `0`               | `S-000042`             |
| On            | `2026-`   | `4`                   | `0`               | `2026-0042`            |

<Note>
  Order numbering is separate from document numbering. Receipt and invoice numbers draw their own sequences and render bare — a format set here never reaches them. See [Documents](/docs/settings/documents).
</Note>

## Related Concepts

<CardGroup cols={2}>
  <Card title="Locations" href="/docs/settings/locations">
    Give a location its own prefix, its own sequence, or both
  </Card>

  <Card title="Emails" href="/docs/settings/emails">
    Render the reference in email and document templates with `{{reference}}`
  </Card>

  <Card title="Order Lifecycle" href="/docs/concepts/orders/order-lifecycle">
    When an order leaves `pending` and earns its number
  </Card>

  <Card title="Orders" href="/docs/orders/overview">
    The Reference column in the Orders table
  </Card>
</CardGroup>

## Visibility and Permissions

This page is gated by `account_settings:orders`, in the four operations — <Tooltip tip={viewAccessDefinition}>view</Tooltip>, <Tooltip tip={createAccessDefinition}>create</Tooltip>, <Tooltip tip={manageAccessDefinition}>manage</Tooltip> and <Tooltip tip={deleteAccessDefinition}>delete</Tooltip>.

Owner and Admin hold every operation. Manager and Member do not hold it at all.

For what each operation means and the full role matrix, see [Users & Roles](/docs/settings/users-roles).
