Skip to main content

Overview

An Order Template is the blueprint for a kind of order. It fixes the order’s type (sale, purchase, transfer, invoice, return, …) and defines its rules: the workflow an order follows, which contacts and products are allowed on it, how its title and slug are generated, and which taxonomies it can carry. Every order is created from one. For the order types and their inventory effects, see the Commerce overview.

Where to find it

Order templates live under Commerce → Order Templates.

Properties

PropertyTypeRequiredDescription
titlestringYesDisplay name of the template.
slugstringYesIdentifier.
typeenumYesThe order type this template creates.
descriptionstringNoOptional description.
inventory_effectenumConditionalinbound or outbound — required for inventory-adjustment templates.
workflows_configobjectNoThe order’s workflow steps.
contact_profilesarrayNoWhitelist of contact profiles allowed on the order.
allowed_product_templatesarrayNoWhitelist of product templates allowed on line items.
allowed_child_templatesarrayNoWhitelist of child order templates that can be created from an order.
default_child_templatesarrayNoChild templates suggested by default on a new order.
default_price_list_slugstringNoThe price list orders use for line-item prices by default.
naming_conventionobjectNoThe pattern for auto-naming orders.
taxonomies_idsarrayNoThe taxonomies an order may use (allow-list).
default_taxonomies_idsarrayNoTaxonomies applied to every new order of this template.

Workflow

A template can wire two workflow steps: the initial step a new order starts on, and the completed step an order must reach to be marked completed.

Whitelists

Opt-in lists keep an order’s contents in bounds — leave one empty for no restriction:
  • Contact profiles — only contacts in these profiles can be set on the order.
  • Allowed product templates — only these product templates can appear on line items.
  • Allowed child templates — which child order templates can be created from an order (a default subset is suggested on each new order).

Naming convention

New orders get their title and slug generated automatically from the template’s naming convention — a sequence of segments:
SegmentRenders
LiteralFixed text.
DateThe current date (year, month, or day) in the commerce timezone.
CounterAn incrementing number, zero-padded to a minimum width.
ValueA property or attribute from the template, order, contact, organization, user, or location.
The counter resets based on the date parts in the pattern — daily if it includes the day, monthly the month, yearly the year, or never (one running counter) if there’s no date. The default pattern is {template title} - {year} - {month} - {counter}.
The timezone used for dates and counter resets is set at Settings → Commerce → Naming timezone.

Taxonomies

taxonomies_ids is the allow-list of taxonomies an order may carry; default_taxonomies_ids is the subset applied to every new order (always within the allow-list).

Line-item columns

The columns and formulas shown on an order’s line items are defined on the product template (a content template), not here — an order template just gates which product templates are allowed.

Seeds

Order templates travel between environments as structural Seeds. Each is an order_templates item; its references (contact profiles, product templates, child templates) are carried as denormalized { title, slug } entries:
[
  {
    "object_type": "order_templates",
    "data": {
      "title": "Cumbre Retail Sale",
      "slug": "cumbre-retail-sale",
      "description": "Retail sale.",
      "type": "sale",
      "default_price_list_slug": "wholesale",
      "contact_profiles": [
        { "title": "Financial Profile", "slug": "financial-profile" }
      ],
      "allowed_product_templates": [
        { "title": "Cumbre Coffee", "slug": "cumbre-coffee", "type": "products" }
      ],
      "allowed_child_templates": [
        { "title": "Standard Purchase", "slug": "standard-purchase", "type": "purchase" }
      ],
      "naming_convention": {
        "title_segments": [
          { "type": "value", "object_type": "order_templates", "path": "title" },
          { "type": "literal", "value": " - " },
          { "type": "date", "format": "year_4" },
          { "type": "literal", "value": " - " },
          { "type": "date", "format": "month_2" },
          { "type": "literal", "value": " - " },
          { "type": "counter", "digits": 4 }
        ],
        "slug_from_title": true,
        "counter_starts_at": 1
      }
    }
  }
]

Governance & permissions

Only a super admin or Master can create, edit, and delete order templates.

API access

Order templates have full CRUD. See the API reference.

Orders

The orders created from this template.

Workflows

The steps an order moves through.