Skip to main content
Attributes settings in the admin

Settings > Attributes & Tags

Definition

Attributes are the configurable column system underlying every table and detail view in TWICE. Whatever your business needs to track that isn’t in the core data model — condition grade, serial number, warranty start date, custom delivery instructions — you express as Attributes.
The analogy: Attributes behave like custom columns in a spreadsheet — you define them once and they appear in tables, forms, filters, and exports.

Where Attributes apply

Every Attribute is scoped to exactly one resource: You cannot reuse the same Attribute across resources — if you need similar fields on both Customers and Orders, you define them separately. This keeps each resource’s schema clean and avoids cross-resource leakage. Inventory Attributes can have one of two origins:
  • sku — the attribute is defined at the SKU level and inherited by every Stock Item under that SKU
  • article — the attribute is defined at the Stock Item level only (Stock Items are also called Articles internally)
This split lets you express “Brand” once on the SKU and “Serial number” individually per Stock Item, without duplicating fields.

Attribute formats

TWICE supports nine Attribute formats: Format also decides where an Attribute can be collected. A listing’s checkout field of type Customer attribute and the checkout’s own Contact step both accept text, number, boolean, date, datetime and select. The other three, multiselect, formula and smart_field, render no input at checkout and are left out of both pickers. There is no separate currency, percent, email, url, phone, file, relation, or external format — use number for currency and percent values, text for emails and URLs, and Documents for file attachments. A text Attribute can constrain what it accepts with input masks, which describe a fixed shape such as a card or licence number. Masks do not express open-ended formats like email addresses.

Select and Multiselect options

Each option in a select or multiselect Attribute is a { key, label } pair:
The key is the immutable identifier stored on records. The label is what users see and can be edited freely without breaking historical data. Both have a 255-character cap.

Formula attributes

Formula Attributes compute their value from other fields on the same resource. Each resource exposes a different set of system fields formulas can reference: A typical formula uses these system fields plus other Attributes — for example, a Stock Item formula item_income - item_costs yields the running profit. The formula re-evaluates whenever its inputs change. Read more: Formulas

Smart field attributes

A smart field is worked out like a formula, from somewhere else. It reads one value already on the record, or calls your own API through a connector and stores what comes back. Set its Output type to Text, Number, Yes / No or Date. The field is stored, filtered, sorted and grouped as that type, and the type is fixed once any record holds a value for the field. A format cannot be changed to or from Smart field either, so both changes mean a new Attribute. Read more: Smart fields

Input masks

A text Attribute can carry input masks — template strings describing the exact shape a value may take, such as 123456 #### ######[#] for a member card number. A value that matches none of the Attribute’s masks is rejected. Each mask drives three things at once: the validation rule the server applies, the placeholder the customer sees, and the formatting the input applies as they type. They are derived from the same mask, so they cannot disagree. Masks apply to the text format only. You edit them in the attribute drawer under Settings → Attributes & Tags, where the section is labelled Accepted formats and Read how formats work opens the syntax reference. Each row shows a filled example and the accepted value length, so an off-by-one in an optional block is visible before you save.
Attribute drawer with a mask entered, showing its filled example and accepted value length

Settings > Attributes & tags — the Accepted formats editor

Mask syntax

Everything in a mask is fixed text unless it is one of these symbols: Fixed text is matched and rendered exactly as you typed it, spaces and dashes included. 123456 #### is six fixed digits, a space, then four digit positions — the leading digits are never read as positions to fill. The editor enforces a few more rules:
  • {…} lists its members literally. There are no ranges: {1-3} accepts 1, -, or 3, not 1 through 3. Membership is case-exact, so {AB} rejects a.
  • A mask may contain at most one optional block, and it must sit at the end.
  • A mask needs at least one input position — #, @, *, or {…}.
  • A character set cannot be empty, nested, or repeat a character.
How formats work dialog listing the mask symbols and worked examples

Read how formats work — the in-app syntax reference

Worked examples, with the value length the editor reports next to each mask: The length counts the value the way you read it off the card — fixed characters included, separators excluded — not the number of characters the customer types.

Multiple accepted formats

An Attribute can accept several shapes. Add one mask per shape, up to 10 masks, each at most 100 characters. The masks in a list must be tellable apart by their fixed starts, compared with separators removed. TWICE rejects a list where one mask’s fixed start is a prefix of another’s: 123456 #### and 998877 #### are fine, @@@-### and @@@### are not, since neither has a fixed start to distinguish it. The error names the two masks that clash. How the field behaves depends on how many masks the Attribute has: A value that matches no mask is left as free text while the customer types, rather than being coerced into the nearest shape, and is rejected on submit.

Where masks are enforced

Masks never make a field required. An empty value always passes — presence is controlled separately by the field’s Required setting.
  • Storefront checkout — attribute-backed fields on the Contact step and the Additional details step format as the customer types, fill in the fixed start, and normalise a value pasted without its separators. A malformed value blocks the step.
  • Admin — the same masked input applies wherever staff enter attribute values, including the customer drawer and the checkout fields on a new order.
  • API and server — every write of a text attribute value is validated. The response is a 400 naming the Attribute and a filled example of each accepted mask: Member card: must match the format 123456 1234 567890. At checkout confirmation the server re-checks contact attributes and reports malformed values separately from missing required ones.
Values are matched in their display form, fixed characters included. Send "123456 1140 411905", not "1234561140411905" — the storefront input normalises pasted values, the API does not.
Storefront checkout Contact step with a masked Member card field showing the fixed start filled in and typed digits formatted

A masked attribute field at checkout, part-way through entry

Changing masks

  • Masks belong to the text format. Changing an Attribute’s format to anything else clears them.
  • Adding or editing a mask validates values written from then on. Values already stored are left untouched and are not re-checked.
  • Removing every mask leaves the field unconstrained again.

Key properties

An Attribute definition carries: System groups are reserved categories — system for customer — that hold attributes TWICE manages on your behalf.

How a key is stored

A stored key contains lowercase letters, digits, _ and -, and nothing else. TWICE Commerce corrects what you type instead of rejecting it: the Attribute key field in the add/edit Attribute panel rewrites your input as you type, so the field always shows the value that will be stored. Its helper text says the same — “Lowercase letters, numbers, - and _. Anything else is converted automatically.” The correction runs in this order:
  1. Uppercase letters are lowercased.
  2. Spaces become _.
  3. Every remaining character outside a-z, 0-9, _ and - is dropped.
  4. A leading attributes_ is stripped.
Leave the key empty, or type something that leaves nothing usable, and TWICE Commerce derives the key from the Attribute’s name by the same rules. A derived key that is already taken picks up a numeric suffix — condition, then condition_1, condition_2. A key you typed yourself is never renamed for you. If it collides with an Attribute that already exists, the save fails with Attribute key "condition" is already in use. and you choose another one. Renaming a key later goes through the same correction. A rename that leaves nothing usable is treated as no rename at all: the stored key stays as it was rather than being blanked.
The API accepts any string as key and corrects it on write, so the value you read back can differ from the value you posted — POST a key of list-CutStyle and the Attribute is created with list-cutstyle. Take the stored key from the response rather than assuming the value you sent.

Inheritance: SKU > Stock Item

For inventory Attributes specifically:
  • An attribute with origin: sku is defined on the SKU and read on each Stock Item that rolls up to that SKU
  • An attribute with origin: article is defined directly on the Stock Item and not shared with siblings
  • Editing a SKU-origin attribute on one Stock Item is not allowed — you edit it on the SKU and the change propagates
This means a SKU’s attributes act as the “template” for its Stock Items, and each Stock Item only stores the values that vary unit-to-unit (serial number, condition, location, purchase date).

Order attributes

Attributes scoped to orders attach custom data to individual orders rather than to inventory, catalog, or customer records. Common examples: cost centre, gift message, PO number, or special delivery instructions.

Checkout capture

Add an attribute field to your checkout contact form and bind it to an attribute. At checkout, the system routes the captured value by the attribute’s resource:
  • orders — saved to the order’s attribute values
  • customers — saved to the customer profile
This means the same checkout form can collect both order-specific and customer-profile data in one step.

Confirmation email

Captured order attribute values render automatically in the order confirmation email:
  • Global order attributes always appear — with a dash (—) placeholder when no value was captured
  • Non-global order attributes appear only when a value exists
Values are formatted per your tenant locale: dates use your configured date format, select attributes show the option label, booleans render as Yes/No, and multiselect values are comma-separated.

Admin

Order attribute values appear on the order detail page under a dedicated attributes card. You can add, edit, and remove values directly. Order attributes also surface as filterable, sortable columns in the orders table. Once an Attribute exists, it surfaces automatically in the table for its resource: Search is full-text and runs against all string-castable Attribute values — so the toolbar search finds matches even in hidden columns.

API access

Attributes appear on every API response for the resource they apply to. They’re keyed by id and surfaced as a typed value record. A typical inventory response includes:
Values for select Attributes are the option’s key, not the user-facing label.

Lifecycle

Creating

  1. Open Settings → Attributes & Tags
  2. Pick the resource the Attribute applies to (Inventory, Catalog, Customer, Order)
  3. Set name, description, and format
  4. For select / multiselect, define the option list
  5. For text, optionally add one or more accepted formats — see Input masks
  6. For formula, write the expression and pick the result format
  7. For smart_field, pick the source, define the request, and set the output type
  8. Optionally assign to a Group and a sort order

Updating

  • Name, description, sort order, and group can change freely
  • Adding more options to a select/multiselect is safe
  • Renaming option labels is safe — the underlying key is what’s stored
  • Removing an option breaks any record that referenced it — TWICE warns before allowing this
  • Adding or editing an input mask applies to values written from then on; values already stored are not re-checked
  • Changing format is restricted because conversion may lose data; the safer pattern is to create a new Attribute and migrate values. Moving a text Attribute to another format clears its input masks
  • A format cannot change to or from smart_field at all, and a smart field’s output type is fixed once any record holds a value for it

Archiving and deletion

  • Archiving hides the Attribute from new entry but preserves historical values
  • Deletion removes the Attribute definition and all stored values for it across every record; this can’t be undone
  • Use archive in nearly all cases; reserve delete for cleanup of mistakenly-created Attributes

Relationships

FAQs

No — each Attribute is scoped to one resource. Create matching Attributes on each resource if you need parallel fields.
SKU-origin attributes are defined once on the SKU and read on every Stock Item under it (think: Brand). Stock Item-origin attributes are unique to a single physical unit (think: Serial number). Choose origin based on whether the value varies unit-to-unit.
Adding options is safe. Renaming an option’s user-facing label is safe — the underlying key stays put. Deleting an option breaks any record that referenced it, so TWICE warns before allowing this.
Yes — give it one or more input masks. A mask describes a fixed shape (123456 #### ######[#]), and a value has to match one of the masks the Attribute carries. Masks fit identifiers such as card, licence, or membership numbers; they do not express open-ended formats like email addresses.
Formulas re-evaluate whenever their input fields change — no manual refresh needed. The result is read-only.
A formula computes from other fields on the same record, inside TWICE Commerce. A smart field reads a value from elsewhere: data on the order, the customer, or the units sold together, or a reply from your own API through a connector.
By default no. Whether an Attribute appears on the storefront depends on your storefront theme configuration — themes opt in to which Attributes they render on Listing pages.
Yes. Select rows in any table and choose Edit — the button counts your selection, so it reads Edit (3) for three rows — then set new values for any visible attribute column.

Developer Reference

Attributes are exposed as attributes in the API.

API: Attributes

Open the endpoint in the API reference.

Attribute Groups

Group related Attributes for cleaner forms

Formulas

Write expressions for calculated Attributes

Smart fields

Values read from order data or fetched from your own API

Category Taxonomy

Categories suggest attributes — they work together

Tables

Where Attributes surface as filterable columns