Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

34.8 KB
Raw Blame

Custom Fields Roadmap

Status: In Progress — the storefront visibility fix, values in Admin and Store API responses, and dashboard editing for every routed record type are in. A 6.0.x patch protects definition types; everything else is 6.1. Target: Spree 6.0.x (a type change on update is ignored, with a deprecation warning), Spree 6.1 (enforcement, checkout capture, date types, validation, emails and webhooks, translations, cleanup) Depends on: 5.4-6.0-custom-fields-rename.md (implemented), 6.0-store-scoped-custom-field-definitions.md (implemented), 6.0-cart-order-split.md (checkout requirements), 5.5-6.0-resource-translations-api.md (translation writes), 6.0-typed-webhook-events.md, 6.0-liquid-mjml-emails.md Author: Damian Legawiec Last updated: 2026-11-02 Tracking: Linear V-3731 · GitHub spree/spree#14821

Summary

Custom fields let a merchant add a typed, labelled value to a record (a product's "Care instructions", an order's "Delivery date") from the dashboard, without a developer or a deploy. This plan settles what the feature is for, and so what it will and will not grow into. Custom fields are a merchant-facing feature, not a data modelling system: developers who need relations, reusable content types or structured objects add real tables.

Within that scope there are gaps:

  • Admin-only fields leaked through storefront search. This is now fixed.
  • A definition's type can still change under existing values.
  • Shoppers cannot fill a field in at checkout, the request merchants keep raising. A delivery date ends up in untyped cart metadata that the merchant cannot see as a field and the seller who ships the order cannot see at all.
  • There is no date or choice type, and no validation.
  • Values never reach emails, webhooks or translations.
  • Core itself uses custom fields as storage for integration data.

Key Decisions (do not deviate without discussion)

Scope

  • Custom fields stay a merchant-facing feature, not a data modelling system (2026-10-06). The feature serves merchants and staff who cannot change code. Developers extending Spree add columns and tables; coding agents make that cheap, and every model already accepts extension attributes (additional_permitted_attributes). None of the following will be built:

    • reusable structured content types (a merchant-defined schema with its own entries);
    • references from a custom field to other records (product, variant, collection, customer, file);
    • file or asset fields;
    • measurement-unit types (weight, dimension, volume) and money;
    • general "list of any type" fields;
    • per-field permissions beyond storefront read and write;
    • custom-field facets: value lists with product counts in /store/products/filters.

    Each of these drags in referential integrity, permissions, cache invalidation and admin pickers, and each is better served by a real table.

  • A choice type exists, but shopper-facing product attributes stay option types (2026-10-06; revised 2026-11-02). A fixed list of values is needed well beyond products, where option types do not exist: a customer's gender at registration, an order's delivery time slot, a company's industry. So choice (one value, or several) is available on every resource, products included, where an admin-only list such as "Warehouse zone: A/B/C" has no option-type equivalent. What it never becomes is a storefront facet: "Material: Cotton (12), Wool (4)" is option type territory, because option types already carry labels, translations, ordering and facets, and the docs steer any product attribute shoppers browse or filter by to option types.

  • Custom-field filtering stays as shipped in 5.6; facet lists are not added (2026-10-06). Product filtering and sorting by cf_ keys stay supported, on the storefront and in the admin, on both search providers, for searchable and sortable definitions. What this plan does not add is listing a field's values with counts in /store/products/filters. This replaces the "6.0 metafield faceting" item and the "new filterable attributes use custom fields" constraint in 5.4-search-provider.md.

Who stores data in custom fields

  • Custom fields are not where code stores its data, core included (2026-10-06; core's own usage settled 2026-11-02). An extension that needs data ships its own columns or tables, and Spree::Metadata stays the untyped place for integration bookkeeping. Custom fields belong to the merchant. An extension may read them, but it never creates definitions behind the merchant's back.

    Core breaks this rule today, and 6.1 fixes it:

    • payment gateway errors are stored as gateway.processing_errors;
    • external media URLs are stored as external.url;
    • 6.0-payment-gateways-monorepo.md plans for Adyen to keep payment references in custom fields.

    All three move to metadata or a real column. The old definitions stay readable for one release, with a deprecation warning, and an upgrade task copies the values.

Visibility and audiences

  • Admin-only values never reach a storefront surface (6.0, implemented 2026-10-22). That covers reading, filtering, sorting, text search, sort-option labels and search-engine documents. storefront_visible: false means the value cannot affect what a shopper sees, including the order of results.
  • New definitions are hidden from the storefront unless the merchant asks (6.1, 2026-11-02). A new migration changes the storefront_visible column default to false, which is what the dashboard form already sends. This amends decisions.md "storefront_visible boolean (default: true)" for custom field definitions only. Payment and delivery methods keep their default of true, because a method a shopper cannot see is useless, while a field a shopper cannot see is the safe default.
  • Sellers see the order fields shoppers can write, read-only (2026-11-02). On a marketplace, the seller who ships the order needs the delivery date or gift message. Fields that are storefront_writable are shown to sellers on their order view and are copied to each seller's split order. Admin-only order fields stay hidden, as 6.0-seller-order-management.md already says for custom fields in general. Which product fields sellers see and write is owned by 6.0-seller-product-submission.md.
  • Emails carry storefront-visible fields only, staff emails included (2026-11-02). Order emails get forwarded, printed and pasted into support tickets, and core has no separate staff order serializer: store_owner_notification_email uses the same Spree::Emails::OrderSerializer as the customer email. Admin-only fields stay in the dashboard.

Definition types

  • A definition's field_type and resource_type are fixed once it is created (2026-10-06; rollout settled 2026-11-02). Rollout follows the Admin API's deprecate-first rule, which applies since the 6.0.0 release (6.0-beta-release.md):

    • 6.0.x patch: an update that sends a different field_type or resource_type keeps the stored value, logs a deprecation warning and answers as before. Values are protected from that release on.
    • 6.1: the model rejects the change with a validation error, so the API answers 422 with a message naming the field. Both attributes become create-only in request_params. A client that thinks it changed the type learns that it did not.

    The dashboard already disables both pickers when editing. Changing a type means creating a new definition and moving the values deliberately.

Storage and validation

  • Storage stays one text value per field (2026-10-06). New types serialize into the existing value column, so no new value columns are added. Date and date-time values are ISO 8601 strings, which sort correctly as text.
  • Validation rules live in one validations JSON column on the definition and are enforced in Spree::CustomField (6.1, 2026-10-06).
    • Enforcing them in Spree::CustomField covers every write path at once: Admin API, Seller API, nested attributes, set_custom_field and CSV imports.
    • Rules are checked on new writes only: a value that was valid before a rule changed stays readable, and only fails when it is written again.
    • A new kind of rule needs no migration.
    • Rules are never queried in SQL.
  • No regular-expression rules (2026-10-06). Each pattern is a denial-of-service risk on every write (catastrophic backtracking), and failures produce poor error messages. Length and range cover the merchant cases we have seen.
  • required is enforced where a shopper writes the field, and is advisory everywhere else (2026-10-06; mechanism corrected 2026-11-02).
    • A required order field that shoppers can write is a checkout requirement. It is declared in Spree::Checkout::DefaultRequirements, like po_number_required, so the cart's requirements list and the completion gate can never disagree (6.0-cart-order-split.md, "one completion truth"). It is not a carts.complete.validate hook, which would only fail at the end.
    • A required customer field that shoppers can write is checked at registration and on account update (Part 3), because each is a single shopper write that the server can check as a whole.
    • Everywhere else (products, categories, and staff or API writes to customers and orders), required is a dashboard marker plus a client-side check. The Admin API and CSV import accept a blank value. This keeps decisions.md 2026-08-06: a product and its custom fields are written in two steps, so a rule checked on save breaks the importer or leaves records permanently failing it.
    • Accepted trade-off: an API client can save a product without a required value. A product type's required flag and a definition's required rule both stay advisory, and the dashboard marks a field when either says so.
    • Separate mechanism: the seller requirement RequiredCustomFields (6.0-seller-onboarding-requirements.md) is unaffected. It gates seller approval on chosen definitions having values, which is a workflow of its own, and validations.required neither feeds nor replaces it.

Shopper writes

  • Shopper write access is a separate storefront_writable boolean (6.1, 2026-10-06). It sits next to storefront_visible, not merged into a three-state column. It is purely additive, and avoids a second breaking change to definition payloads straight after display_on became storefront_visible.
    • Accepted trade-off: two booleans can express an invalid combination (writable but not visible), so a validation on the definition rejects it.
  • Shoppers write order and customer fields in 6.1 (2026-10-06; customers added 2026-11-02). Order fields are captured at checkout, customer fields at registration and from the shopper's account. The following are deferred:
    • Line-item fields. Engraving-style input per line keeps using line item metadata, which already copies to order lines.
    • Company fields. The Store company endpoint in 6.0-b2b-companies-and-catalogs.md lists "custom fields" but never accepted them. That plan is being revised in the business-to-business storefront work, which makes company self-registration an Enterprise feature.

Design Details

Already in (October 2026)

Storefront visibility. Commits 96f24f1716 and e7c603ecda:

  • Spree::SearchProvider::CustomFieldSchema (app/services) takes an audience:, and for :store reads only storefront-visible definitions.
  • Product.search(query, store, audience:) does the same.
  • Meilisearch index settings always use the storefront schema, and documents carry only storefront-visible values.

Values in API responses. BaseSerializer.expandable_custom_fields adds an opt-in expand=custom_fields. The Store API returns storefront-visible values; the Admin API, with admin: true, returns all of them.

  • It is wired on 24 resources in both APIs, orders and customers included.
  • It is not wired on carts, nor on these registered resources: Exchange, ProductType, Promotion, PurchaseOrder, Refund, StockLevel, StockTransfer, Store and TaxRate (see Part 8).

Dashboard editing (#14939). Every Admin route with the custom_fieldable concern has an editor: 20 resources, products through orders.

Registry. Spree::Company and Spree::PurchaseOrder are registered resources.

Part 1 (6.0.x, then 6.1): definition types are fixed

6.0.x patch

  • Admin::CustomFieldDefinitionsController#update drops field_type and resource_type from the attributes it assigns.
  • When either was sent with a value different from the stored one, it logs a deprecation warning naming the attribute and the 6.1 behavior.
  • The response is unchanged.
  • No migration and no model change, so this is safe in a patch release.

6.1

  • Spree::CustomFieldDefinition validates that field_type and resource_type are unchanged on a persisted record. The error uses a full I18n.t('spree.…') key added to spree/core/config/locales/en.yml.
  • An explicit validation is used rather than attr_readonly, because what attr_readonly does on assignment depends on the host's raise_on_assign_to_attr_readonly setting: it either raises (a 500 response) or silently skips.
  • request_params declares both attributes only: :create, so the update body documents and permits neither. The generated SDK update type and the MCP update tool drop them with it.
  • The controller still checks the raw params, so a client that sends either attribute on update gets the 422 rather than having it silently dropped by params.permit.
  • Every other update path follows the same rule. 6.0-cli-configurator.md reconciles definitions by (resource_type, namespace, key) and patches what differs. A type change there must be reported as an error, never applied.

Part 2 (6.1): hidden from the storefront by default

  • A new migration runs change_column_default :spree_custom_field_definitions, :storefront_visible, from: true, to: false. The shipped rename migration is never edited.
  • Existing definitions keep their stored value.
  • Side effect: definitions that core and extensions create automatically through set_custom_field("ns.key") or ensure_custom_field_definition_exists! become admin-only. That is the intended outcome; Part 8 removes core's own cases anyway.
  • The upgrade guide states the new default for API clients that create definitions without sending storefront_visible.

Part 3 (6.1): shoppers fill in fields

The definition

  • storefront_writable is a boolean, default false.
  • Only order and customer definitions can set it.
  • A writable field must also be storefront-visible.

The cart holds the values until checkout completes

  • Spree::Cart includes Spree::HasCustomFields and accepts order definitions. The cart is the order before completion, so a merchant defines one field, not two.
  • resource_type_must_match_custom_field_definition gets this single, explicit exception.
  • The auto-create paths (set_custom_field("ns.key"), ensure_custom_field_definition_exists!) refuse to run on a cart, because they would create a definition for Spree::Cart.

Copying to the order

  • Carts::Complete#create_draft_order! copies the cart's custom-field rows to the order, in the same step that copies metadata.
  • On a marketplace, Spree::Carts::SplitBySeller copies them to every seller's order, as it does for metadata and po_number. Without that, split orders lose them.

The Store API

  • The shared CART_FIELDS request schema in Store::CartsController gains custom_fields, an array of { key, value }. The write shape mirrors the read shape:

    { "custom_fields": [ { "key": "checkout.delivery_date", "value": "2026-10-12" } ] }
    
  • Keys are looked up, never created. A key resolves only among the store's writable order definitions; an unknown or non-writable key returns 422.

  • Partial writes. A blank value removes the field. Fields the request does not name are left as they are, matching how cart metadata merges.

  • Number values. They arrive as canonical decimal strings; the server never parses a number by locale (decisions.md 2026-10-09).

  • Reading back. The cart serializer gets expandable_custom_fields. The order serializer already has it.

The storefront's list of fields

  • GET /api/v3/store/custom_field_definitions?q[resource_type_eq]=order returns the writable definitions, with their type, label and validation rules. It never returns anything admin-only.
  • As a Store list endpoint, it follows 6.0-typed-filters.md:
    • it declares resource_type as a short-name filter;
    • its integration spec uses filter_parameters_for;
    • it exposes no filter that could reach admin-only definitions.
  • @spree/sdk gets both the endpoint and the cart field through generated types. Because Store MCP tools take their parameters from OpenAPI (6.1-store-mcp-server.md), a shopping agent sees both too.

Required checkout fields

  • Spree::Checkout::DefaultRequirements (spree/core/lib/spree/checkout/default_requirements.rb) emits one requirement per required writable definition the cart has no value for: { step: 'payment', field: '<namespace>.<key>', code: 'custom_field_required', message: }, with the message from a full I18n.t('spree.checkout_requirements.…') key.
  • The payment step is the last step before completion, where storefronts collect order details. A storefront that asks earlier, or skips the payment step for a free order, still reads the requirement from the cart's requirements list.
  • Like po_number_missing?, the requirement is skipped for an order staff key in (keyed_in_by_staff?): the field is shopper input, and an admin draft order must not be blocked on it.

Sellers

  • The seller order serializer exposes the order's storefront_writable fields, read-only.
  • 6.0-seller-order-management.md is amended accordingly.

Customers: registration and account

  • RegisterParams (POST /api/v3/store/customers) and UpdateCustomerParams (PATCH /api/v3/store/customer) in Store::CustomersController gain the same custom_fields array, with the same rules as the cart: keys resolve only among the store's writable customer definitions, never auto-created; a blank value removes the field; fields not named are left alone.

    { "email": "[email protected]", "password": "…", "custom_fields": [ { "key": "profile.gender", "value": "female" } ] }
    
  • A required writable customer field missing from a registration returns 422 before the account is created, and the fields are written in the same transaction as the account, so a failed field never leaves an account behind (custom_fields= otherwise defers until after the first save). An account update cannot blank a required field.

  • The customer serializer already has expandable_custom_fields, so a shopper reads back their own values with expand=custom_fields.

  • The Store definitions endpoint answers q[resource_type_eq]=customer the same way it answers for orders, so a registration form renders from it.

  • Staff and Admin API writes to customers stay unchecked for required, like every other non-shopper path.

Part 4 (6.1): date and choice types

Token Class Stored as Rules Searchable / sortable Dashboard widget
date Spree::CustomFields::Date YYYY-MM-DD min, max yes / yes <StoreDatePicker> (date only)
date_time Spree::CustomFields::DateTime ISO 8601 UTC min, max yes / yes <StoreDatePicker includeTime>
choice Spree::CustomFields::Choice the chosen value, or a JSON array of values when multiple choices (required), multiple yes / single-value only <Select>, or a multi-select <Combobox>

Parsing. Input is parsed with iso8601, never Time.zone.parse. A date-time written without a zone means the store's time zone (see the time-zone rules in the root CLAUDE.md). Every date-time is stored converted to UTC in one fixed format, and cf_ filter values and min/max rules are normalized the same way before comparing, because the text comparison is only correct between strings of the same shape (a bare 2026-10-12 sorts before every 2026-10-12T… value on that day).

Choices. A definition's validations.choices is an ordered list of { value, label }. The stored value is the value, so relabelling a choice changes no stored data, and labels are translated with the definition (Part 7). Removing or renaming a choice's value follows the new-writes-only rule: existing values stay readable and are shown raw until rewritten.

Where the type list is hardcoded. There is no type-registration API yet, so adding the three types touches every place that lists types today:

  • Spree::CustomField::TYPE_TOKENS and the FIELD_TYPE_TOKENS typelize;
  • the engine's custom_fields.types list;
  • SearchCapabilities (searchable? and sortable? on each type class);
  • the dashboard's FIELD_TYPES and SEARCHABLE_FIELD_TYPES in schemas/custom-field-definition.ts.

Filtering and sorting.

  • CustomFieldSchema#filter_predicates_for gains a date branch (eq gt gteq lt lteq present blank) and a choice branch (eq not_eq in present blank), because today every type that is not a number gets the text predicates. A multiple-choice field matches when any of its values matches.
  • CustomFieldFilterable#custom_field_value_condition and #custom_field_value_expression compare dates as text. ISO strings order correctly, so no cast is needed.
  • sort_option_label gets wording for dates; a single choice sorts by its value.
  • Custom-field choices are never added to /store/products/filters facets.
  • The Meilisearch provider filters and sorts dates as strings.
  • cf_ keys stay outside the typed-filters tables, which publish them only as custom_fields: true. Their predicate names (present/blank) therefore stay the existing cf_ vocabulary, not the typed-filters null/not_null.

Other outputs. CSV export reads csv_value; the choice type overrides it to join several values. The Google feed and the GDPR export read the raw value, which is already the ISO string for dates; the choice type's raw value is the stored choice (a JSON array when several), which both must render as the values rather than the array text.

Part 5 (6.1): validation

The definition gets a validations JSON column:

Key Applies to Meaning
required all types The value cannot be blank. Blocks checkout for writable order fields (Part 3). Everywhere else it is a dashboard marker and a client-side check, and the server accepts a blank value.
min / max short_text, long_text (characters); number, date, date_time (value) Inclusive bounds
choices choice Ordered list of { value, label }; at least one, values unique
multiple choice Several values allowed (stored as a JSON array)

Checking

  • Spree::CustomFieldDefinition checks the rules themselves: only keys that apply to the type, min no greater than max, and choices present and unique.
  • Spree::CustomField checks each value against its definition's rules when the value is written.
  • Errors are normal field errors on value, so the dashboards' mapSpreeErrorsToForm shows them inline.
  • Messages use full I18n.t('spree.…') keys.

Exposure

  • Rules appear on the Admin definition serializer, on the Store definitions endpoint (writable fields only) and on the Seller definitions endpoint that 6.0-seller-product-submission.md adds.
  • Every form validates in the browser with the same rules: dashboard, seller panel, seller onboarding and storefront checkout.

Part 6 (6.1): values reach emails and webhooks

Emails

  • A new Spree::Emails::CustomFieldSerializer (a thin subclass of the Store one, as spree/AGENTS.md requires for every record an email serializes) emits key, label, field_type and value.

  • Spree::Emails::OrderSerializer and Spree::Emails::OrderGroupSerializer include the storefront-visible values through it, instead of deleting custom_fields. The group serializer matters because a split marketplace order confirms from the group.

  • Spree::Emails::TemplateData requests the expand.

  • Templates read the values like this:

    {% for field in order.custom_fields %}{{ field.label }}: {{ field.value }}{% endfor %}
    
  • The default order confirmation, order-group confirmation and store-owner notification templates render custom fields when there are any.

  • Stores with a customized template. A store that edited its confirmation keeps its own version, and sees the "updated by Spree" notice (6.0-email-template-editor.md). The release notes must say so.

  • Also update docs/developer/customization/email-variables.mdx and packages/dashboard/src/lib/email-template-variables.ts.

Webhooks

  • Order and customer lifecycle events request expand: ['custom_fields'] through the event serializer parameters in Spree::Publishable, so payloads carry storefront-visible values.
  • Payloads stay on Store serializers (decisions.md 2026-09-29), so admin-only fields stay out of webhooks.
  • The generated @spree/sdk/webhooks types change, and the upgrade guide lists the new payload field.

No event per value change

  • Spree::CustomField publishes no events of its own.
  • A value change touches the owning record, but a touch-only update publishes no update event either, so editing only a custom field sends no webhook. This is accepted for 6.1: integrations read values with the order or customer events they already receive.

Part 7 (6.1): translations

What is translatable

  • Definition label, and each choice's label;
  • short_text, long_text and rich_text values;
  • not number, boolean, json, date, date_time or choice values (a choice stores its value; its label is translated on the definition).

How

  • This follows the shipped resource translations contract (5.5-6.0-resource-translations-api.md), not the embedded translations / label_translations parameters sketched in 5.4-metafield-translations.md, which that contract forbids.
  • Spree::CustomFieldDefinition and Spree::CustomField are added to Spree.translatable_resources with Mobility, and declare a translation_write_permission.
  • Translations are read through the nested translations index and written only through POST /api/v3/admin/translations/batch.
  • Translation tables are named spree_custom_field_definition_translations and spree_custom_field_translations.

Rich text

  • Rich-text values are sanitized text since 6.0-rich-text-descriptions.md, not ActionText.
  • The translation class declares sanitizes_rich_text itself, because Mobility translation records do not inherit the model's callbacks.

5.4-metafield-translations.md keeps its scope and is superseded on mechanism.

Part 8 (6.1): cleanup

Core stops storing data in custom fields

  • Payment gateway errors move from gateway.processing_errors to payment metadata.
  • Media external URLs move from external.url to a column (or metadata, settled in the implementation pull request).
  • An upgrade task copies existing values and deletes the auto-created definitions, which would otherwise sit in every merchant's list.
  • The old readers keep working for one release, with a deprecation warning.
  • 6.0-payment-gateways-monorepo.md is amended: Adyen keeps PSP references in payment metadata.

The registry matches what works

The only source of truth is Spree.custom_fields.enabled_resources (spree/core/lib/spree/core/engine.rb). Three groups don't match it today:

  • Thirteen registered types have no Admin write path: Address, Claim, CreditCard, Exchange, LineItem, NewsletterSubscriber, OptionValue, Payment, PaymentSource, Refund, Return, Fulfillment and StockLevel. Only Ruby can write them, yet the definition picker offers them under "Through the API only". Each gets a custom_fieldable route, or leaves the registry.
  • Nine registered types have no expand=custom_fields (listed under "Already in"). Each gets one, or leaves the registry.
  • Six models include HasCustomFields but are not registered, so no definition can be created for them: Supplier, Channel, Catalog, TaxExemptionCertificate, PaymentSession and PaymentSetupSession. Each gets registered (with a route and an editor), or loses the include.

The Spree::Metafields deprecation shell is removed in 6.1 with the other rename bridges.

Privacy: export and erasure must agree

  • The customer data export adds order and cart custom fields. Today it exports customer fields only, and metadata only for orders.
  • Anonymization destroys their orders' and carts' custom fields too. Today it destroys only the customer's own fields, and blanks order metadata but not order custom fields.
  • Shopper-entered checkout fields (gift messages, recipient names, delivery instructions) are personal data.

Other gaps

  • N+1 queries. expand=custom_fields on every list endpoint (Admin and Store, plus the new cart and webhook expands) passes the N+1 guard. The list specs that include 'a list without N+1 queries' request the expand at least once.
  • Seller onboarding renders each requirement field with its proper widget, instead of a plain text input (packages/seller-dashboard/src/pages/onboarding.tsx).
  • Customer CSV import processes custom_field.* columns. The template offers them, but row_processors/customer.rb ignores them.

Docs

  • The 5.6→6.0 upgrade guide lists a "dropdown" custom field, which does not exist in 6.0: change it to name choice as a 6.1 type, and point shopper-facing product value lists at option types.
  • Move docs/developer/core-concepts/metafields.mdx to custom-fields.mdx, with a redirect in docs/docs.json.

Migration Path

6.0.x patch

  1. Ignore type changes on definition update and log a deprecation warning (Part 1).

6.1

  1. Migration:
    • add storefront_writable (boolean, default false, null: false) and validations (JSON) to spree_custom_field_definitions;
    • change the storefront_visible default to false.
  2. Type immutability: the model validation, create-only request_params, the 422 response, and the configurator rule (Part 1).
  3. The date, date_time and choice types (Part 4).
  4. Validation rules: the definition column, enforcement on the value, Admin, Store and Seller exposure, and every form that edits values (Part 5).
  5. Shopper writes (Part 3): registration and account fields for customers, and checkout capture:
    • custom fields on the cart;
    • copying on completion and on seller split;
    • the Store write and expand;
    • the Store definitions endpoint;
    • the checkout requirement;
    • seller visibility;
    • SDK types and the storefront checkout.
  6. Emails and webhooks (Part 6). Then regenerate types, Zod schemas and the OpenAPI spec.
  7. Translations (Part 7).
  8. Cleanup (Part 8), including the upgrade task for core's own definitions.

No data migration is needed for existing values. Existing definitions get storefront_writable: false and no validation rules, which is exactly how they behave today. Every behavior change ships with a Playwright spec in the admin dashboard, or in the seller panel for seller-facing changes.

Constraints on Current Work

Types you must not add

Do not add a custom field type for any of these:

  • a reference to another record;
  • a file;
  • a measurement unit, or money;
  • a reusable content schema.

Use a column or a table instead, and point the requester to this plan. On products, a value list shoppers browse or filter by is an option type, not a choice field.

Where data belongs

  • Do not store integration or extension data in custom fields, in core or anywhere else. Extensions own their tables, and metadata is for integration bookkeeping.

Reading and writing

  • Any code path that reads custom fields for a shopper reads only storefront_visible: true values. That includes serializers, search, feeds, webhooks and emails. Search code takes an audience and never assumes admin.
  • Never call set_custom_field with a "ns.key" string from a Store or Seller API path, and never on a cart. That form auto-creates a definition. API writes resolve existing definitions, or fail.
  • Do not add field_type or resource_type to any update path: API, import, seeds or configurator.
  • A new type stores its value in the single value text column.

Rules

  • Custom-field rules do not use regular expressions.
  • Required checkout input is declared as a checkout requirement, never as a completion hook alone.

Open Questions

All design questions were settled on 2026-10-06 and 2026-11-02. The items below are deferred, not open:

  • Shopper-writable line-item fields. Waiting on real demand for typed per-line input (engraving, per-item gift notes) that line item metadata does not serve. It also needs a design for limiting a definition to certain products, and for merging fields when cart lines are rebuilt.
  • Shopper-writable company fields. Waiting on the revised business-to-business storefront plans. Company self-registration moves to Enterprise.
  • Server-side required outside checkout. Possible only if products and their custom fields become a single atomic write on every path (Admin API, CSV import, set_custom_field). Until then, see decisions.md 2026-08-06.
  • A type-registration API. Extension types still fall back to their class name. Waiting on an extension that actually needs a type of its own.

References

Custom fields

  • 5.4-6.0-custom-fields-rename.md: rename and deprecation bridges (removed in 6.1)
  • 6.0-store-scoped-custom-field-definitions.md: store-owned definitions, filter_key
  • 6.0-product-types.md: advisory required on product types

Checkout and orders

  • 6.0-cart-order-split.md: one completion truth, checkout requirements
  • 6.0-extendable-validations.md: the completion hooks
  • 6.0-b2b-customer-po-numbers.md: the pattern Part 3 follows (copy at completion, requirement code, seller split)

Sellers

  • 6.0-seller-order-management.md: what sellers see on orders (amended)
  • 6.0-seller-product-submission.md: seller-writable product fields
  • 6.0-seller-onboarding-requirements.md: RequiredCustomFields

Emails and webhooks

  • 6.0-liquid-mjml-emails.md, 6.0-email-template-editor.md: email serializers, variables, customized templates
  • 6.0-typed-webhook-events.md: payloads on Store serializers

APIs

  • 6.0-typed-filters.md: filters on the new Store endpoint
  • 6.1-store-mcp-server.md: shopping agents pick up the cart field
  • 6.0-cli-configurator.md: definitions as code (amended)

Translations

  • 5.5-6.0-resource-translations-api.md: translation writes through the batch endpoint
  • 5.4-metafield-translations.md: translation scope (superseded on mechanism)

Search

  • 5.4-search-provider.md: CustomFieldSchema, Meilisearch (amended)

Other plans touched

  • 6.0-payment-gateways-monorepo.md (amended)
  • 6.0-beta-release.md: deprecate-first rule after 6.0.0

Decisions log

  • decisions.md 2026-08-06 (advisory required), 2026-09-29 (webhook payloads), 2026-10-06 (this plan)

Docs

  • Developer: docs/developer/core-concepts/metafields.mdx
  • User: docs/user/settings/custom-fields.mdx