Skip to content

SDK: add external-sale idempotency helper #399

Closed

Description

@sridharkalaibala

Parent: #34

Problem

External order imports must not duplicate sales when a connector retries. Contributors can add a helper and examples around idempotency keys.

Acceptance criteria

  • Add a helper/example that generates stable idempotency keys from provider, store, external order id, and attempt.
  • Include duplicate retry and changed-payload fixtures.
  • Document what a connector should do after conflict/manual-review responses.
  • Use synthetic order IDs only.

Out of scope

  • Live provider API calls.
  • Rewriting sale storage.

Activity

  1. added
    enhancement
    help wanted
    area: integrations
    size: medium
    area: app platform
    community edition
    area: ecommerce
    on Sep 2, 2026
  2. Tyagiquamar commented on Sep 4, 2026

    @Tyagiquamar
    Contributor

    I traced the retry semantics before opening a PR and wanted to confirm one detail in the acceptance criteria.

    If attempt is the transient network retry counter, including it directly in the idempotency key would make retries produce different identities (attempt=1, attempt=2, etc.), which would defeat deduplication.

    My proposed contract is:

    • logical identity: provider + store + external order id + explicit order/version
    • retry attempt: telemetry only, does not change the idempotency key
    • identical payload retry: same key/hash, return existing sale
    • same logical identity with mutated payload: explicit conflict/manual-review result
    • intentional external-order revision: bump explicit version

    Does that match the intended meaning of attempt here, or was attempt intended to represent the logical order version rather than the transport retry count?

    I have a synthetic-fixture implementation/tests prepared locally, but I want to confirm this semantic before opening the PR.

  3. sridharkalaibala commented on Sep 4, 2026

    @sridharkalaibala
    ContributorAuthor

    Yes — your proposed contract is the intended one. In this issue, \�ttempt\ means the logical external-order revision/version, never the transient transport retry counter. Keep retries telemetry-only; use the same key for an identical retry, return an explicit conflict/manual-review result for a changed payload under the same logical identity, and increment the explicit version only for an intentional external-order revision. Please name the helper parameter \�ersion\ (or document \�ttempt\ as that version) so the distinction is clear, and include the synthetic fixtures you described.

  4. added 2 commits that reference this issue on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: app platformarea: ecommercearea: integrationscommunity editionenhancementhelp wantedsize: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions