---
id: JNY-COM-ORD-005
title: A partial cancellation refunds the affected purchase
feature: FEAT-COM-ORD-06
product_area: commerce
module: orders
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
  - COM-ACC-0600
  - COM-ACC-0602
  - COM-ACC-0607
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
actor: ACT-COM-014
goal: Cancel an allowed part of an accepted purchase and settle only the affected part.
capabilities:
  - CAP-COM-ORD-010
  - CAP-COM-ORD-014
  - CAP-COM-ORD-006
screens:
  - '/console/{tenantId}/orders/{orderId}'
steps:
  - 'n': 1
    surface: '/console/{tenantId}/orders/{orderId}'
    action: Inspect the member’s accepted purchase containing two shirts and a mug.
    capability: CAP-COM-ORD-010
    expected: The starting purchase is accepted and fully paid.
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
      the order whole: every column mapped, the system properties, the mirror absent until derived
  - 'n': 2
    surface: requestCancellation
    action: Ask to cancel one shirt.
    capability: CAP-COM-ORD-014
    expected: Evaluation permits that quantity without a fee or approval wait and execution begins.
    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
  - 'n': 3
    surface: requestCancellation
    action: Run the permitted cancellation and its settlement.
    capability: CAP-COM-ORD-014
    expected: >-
      Delivery for the affected quantity stops, its invoice amount is credited and funding is refunded while
      other lines remain.
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#ran the adjustment at once (nothing
      stands between the fence and the money): the memo on the sale invoice line, the refund of what was paid
  - 'n': 4
    surface: '/console/{tenantId}/orders/{orderId}'
    action: Read the refreshed purchase.
    capability: CAP-COM-ORD-010
    expected: The financial mirror includes the cancellation credit.
    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
alternates:
  - from_step: 2
    condition: The evaluated refund exceeds the approval threshold
    path: An approver records approval and staff execute the authorized request
    outcome: Settlement proceeds after approval
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#lets the approver approve it with a
      reason, and staff execute it; the intervention on the history
  - from_step: 2
    condition: The carrier already has the goods
    path: Evaluation directs the customer to a return
    outcome: Staff use the return workflow for those goods
    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
failures:
  - from_step: 2
    condition: The purchase has not reached acceptance
    path: Reject the cancellation request
    outcome: The placed purchase is left unchanged
    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
rules_in_play:
  - BR-CAP-COM-ORD-014-01
  - BR-CAP-COM-ORD-014-02
  - BR-CAP-COM-ORD-014-03
  - BR-CAP-COM-ORD-014-05
  - BR-CAP-COM-ORD-014-07
  - BR-CAP-COM-ORD-014-09
  - BR-CAP-COM-ORD-006-06
assertions:
  - id: AS-JNY-COM-ORD-005-01
    statement: Credit applies to the cancelled quantity at its discounted net amount and tax.
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#credits the Book’s net on its
      invoice line and its tax on the tax line, then refunds the whole $44.74 (COMM-M1 R7-1)
  - id: AS-JNY-COM-ORD-005-02
    statement: The purchase remains accepted while it has an open line.
    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
e2e_policy: optional
e2e_reason: >-
  The API proves the cancellation outcome; sample-data console dialogs do not establish a complete live staff
  cancellation journey.
evidence:
  - >-
    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#lets the approver
    approve it with a reason, and staff execute it; the intervention on the history
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#ran the
    adjustment at once (nothing stands between the fence and the money): the memo on the sale invoice line,
    the refund of what was paid
  - >-
    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#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/e2e/order-discount-tax.e2e.spec.js#credits the
    Book’s net on its invoice line and its tax on the tax line, then refunds the whole $44.74 (COMM-M1 R7-1)
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
    the order whole: every column mapped, the system properties, the mirror absent until derived
---
# A partial cancellation refunds the affected purchase

## Story

A member asks staff to remove one shirt from a paid purchase. Evaluation permits the request, execution stops the affected delivery and Accounting settles the credit and refund. Staff then refresh the purchase to explain the changed amount while the remaining items continue.
