---
id: CAP-COM-ORD-014
title: Cancel accepted purchases and settle the result
feature: FEAT-COM-ORD-06
product_area: commerce
module: orders
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
  - CAP-COM-PPU-001
  - CAP-COM-PPU-002
  - CAP-COM-PPU-003
  - CAP-COM-PPU-004
  - CAP-COM-PPU-005
  - CAP-COM-PPU-006
  - CAP-COM-PPU-019
  - CAP-COM-REG-036
  - CAP-COM-REG-042
  - CAP-COM-PRO-025
  - CAP-COM-PPU-027
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D13'
purpose: A customer can stop or undo an accepted purchase through a planned cancellation.
outcomes:
  - Cancellation settles the affected purchase line while retaining the rest of the sale.
  - Required domain cancellation completes before its financial adjustment.
concepts:
  - CON-COM-ORD-005
  - CON-COM-ORD-002
actors:
  - ACT-COM-014
  - ACT-COM-016
  - ACT-COM-017
  - ACT-COM-018
surfaces:
  - console
  - portal
  - api
preconditions: []
postconditions: []
permissions:
  - key: commerce.cancellations.read
    where_checked: api
    scope: tenant
  - key: commerce.cancellations.create
    where_checked: api
    scope: tenant
  - key: commerce.cancellations.update
    where_checked: api
    scope: tenant
  - key: commerce.cancellations.approve
    where_checked: api
    scope: tenant
  - key: commerce.cancellations.override
    where_checked: service
    scope: tenant
rules:
  - id: BR-CAP-COM-ORD-014-01
    proved_by: [ATS-COM-ORD-009-09, ATS-COM-ORD-010-12, ATS-COM-ORD-013-15, ATS-COM-ORD-014-01, ATS-COM-ORD-014-19, TST-COM-ORD-076]
    statement: >-
      Cancellation requires an accepted order and authorized parties, rejecting placed orders, unauthorized
      members, readers and records in another workspace.
    kind: validation
    enforced_at:
      - api
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#refuses a placed order 409
      order_not_cancellable, another member 403 not_your_party, a reader 403 permission_missing, another
      tenant 404
    origin: none
  - id: BR-CAP-COM-ORD-014-02
    proved_by: [ATS-COM-ORD-014-02, TST-COM-ORD-076]
    statement: >-
      The request immediately combines application cancellation advice with money and approval facts into a
      plan, and can execute that plan in the request when no approval is needed.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#answers 200 with the document
      completed in the one request: allowed, executed, the money moved, the customer status cancelled
    origin: none
  - id: BR-CAP-COM-ORD-014-03
    proved_by: [ATS-COM-ORD-014-03, TST-COM-ORD-076]
    statement: >-
      Cancelling waiting delivery closes the affected line and increases its cancelled quantity, with the
      order becoming cancelled when every line is cancelled.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#cancels the line’s waiting fulfil
      obligation itself, grows quantity_cancelled and closes the line; the mug untouched, the order still
      accepted
    origin: none
  - id: BR-CAP-COM-ORD-014-04
    proved_by: [ATS-COM-ORD-013-14, ATS-COM-ORD-014-04, ATS-COM-ORD-014-17, TST-COM-ORD-076]
    statement: >-
      The application undoes delivered work through a cancellation obligation, and the financial action waits
      for that domain cancellation when required.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#is delivered by the worker to the
      participant’s cancel, which settles the document completed and runs the refund after the domain (ADR-13)
    origin: none
  - id: BR-CAP-COM-ORD-014-05
    proved_by: [ATS-COM-ORD-006-15, ATS-COM-ORD-014-05, TST-COM-ORD-076, TST-COM-ORD-131]
    statement: >-
      Credit uses cancelled units’ discounted value and tax within the remaining invoice cap, while the refund
      estimate separately applies funding, refundable fraction, non-refundable amounts and fees.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/unit/cancellations/cancellation-plan.spec.js#credits 2 of 5 units
      at the discounted amount with the tax share, estimates the refund from the funded part, and approves the
      document
    origin: none
  - id: BR-CAP-COM-ORD-014-06
    proved_by: [ATS-COM-ORD-014-06, TST-COM-ORD-076, TST-COM-ORD-131]
    statement: >-
      Fee calculation prefers application advice, then frozen line terms, using the order’s fee product as a
      fallback and waiving an unbillable fee with a warning before refunding the remaining freed money.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#raises the fee invoice, applies the
      freed money to it and refunds the remainder
    origin: none
  - id: BR-CAP-COM-ORD-014-07
    proved_by: [ATS-COM-ORD-014-07, ATS-COM-ORD-015-14, TST-COM-ORD-076, TST-COM-ORD-131]
    statement: >-
      Application approval requirements or a refund exceeding the configured threshold hold the request for
      review and block overlapping line requests until approval and execution.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#holds staff’s request for approval
      (participant_requires_approval) and refuses a second request on the line 409 line_already_cancelling
      (B38)
    origin: none
  - id: BR-CAP-COM-ORD-014-08
    proved_by: [ATS-COM-ORD-014-08, TST-COM-ORD-076]
    statement: >-
      A cancellation deadline blocks customer requests, but a reasoned administrator override can proceed
      subject to remaining approval requirements; ordinary clerks cannot override.
    kind: permission
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#allows an administrator’s override
      at once with its reason, and refuses a clerk’s override 403 override_not_permitted
    origin: none
  - id: BR-CAP-COM-ORD-014-09
    proved_by: [ATS-COM-ORD-014-09, ATS-COM-ORD-014-18, TST-COM-ORD-076]
    statement: Goods handed to the carrier require a return instead of cancellation.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#answers must_return with
      shipment_handed_off once the shipping fence says the unit shipped
    origin: none
  - id: BR-CAP-COM-ORD-014-10
    proved_by: [ATS-COM-ORD-014-10, TST-COM-ORD-076]
    statement: >-
      Cancellation approval and rejection require console access and approval authority, which a portal buyer
      or an ordinary clerk lacks.
    kind: permission
    enforced_at:
      - api
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#refuses a member on the console
      approve route 403, and a clerk approving 403 permission_missing
    origin: none
  - id: BR-CAP-COM-ORD-014-11
    proved_by: [ATS-COM-ORD-014-13, TST-COM-ORD-076]
    statement: >-
      The requester can withdraw an approved cancellation before execution, freeing the line for a later
      request.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#lets the member withdraw an
      approved, unexecuted request (a second request refused meanwhile), then request again
    origin: none
  - id: BR-CAP-COM-ORD-014-12
    proved_by: [ATS-COM-ORD-014-14, TST-COM-ORD-076]
    statement: >-
      Cancellation releases an application’s committed capacity claim and its reservation so another purchase
      can use the capacity.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#releases the claim through the
      participant’s function: one seat committed before, none after, the ledger released for cancellation
    origin: none
  - id: BR-CAP-COM-ORD-014-13
    proved_by: [ATS-COM-ORD-009-08, ATS-COM-ORD-010-11, ATS-COM-ORD-014-15, ATS-COM-ORD-014-16, TST-COM-ORD-076]
    statement: The order’s money summary refreshes to show cancellation credits immediately after cancellation.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#shows the cancellation’s credit on
      the order’s money mirror at once, read right after the cancel
    origin: none
  - id: BR-CAP-COM-ORD-014-14
    proved_by: []
    statement: >-
      The recorded product decision restores a personal single-use code by default when its purchased line is
      cancelled.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: 'services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D13'
    origin: 'services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D13'
    note: Catalog owns the promotion configuration used by this operation.
  - id: BR-CAP-COM-ORD-014-15
    proved_by: [ATS-COM-ORD-014-12, TST-COM-ORD-131]
    statement: >-
      A delivery that operates on a whole waiting line refuses cancellation of fewer units than the remaining
      quantity.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: 'services-commerce:modules/orders/services/cancellations/cancellation-plan.ts:planLine'
    origin: none
scenarios:
  - id: SC-CAP-COM-ORD-014-01
    given: A member no longer wants one of two purchased shirts.
    when: Staff cancel the unwanted line.
    then: The illustrative refund concerns that shirt alone while the remainder continues.
    provenance: unknown
    source: FND-COM-ORD-032
edge_cases: []
constraints: []
depends_on:
  - CAP-COM-ORD-006
  - CAP-COM-ORD-012
related:
  - CAP-COM-ORD-009
  - CAP-COM-ORD-013
  - CAP-COM-ORD-016
journeys:
  - JNY-COM-ORD-005
open_questions:
  - OQ-COM-ORD-005
evidence:
  - 'Examined reference: services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D13'
  - 'Examined reference: services-commerce:modules/orders/services/cancellations/cancellation-plan.ts:planLine'
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#allows an
    administrator’s override at once with its reason, and refuses a clerk’s override 403
    override_not_permitted
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#answers 200 with
    the document completed in the one request: allowed, executed, the money moved, the customer status
    cancelled
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#answers
    must_return with shipment_handed_off once the shipping fence says the unit shipped
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#cancels the
    line’s waiting fulfil obligation itself, grows quantity_cancelled and closes the line; the mug untouched,
    the order still accepted
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#holds staff’s
    request for approval (participant_requires_approval) and refuses a second request on the line 409
    line_already_cancelling (B38)
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#is delivered by
    the worker to the participant’s cancel, which settles the document completed and runs the refund after the
    domain (ADR-13)
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#lets the member
    withdraw an approved, unexecuted request (a second request refused meanwhile), then request again
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#raises the fee
    invoice, applies the freed money to it and refunds the remainder
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#refuses a member
    on the console approve route 403, and a clerk approving 403 permission_missing
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#refuses a placed
    order 409 order_not_cancellable, another member 403 not_your_party, a reader 403 permission_missing,
    another tenant 404
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#releases the
    claim through the participant’s function: one seat committed before, none after, the ledger released for
    cancellation
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#shows the
    cancellation’s credit on the order’s money mirror at once, read right after the cancel
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/unit/cancellations/cancellation-plan.spec.js#credits 2 of 5 units
    at the discounted amount with the tax share, estimates the refund from the funded part, and approves the
    document
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-TEN-004, TC-CRY-001, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-AVL-004, TC-MON-002, TC-PI-001, TC-PI-003, TC-PI-004, TC-PI-005, TC-VEN-001, TC-VEN-002, TC-VEN-003, TC-PRV-001, TC-PRV-002]
exercised_by: [FAS-COM-ORD-03-02, FAS-COM-ORD-05-02, FAS-COM-ORD-06-01, FAS-COM-ORD-06-02, FAS-COM-ORD-06-04, FAS-COM-ORD-06-05]
suites: [TST-COM-ORD-076, TST-COM-ORD-131]
---

# Cancel accepted purchases and settle the result

## Purpose

A customer can stop or undo an accepted purchase through a planned cancellation. Domain work, approval and money remain connected to the affected lines.

## How It Works

The requester selects the accepted order lines they want to cancel. Commerce obtains application advice and presents a plan with allowed quantities, financial estimates and approval needs. Requests requiring review wait for an authorized person. Execution coordinates the original delivery, held resources and financial adjustment. The requester can follow the cancellation’s progress rather than treating a refund as the whole operation. Unavailable or refused domain work remains visible through the document and operational handling.

## Relationships

Order inspection supplies the purchase, selling applications advise on reversal, entitlements and reservations release rights and capacity, and Accounting settles the money.
