ADR / 001

Make ERP customer creation asynchronous

Protect the commercial workflow from ERP latency while making pending state and recovery explicit.

Reference pattern

Independently created. Contains no employer or client implementation detail, internal names or figures.

01Context

A global B2B organization must validate every new customer financially in ERP before the first order. On a normal day ERP answers in seconds; at month-end close, in maintenance windows or under regional latency it takes minutes—or does not answer. If commercial approval in CRM waits for that answer, sellers stall or click again; if it does not wait, someone has to own what happens while ERP has not yet answered.

02Decision drivers

  1. D01

    A timeout must never produce a second legal customer

  2. D02

    Sellers need a status they can act on while ERP decides

  3. D03

    ERP stays the only issuer of the legal customer number

  4. D04

    Every stuck request needs an owner, a reason and a safe replay

03Options considered

Options considered: when each would be the right choice, what it costs, and the verdict under these premises
OptionRight whenCost / trade-offVerdict
Synchronous API call at approvalERP answers within seconds with high availability, and volumes are lowApproval inherits ERP downtime and latency; after a timeout the user cannot tell whether to click againRejected
Managed asynchronous commandERP latency varies and outcomes must be recoverable without the userPending becomes a real state: CRM must show it, someone must own it and orders must wait for itSelected
Scheduled batch creationBulk onboarding where nobody orders on the same dayHours of invisible delay; rejections arrive detached from the approval that caused themRejected

Every option is right under some premises. The verdict applies to the context above.

04Decision

After commercial approval, CRM freezes the approved data and publishes one idempotent creation command, keyed by the business request. The integration layer validates it, submits it to ERP, persists correlation and delivery state, and returns the outcome to CRM: created, rejected with a reason, or unknown. Order entry opens only when CRM holds the ERP customer number.

05Consequences

What this choice changes elsewhere in the system.

  1. Business state

    CRM shows Pending, Created, Rejected and Intervention required as business states, not as technical log entries.

  2. Idempotency

    The request key travels with every retry, so a replay can never create a second customer.

  3. Recovery

    A timeout is resolved by looking the request up in ERP before any retry (ADR 007); users never press Create again.

  4. Ownership

    Platform operations owns ageing and stuck requests; master data owns the rejections it can repair.

  5. Observability

    Requests are monitored by age and outcome in business terms, not only as failed calls.

  6. Order entry

    Orders are gated on the ERP customer number, so no order can reference a customer that may not exist.

06Revisit when

The decision holds while its context holds. Challenge it when:

01

ERP exposes an idempotent creation endpoint that answers within the approval interaction, month-end included.

02

Approval and legal creation become one decision by one owner, so a pending state no longer means anything.

03

Order entry moves into ERP, so CRM no longer needs to know when the customer exists.

07Where this decision is applied

The decision says why this path was chosen; each case shows how it takes part in a larger architecture.

  1. Systems case / 01Designing a CRM–ERP customer lifecycleA premise-led architecture: from commercial intent to a legally valid, operationally recoverable customer.Systems & CRM ArchitectureData & IntegrationsProcess ArchitectureArchitecture case · 18 min
  2. Systems case / 02Designing the system boundaries behind a global commercial platformDeciding which platform owns each commercial capability—and which boundaries stay in place even when the experience feels like one application.Systems & CRM ArchitectureData & IntegrationsDigital Operating ModelArchitecture case · 10 min
  3. Systems case / 03Designing customer and master-data identity across CRM and ERPSeparating commercial, legal and transactional identity—with one issuer, explicit cardinality and governed merges—and giving authority to concepts and attributes rather than whole records.Systems & CRM ArchitectureData & IntegrationsProcess ArchitectureArchitecture case · 9 min

Decisions this one depends on, or constrains.

  1. ADR / 007Treat uncertain integration outcomes as unknown, not failedA timeout says nothing about whether the receiver committed. Model ‘unknown’ as its own state, resolve it by request key, and only then retry or fail.Proposed patternIntegration · Resilience · ERP
  2. ADR / 004Separate commercial approval from financial validationTwo decisions with different owners, evidence and SLAs should not share one approval step—even when one form collects the data for both.Proposed patternProcess · Governance · ERP
  3. ADR / 008Run reconciliation as a permanent control, not an exception processDelivery guarantees fail silently. A scheduled comparison of expected and actual populations—with an owner for every kind of difference—is part of the architecture, not cleanup.Proposed patternIntegration · Data · Governance
  4. ADR / 005Separate commercial identity from legal customer identityAn account is a commercial relationship; a legal entity is a registered organization; an ERP customer is that entity in one of our companies. Model three linked identities—not one record that means all of them.Proposed patternIdentity · CRM · ERP