---
id: TST-COM-ORD-027
title: Checkouts API
kind: api-lifecycle
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
repository: services-commerce
files:
  - modules/checkout/tests/e2e/checkouts.e2e.spec.js
implements:
  - ATS-COM-ORD-001-01
  - ATS-COM-ORD-001-02
  - ATS-COM-ORD-001-04
  - ATS-COM-ORD-001-06
  - ATS-COM-ORD-001-07
  - ATS-COM-ORD-001-08
  - ATS-COM-ORD-003-01
  - ATS-COM-ORD-003-02
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 2
isolation: The suite creates its own test workspace records and removes them using the fixture cleanup.
evidence:
  - provenance: test
    source: 'services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js'
    test_cases:
      - >-
        answers 200: open, on the portal channel, the member its subject, acting contact and bill-to, in USD,
        the store’s order type
      - >-
        expires seven days out, and the first item carries the participant’s current schema version,
        unvalidated
      - >-
        answers the same record to a read, with no breakdown before a preview, and 404 to a checkout the
        tenant does not have
      - 'refuses a member opening a checkout for another contact, 403'
      - 'adds after the last, changes the intent and clears what was advised, removes, each bumping the version'
      - leaves an event for every change
      - answers 404 to a change of an item the checkout does not have
      - 'refuses a product the tenant does not have: product_not_sellable'
      - 'refuses a retired product and an unsellable product type: product_not_sellable'
      - 'refuses a quantity past the product’s purchase limit: quantity_out_of_limits'
      - 'refuses a payload that does not parse as the participant’s schema: payload_does_not_parse'
      - 'refuses a currency the business unit does not support: currency_not_supported'
      - 'refuses a body the schema refuses at the boundary, 400 naming the field'
      - accepts a member who holds the store’s purchasing role at the organization
      - 'refuses a member affiliated without the role: buyer_may_not_act, NOT_AUTHORIZED_FOR_ORGANIZATION'
      - refuses a member with no affiliation at all to the organization bought for
      - >-
        lets a console user with commerce.orders.create buy for the organization naming any acting contact,
        and audits the override
      - 'refuses a console clerk without commerce.orders.create the same purchase, 400 buyer_may_not_act'
      - 'answers 200 with every item advised by the stub and priced from its standard USD row, and no problem'
      - records the stub’s attestation and canonical payload and the price’s provenance on each item
      - 'stores the price snapshot on the checkout, with the totals, and leaves a previewed event'
      - shows a participant’s refusal inline on the item rather than refusing the preview
      - 'reports an item without a price in the currency, and one whose price row prohibits it'
      - 'previews a checkout whose process_ref is 500 characters: 200, the reference kept whole on the checkout'
      - 'refuses a process_ref of 501 characters on create, 400'
      - 'moves an open checkout to abandoned, after which it no longer changes (409 checkout_not_open)'
scenario_coverage:
  - scenario: ATS-COM-ORD-001-01
    test_cases:
      - 'refuses a member opening a checkout for another contact, 403'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-001-02
    test_cases:
      - 'refuses a product the tenant does not have: product_not_sellable'
      - 'refuses a retired product and an unsellable product type: product_not_sellable'
      - 'refuses a quantity past the product’s purchase limit: quantity_out_of_limits'
      - 'refuses a payload that does not parse as the participant’s schema: payload_does_not_parse'
      - 'refuses a currency the business unit does not support: currency_not_supported'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-001-04
    test_cases:
      - accepts a member who holds the store’s purchasing role at the organization
      - 'refuses a member affiliated without the role: buyer_may_not_act, NOT_AUTHORIZED_FOR_ORGANIZATION'
      - >-
        lets a console user with commerce.orders.create buy for the organization naming any acting contact,
        and audits the override
      - 'refuses a console clerk without commerce.orders.create the same purchase, 400 buyer_may_not_act'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-001-06
    test_cases:
      - 'adds after the last, changes the intent and clears what was advised, removes, each bumping the version'
      - leaves an event for every change
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-001-07
    test_cases:
      - >-
        expires seven days out, and the first item carries the participant’s current schema version,
        unvalidated
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-001-08
    test_cases:
      - 'moves an open checkout to abandoned, after which it no longer changes (409 checkout_not_open)'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-003-01
    test_cases:
      - 'answers 200 with every item advised by the stub and priced from its standard USD row, and no problem'
      - 'stores the price snapshot on the checkout, with the totals, and leaves a previewed event'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-003-02
    test_cases:
      - shows a participant’s refusal inline on the item rather than refusing the preview
      - 'reports an item without a price in the currency, and one whose price row prohibits it'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
dependency_evidence:
  provenance: test
  source: 'services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js'
  declared_by_test: >-
    the composed handler, the routes, the mapper, the workflows, the stub participant, the pricing engine, the
    persistence services and PostgreSQL. Doubled: the signing key pair, and Accounting's, CRM's and Platform's
    tables, which are local stand-ins carrying their owners' policies.
---

# Checkouts API

## Verification Boundary

The suite drives the composed local API dispatcher and its registered routes.

## What This Suite Proves

The registered cases check checkouts API with their fixture records and assertions. Scenario bindings name only the examples those cases exercise.

## What It Does Not Prove

A registered file supplies no run result or verified conformance by itself. Local fixtures do not establish deployed cross-service behavior or complete browser journeys.

## Real Dependencies and Test Doubles

PostgreSQL and the exercised Commerce persistence or workflow code are real. Remote service records, clocks and transports follow the suite’s fixtures.

## Must Not Be Doubled

The database constraints, role restrictions, locks and transactions exercised by this suite must use PostgreSQL.
