---
id: CAP-COM-CAT-002
title: Select the policy governing a sale
feature: FEAT-COM-CAT-01
product_area: commerce
module: catalog
revision: 1
status: draft
product_intent: proposed
implementation_evidence: partially-observed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D9'
  - >-
    services-commerce:docs/milestones/plans/COMM-M1-plan.md#D9. Adopt the
    expanded ordering-profile selection order?
  - >-
    services-commerce:docs/milestones/plans/COMM-M1-plan.md#4. Assumptions (A1,
    A2)
purpose: >-
  Staff and applications obtain a predictable governing policy from explicit
  choices and configured defaults.
outcomes:
  - >-
    Customer customer staff and applications can rely on a predictable answer to
    which policy governs a sale.
  - A placed sale does not mixes business units or currencies.
concepts:
  - CON-COM-CAT-001
actors:
  - ACT-COM-001
  - ACT-COM-007
surfaces:
  - console
  - api
permissions:
  - key: commerce.ordering-profiles.read
    where_checked: api
    scope: tenant
  - key: commerce.ordering-profiles.update
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-COM-CAT-002-01
    proved_by: [ATS-COM-CAT-002-05, ATS-COM-CAT-002-07]
    statement: >-
      Policy selection takes the first available choice in this order: an
      explicit policy, the store’s policy, the first item’s selling-context
      policy, the application default and the workspace default.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: 'services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D9'
    origin: COMM-M1 D9 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
    note: >-
      The checkout applies the five steps (Orders, Checkout, Participants and
      Entitlements module); the resolution read of this module applies
      exclusively the explicit, application-default and workspace-default steps.
  - id: BR-CAP-COM-CAT-002-02
    proved_by: [ATS-COM-CAT-002-05, ATS-COM-CAT-002-07]
    statement: >-
      Adding an item that resolves to a different policy is refused with both
      policies identified, preserving one policy per order.
    kind: invariant
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: >-
      services-commerce:docs/milestones/plans/COMM-M1-plan.md#D9. Adopt the
      expanded ordering-profile selection order?
    origin: COMM-M1 D9 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
  - id: BR-CAP-COM-CAT-002-03
    proved_by: [ATS-COM-CAT-001-13, ATS-COM-CAT-002-01, ATS-COM-CAT-002-06, TST-COM-CAT-030, TST-COM-CAT-036]
    statement: >-
      The resolution read selects an explicit policy before an application
      default before the workspace default and identifies the winning source.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#resolves
      a context: the profile it names (explicit), else its application’s
      default, else the tenant default
    origin: COMM-M1 plan A1 (docs/milestones/plans/COMM-M1-plan.md)
  - id: BR-CAP-COM-CAT-002-04
    proved_by: [ATS-COM-CAT-002-02, TST-COM-CAT-030]
    statement: >-
      Resolution rejects an unknown policy reference and returns no policy when
      the workspace has none configured.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#answers
      400 to a context naming a profile the tenant does not have, and nothing
      for a tenant with no profile at all
    origin: none
  - id: BR-CAP-COM-CAT-002-05
    proved_by: []
    statement: >-
      Saving the combined workspace and application defaults document replaces
      the application map, removing omitted entries.
    kind: policy
    enforced_at:
      - service
      - console
    must_prove: false
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#removes
      an application default left out of the document, the tenant default kept
      when null
    origin: none
  - id: BR-CAP-COM-CAT-002-06
    proved_by: [ATS-COM-CAT-002-03, TST-COM-CAT-030, TST-COM-CAT-035]
    statement: >-
      Defaults replacement succeeds only when every referenced policy belongs to
      the workspace and is active; otherwise the saved document remains intact.
    kind: validation
    enforced_at:
      - service
      - console
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#refuses
      a document naming an inactive or an unknown profile, 400, the document
      unchanged
    origin: none
  - id: BR-CAP-COM-CAT-002-07
    proved_by: []
    statement: >-
      The workspace default supplies the policy for an application with no
      application-specific default.
    kind: policy
    enforced_at:
      - service
    must_prove: false
    provenance: documented
    source: 'services-commerce:docs/decisions/ordering-profiles.md'
    origin: COMM-M1 plan A1 (docs/milestones/plans/COMM-M1-plan.md)
  - id: BR-CAP-COM-CAT-002-08
    proved_by: [ATS-COM-CAT-002-04, TST-COM-CAT-028]
    statement: >-
      Read permission allows defaults inspection and resolution, while defaults
      replacement requires policy update permission.
    kind: permission
    enforced_at:
      - api
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/configuration-security.e2e.spec.js#lists
      and reads the ordering profiles, the defaults document and the resolution
    origin: none
scenarios:
  - id: SC-CAP-COM-CAT-002-01
    given: Events has an application policy distinct from the workspace fallback
    when: Resolve the events application context
    then: Resolution returns its application default with that source identified
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.queries.integration.spec.js#resolveOrderingProfile
      walks the hierarchy of 22 §3 and names the source
  - id: SC-CAP-COM-CAT-002-02
    given: The cart already uses Main USD
    when: Add an item assigned to Conference EUR by its selling context
    then: The conflicting item is refused with both policies identified
    provenance: documented
    source: >-
      services-commerce:docs/milestones/plans/COMM-M1-plan.md#D9. Adopt the
      expanded ordering-profile selection order?
depends_on:
  - CAP-COM-CAT-001
related:
  - CAP-COM-CAT-003
journeys:
  - JNY-COM-CAT-001
evidence:
  - >-
    Pinned service inputs:
    modules/configuration/aws/api/ordering-profiles.routes.ts (resolve,
    defaults); services/persistence/ordering-profiles.ts:resolveOrderingProfile;
    db/ordering-profile-defaults.table.ts;
    tests/e2e/ordering-profiles.e2e.spec.js;
    tests/integration/services/persistence/ordering-profiles.queries.integration.spec.js;
    modules/checkout/services/checkout/ordering-profile-resolution.ts (read
    only, to name the dependency)
  - >-
    Pinned console inputs:
    components/commerce/ordering-profiles/ordering-profile-defaults-page.tsx,
    lib/commerce/ordering-profiles/__tests__/rules.test.ts
controls: [TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-CRY-001, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-LOG-004, TC-LOG-005, TC-PI-001, TC-PI-003, TC-PRV-001, TC-PRV-002]
exercised_by: [FAS-COM-CAT-01-01, FAS-COM-CAT-01-02, FAS-COM-CAT-01-03, FAS-COM-CAT-01-04]
suites: [TST-COM-CAT-028, TST-COM-CAT-030, TST-COM-CAT-035, TST-COM-CAT-036]
---

# Select the policy governing a sale

## Purpose

Staff and applications obtain a predictable governing policy from explicit choices and configured defaults.

## How It Works

Administrators maintain defaults for the workspace and individual selling applications. Commerce uses the available context to resolve a policy when a sale begins. Checkout applies the broader selection order recorded by Product, while the shared resolution read supports a narrower context. Staff can inspect where a resolution came from instead of treating every selection as explicit. Defaults replacement validates the referenced policies and retains the previous document when a selection is unsuitable. Conflicting item contexts are a dependency on checkout’s enforcement of a single order policy. The product should align the resolution interface with the context checkout evaluates.

## Relationships

The configure reusable sale-processing policies capability supplies related configuration or assessment used in this work.

The configure a store’s offered assortment capability supplies related configuration or assessment used in this work.
