---
id: CAP-COM-ORD-008
title: Clear an unaccepted order and return its resources
feature: FEAT-COM-ORD-02
product_area: commerce
module: orders
revision: 1
status: draft
product_intent: confirmed
implementation_evidence: observed
supersedes:
  - CAP-COM-BIL-006
  - CAP-COM-BIL-007
  - CAP-COM-BIL-008
  - CAP-COM-BIL-009
  - CAP-COM-PRO-024
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#A2'
  - 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#A8'
  - 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#2. Scope'
purpose: Staff clear a sale that cannot reach acceptance and account for resources and money already attached to it.
outcomes:
  - Window-expiry processing releases an unpaid order’s stock and redemption uses.
  - Voiding a partly paid order returns its captured payments through their original treatment.
concepts:
  - CON-COM-ORD-002
actors:
  - ACT-COM-016
  - ACT-COM-014
surfaces:
  - console
  - api
  - job
preconditions: []
postconditions: []
permissions:
  - key: commerce.orders.void
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-COM-ORD-008-01
    proved_by: [ATS-COM-ORD-001-20, ATS-COM-ORD-008-01, ATS-COM-ORD-008-14, TST-COM-ORD-032, TST-COM-ORD-137]
    statement: >-
      A console void requires the void permission and a reason of no more than 500 characters; portal buyers
      cannot use it.
    kind: permission
    enforced_at:
      - api
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#refuses a reader without
      commerce.orders.void, 403 permission_missing, and a portal member the route
    origin: 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#2. Scope'
  - id: BR-CAP-COM-ORD-008-02
    proved_by: [ATS-COM-ORD-008-02, TST-COM-ORD-032]
    statement: >-
      Only orders still placed can be voided, with accepted, payment-uncertain and already voided orders
      refused.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#refuses a second void, 409
      order_not_voidable, and a read answers the order voided
    origin: 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#2. Scope'
  - id: BR-CAP-COM-ORD-008-03
    proved_by: [ATS-COM-ORD-008-03, ATS-COM-ORD-008-13, TST-COM-ORD-029, TST-COM-ORD-032]
    statement: >-
      Voiding releases the applications’ resource claims and reservation records, cancels pending delivery
      obligations and records the release in order history.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#released the participant’s claim,
      the ledger and the obligations
    origin: 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#A2'
  - id: BR-CAP-COM-ORD-008-04
    proved_by: [ATS-COM-ORD-008-04, TST-COM-ORD-110]
    statement: Voiding releases the order’s redeemed promotion and code uses.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/placement/promotion-placement.integration.spec.js#voids
      the order and releases its redemption with order_voided
    origin: 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#A8'
  - id: BR-CAP-COM-ORD-008-05
    proved_by: [ATS-COM-ORD-008-05, ATS-COM-ORD-008-12, TST-COM-ORD-075]
    statement: >-
      After the void commits, Commerce requests deletion of the pro forma and records Accounting’s response,
      retaining the void even if deletion does not succeed.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#deletes the pro forma in
      Accounting and records it on the history
    origin: 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#A2'
  - id: BR-CAP-COM-ORD-008-06
    proved_by: [ATS-COM-ORD-007-17, ATS-COM-ORD-008-06, TST-COM-ORD-075, TST-COM-ORD-097, TST-COM-ORD-136]
    statement: >-
      A partial-payment void refunds captured card or bank payments before crediting the invoice, returns
      store credit through the credit process and escalates unreadable payment legs.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/unit/orders/void-refund.spec.js#refunds the paid part of a
      part-paid order before the memo of its line is cut
    origin: none
  - id: BR-CAP-COM-ORD-008-07
    proved_by: [ATS-COM-ORD-008-07, TST-COM-ORD-075]
    statement: >-
      Void replay and adjustment replay send no duplicate refunds, and a later independent void request is
      refused.
    kind: invariant
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refunds nothing twice: a
      second void is 409, a re-run of the plan sends nothing and a replayed request answers the same plan
    origin: none
  - id: BR-CAP-COM-ORD-008-08
    proved_by: [ATS-COM-ORD-008-08, TST-COM-ORD-096]
    statement: >-
      The minute sweep voids expired placed pay-now orders in bounded window order within their workspaces,
      recording a system reason and leaving terms, accepted and voided orders alone.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/orders/tender-window-sweeper.integration.spec.js#voided
      each in its own tenant: the reason tender_window_expired, the reservation released, the obligation
      cancelled, the history told by the system
    origin: 'services-commerce:docs/milestones/plans/COMM-M2-plan.md#A2'
  - id: BR-CAP-COM-ORD-008-09
    proved_by: [ATS-COM-ORD-008-10, TST-COM-ORD-140]
    statement: >-
      A configured tender window is measured from the exact placement instant, including when it crosses
      midnight.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/unit/placement/tender-window.spec.js#ends a thirty-minute window
      across midnight UTC on the next day
    origin: 'services-commerce:docs/milestones/plans/COMM-M1-plan.md#A3'
  - id: BR-CAP-COM-ORD-008-10
    proved_by: [ATS-COM-ORD-008-11, TST-COM-ORD-017]
    statement: >-
      After the pay-now window expires, Order 360 removes Take Payment but retains Void Order for an unpaid
      order.
    kind: policy
    enforced_at:
      - console
    must_prove: true
    provenance: test
    source: >-
      react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#shows neither once the
      tender window has passed, except Void Order
    origin: none
scenarios:
  - id: SC-CAP-COM-ORD-008-01
    given: A duplicate phone order reserves mugs and the only use of a code.
    when: An administrator voids it with an explanation.
    then: 'Its resources and code use become available, and Accounting is asked to delete the provisional invoice.'
    provenance: unknown
    source: FND-COM-ORD-032
edge_cases: []
constraints: []
depends_on:
  - CAP-COM-ORD-005
  - CAP-COM-ORD-007
related:
  - CAP-COM-ORD-006
  - CAP-COM-ORD-012
journeys:
  - JNY-COM-ORD-004
open_questions: []
evidence:
  - >-
    Examined reference: react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#shows
    neither once the tender window has passed, except Void Order
  - 'Examined reference: services-commerce:docs/milestones/plans/COMM-M1-plan.md#A3'
  - 'Examined reference: services-commerce:docs/milestones/plans/COMM-M2-plan.md#2. Scope'
  - 'Examined reference: services-commerce:docs/milestones/plans/COMM-M2-plan.md#A2'
  - 'Examined reference: services-commerce:docs/milestones/plans/COMM-M2-plan.md#A8'
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#refuses a reader
    without commerce.orders.void, 403 permission_missing, and a portal member the route
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#refuses a second
    void, 409 order_not_voidable, and a read answers the order voided
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#released the
    participant’s claim, the ledger and the obligations
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#deletes the
    pro forma in Accounting and records it on the history
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refunds
    nothing twice: a second void is 409, a re-run of the plan sends nothing and a replayed request answers the
    same plan
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/orders/tender-window-sweeper.integration.spec.js#voided
    each in its own tenant: the reason tender_window_expired, the reservation released, the obligation
    cancelled, the history told by the system
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/placement/promotion-placement.integration.spec.js#voids
    the order and releases its redemption with order_voided
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/orders/void-refund.spec.js#refunds the
    paid part of a part-paid order before the memo of its line is cut
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/placement/tender-window.spec.js#ends a
    thirty-minute window across midnight UTC on the next day
controls: [TC-IAM-006, 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-DAT-004, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-AVL-004, TC-MON-001, TC-MON-002, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002]
exercised_by: [FAS-COM-ORD-02-02, FAS-COM-ORD-02-04, FAS-COM-ORD-03-03]
suites: [TST-COM-ORD-017, TST-COM-ORD-029, TST-COM-ORD-032, TST-COM-ORD-075, TST-COM-ORD-096, TST-COM-ORD-097, TST-COM-ORD-110, TST-COM-ORD-136, TST-COM-ORD-137, TST-COM-ORD-140]
---

# Clear an unaccepted order and return its resources

## Purpose

Staff clear a sale that cannot reach acceptance and account for resources and money already attached to it. The order retains its history after it is voided.

## How It Works

An administrator opens the unpaid order and supplies a reason to void it. Commerce verifies that the order still permits this intervention. The void releases the associated resources and records what it clears. Accounting receives the follow-on invoice or refund work appropriate to the amounts already processed. Failure in that follow-on work remains distinguishable from the committed void. Window-expiry processing can perform the same clearing as a system action.

## Relationships

Placement supplies claims and order history; billing and Accounting provide invoice clearing and money returns; promotion use is released with the void.
