---
id: CAP-ACC-TRX-020
title: Coordinate financial commands across applications
feature: FEAT-ACC-TRX-06
product_area: accounting
module: transactions
revision: 1
status: draft
product_intent: proposed
implementation_evidence: partially-observed
supersedes:
  - CAP-ACC-PAY-020
  - CAP-ACC-PAY-032
  - CAP-ACC-RPT-018
  - CAP-ACC-SEC-006
  - CAP-ACC-SEC-008
  - CAP-ACC-SEC-009
  - CAP-ACC-SEC-010
  - CAP-ACC-SEC-014
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-07'
  - 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01'
  - 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#M4-1'
  - 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#M4-2'
  - 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#M4-6'
  - 'services-accounting:docs/accounting/invoices.md#Invoices'
purpose: Connected applications retry financial work safely and consume Accounting’s resulting facts.
outcomes:
  - Connected applications retry financial work safely and consume Accounting’s resulting facts.
  - >-
    Order-line positions remain available for financial reconstruction. Workspace deletion removes owned
    financial data before dependent configuration.
concepts:
  - CON-ACC-TRX-006
actors:
  - ACT-ACC-021
  - ACT-ACC-022
surfaces:
  - api
  - job
permissions:
  - key: accounting.invoices.create
    where_checked: api
    scope: tenant
  - key: accounting.payments.create
    where_checked: api
    scope: tenant
  - key: accounting.reversals.create
    where_checked: api
    scope: tenant
  - key: accounting.tax.calculate
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-ACC-TRX-020-01
    proved_by: [ATS-ACC-TRX-014-09, ATS-ACC-TRX-019-08, ATS-ACC-TRX-020-01, ATS-ACC-TRX-020-09, TST-ACC-TRX-016, TST-ACC-TRX-206]
    statement: >-
      Commerce authenticates as its own registered service identity through separately restricted billing,
      tender, reversal and tax functions; unknown identities are denied.
    kind: permission
    enforced_at:
      - api
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it refuses a principal
      the registry does not know (403) and an event that is not a package (400)
    origin: 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-07'
  - id: BR-CAP-ACC-TRX-020-02
    proved_by: [ATS-ACC-TRX-001-17, ATS-ACC-TRX-016-08, ATS-ACC-TRX-020-02, ATS-ACC-TRX-020-09, TST-ACC-TRX-121]
    statement: Service-created records identify the service actor and preserve the originating person when supplied.
    kind: invariant
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/service-calls/service-caller.integration.spec.js#it
      records the service principal as the actor of what it creates
    origin: none
    note: >-
      The cited build recommendation does not establish Product approval; the authority gap remains open in
      FND-ACC-TRX-035.
  - id: BR-CAP-ACC-TRX-020-03
    proved_by: [ATS-ACC-TRX-001-17, ATS-ACC-TRX-008-09, ATS-ACC-TRX-014-09, ATS-ACC-TRX-020-03, ATS-ACC-TRX-020-09, TST-ACC-TRX-052, TST-ACC-TRX-223]
    statement: >-
      A retry key replays the stored result for the same command body, rejects altered reuse and remains
      reusable after a refused command commits nothing.
    kind: policy
    enforced_at:
      - api
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it
      refuses the second request 409 idempotency_key_reused
    origin: 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01'
  - id: BR-CAP-ACC-TRX-020-04
    proved_by: [ATS-ACC-TRX-020-04, TST-ACC-TRX-052, TST-ACC-TRX-081, TST-ACC-TRX-211]
    statement: >-
      Retry-key ownership spans the workspace, preventing another actor from executing an independent command
      under a used key.
    kind: policy
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it
      refuses the second person 409 idempotency_key_in_use, never an unhandled error (DEF-ACT-0800)
    origin: 'services-accounting:docs/accounting/invoices.md#Invoices'
  - id: BR-CAP-ACC-TRX-020-05
    proved_by: [ATS-ACC-TRX-007-12, ATS-ACC-TRX-020-05, ATS-ACC-TRX-020-09, TST-ACC-TRX-052]
    statement: >-
      Racing identical requests execute the financial effect once, although a competing request can receive a
      lifecycle refusal rather than a replay.
    kind: invariant
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it
      issues the invoice once and refuses the other issue invoice_not_draft
    origin: 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01'
  - id: BR-CAP-ACC-TRX-020-06
    proved_by: [ATS-ACC-TRX-016-08, ATS-ACC-TRX-020-06, ATS-ACC-TRX-020-09, TST-ACC-TRX-043]
    statement: >-
      Receivable history records each monetary change and reconstructs both current balances and earlier
      positions at their known-time cutoff.
    kind: invariant
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it
      answers, as of today and known now, exactly the live balance of every open invoice (FC-07)
    origin: 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01'
  - id: BR-CAP-ACC-TRX-020-07
    proved_by: [ATS-ACC-TRX-020-07, TST-ACC-TRX-031, TST-ACC-TRX-032]
    statement: >-
      Transactional receivable events retry failed configured delivery, but acknowledge and log events when
      Commerce has no configured receiver.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-accounting:modules/transactions/services/change-events/commerce-financial-facts.ts:commerceFinancialFactsHandler
    origin: none
    note: >-
      The cited build recommendation does not establish Product approval; the authority gap remains open in
      FND-ACC-TRX-035.
  - id: BR-CAP-ACC-TRX-020-08
    proved_by: [ATS-ACC-TRX-007-12, ATS-ACC-TRX-012-12, ATS-ACC-TRX-013-10, ATS-ACC-TRX-020-08, ATS-ACC-TRX-020-09, TST-ACC-TRX-016, TST-ACC-TRX-041]
    statement: >-
      Platform-routed processor events are consumed transactionally by identity, so redelivery changes nothing
      and unrelated or unknown payments are ignored.
    kind: invariant
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it
      records every event it handles or ignores by id in the handling transaction, and a replay is ignored by
      the row, not by a lookup
    origin: none
    note: >-
      The cited build recommendation does not establish Product approval; the authority gap remains open in
      FND-ACC-TRX-035.
  - id: BR-CAP-ACC-TRX-020-09
    proved_by: []
    statement: >-
      The order-line position view supplies Commerce with invoiced, settled, credited, refunded and abandoned
      amounts.
    kind: policy
    enforced_at:
      - database
    must_prove: false
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/persistence/order-line-positions.queries.integration.spec.js#it
      answers a paid line as settled in full
    origin: 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01'
  - id: BR-CAP-ACC-TRX-020-10
    proved_by: []
    statement: >-
      Accounting still serves Commerce tax quotes despite the recorded transfer of tax determination to
      Commerce.
    kind: policy
    enforced_at:
      - api
    must_prove: false
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it serves the
      calculation as Commerce: a quote of a line with no address is zero with the warning, and nothing else is
      served
    origin: OQ-ACC-TRX-001
  - id: BR-CAP-ACC-TRX-020-11
    proved_by: []
    statement: >-
      Deletion purges transaction data before dependent configuration and refuses to purge an active
      workspace.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: false
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/lifecycle/transactions-participant.integration.spec.js#it
      refuses to purge a live tenant, with nothing removed
    origin: none
scenarios:
  - id: SC-CAP-ACC-TRX-020-01
    given: Commerce needs to bill an order using resolved terms.
    when: Invoke its separate billing service.
    then: The issued invoice identifies Commerce as the creating actor.
    provenance: test
    source: >-
      react-console:acceptance/accounting/playwright/journeys/cross-application/ACT-ACC-0800.spec.ts#ACT-ACC-0800
  - id: SC-CAP-ACC-TRX-020-02
    given: A request’s completion is uncertain to another operator.
    when: Submit a retry using its original key.
    then: The operation returns its earlier result or a refusal without a second financial execution.
    provenance: test
    source: >-
      react-console:acceptance/accounting/playwright/journeys/cross-application/ACT-ACC-0807.spec.ts#ACT-ACC-0807
edge_cases: []
depends_on: []
related:
  - CAP-ACC-TRX-001
  - CAP-ACC-TRX-007
  - CAP-ACC-TRX-009
  - CAP-ACC-TRX-014
  - CAP-ACC-TRX-016
  - CAP-ACC-TRX-018
journeys:
  - JNY-ACC-TRX-006
open_questions:
  - OQ-ACC-TRX-001
evidence:
  - >-
    services-accounting at f47cb263875bbc0c5640fba7dae6785ec32695f8: aws/accounting.service-functions.ts;
    modules/transactions/aws/logic/service-functions.lambda.ts, lambda/SERVICE.handler.ts; tax.routes.ts
    (calculateTax); services/integrations/integration-events.ts, integration-events-consumer.ts;
    services/change-events/commerce-financial-facts.ts; services/runs/nudge-dispatcher.ts;
    services/lifecycle/transactions-participant.ts, snapshot-purge-steps.ts; db/receivable-events.table.ts,
    consumed-integration-events.table.ts, document-events.table.ts; docs/accounting/change-events.md,
    invoices.md, payments.md; tests e2e/service-functions.e2e.spec.js,
    service-functions-gateway-lost-answer.e2e.spec.js, integration/services/service-calls/service-caller,
    change-events/*, integrations/integration-events, invoices/idempotency, invoices/as-of,
    payments/as-of-mixed, persistence/order-line-positions.queries, lifecycle/transactions-participant,
    support/invariants-root-hook.js.
  - >-
    react-console at baf6dae382d6f41dce976c7f848667ccc37e076f: journeys ACT-ACC-0800 to 0803, 0807, 0822 to
    0826, 0837, 0843.
controls: [TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, 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-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-PI-001, TC-PI-002, TC-PI-003, TC-PI-005, TC-VEN-001, TC-VEN-002, TC-VEN-003, TC-PRV-001, TC-PRV-002]
exercised_by: [FAS-ACC-TRX-06-01, FAS-ACC-TRX-06-03, FAS-ACC-TRX-06-04, FAS-ACC-TRX-06-05]
suites: [TST-ACC-TRX-016, TST-ACC-TRX-031, TST-ACC-TRX-032, TST-ACC-TRX-041, TST-ACC-TRX-043, TST-ACC-TRX-052, TST-ACC-TRX-081, TST-ACC-TRX-121, TST-ACC-TRX-206, TST-ACC-TRX-211, TST-ACC-TRX-223]
---

# Coordinate financial commands across applications

## Purpose

Connected applications retry financial work safely and consume Accounting’s resulting facts.

## How It Works

Commerce uses a registered service identity and separate functions for billing, tender and reversal. Commands retain actor attribution and use retry identities to avoid duplicate effects. Accounting appends receivable history alongside successful financial changes. Configured change delivery retries receiver failures, while an absent Commerce receiver currently acknowledges events with a log. Platform processor events are applied transactionally once. Order-line positions remain available for financial reconstruction. Workspace deletion removes owned financial data before dependent configuration.

## Relationships

- Issue customer bills and numbered quotes supplies or continues the related financial work.
- Collect processor payments and resolve uncertainty supplies or continues the related financial work.
- Complete invoice settlement with credit and money supplies or continues the related financial work.
- Unwind billed purchases and their collected value supplies or continues the related financial work.
- Find money records and understand available work supplies or continues the related financial work.
- Preserve and read monthly receivables aging supplies or continues the related financial work.
