Rules›northwind-missing-idempotency-key
northwind-missing-idempotency-key
infonorthwind/reliability/missing-idempotency-key
charges.create is called without the idempotencyKey request option, so a retry — by the SDK, a proxy, or an impatient user — creates a second charge.
15
codebases affected, of 58
26%
of everything we scanned
—
no docs fix scored yet
1
docs commits aimed at this
Where it’s failing
charges.create is called without an idempotencyKey request option.
what we find
what we change it to
Pass a stable key derived from the thing being paid for: northwind.charges.create(params, { idempotencyKey: "order-" + order.id }). Reusing the key returns the original charge instead of creating another.
Metadata
- Category
- reliability
- Type
- suggestion
- Severity
- info
- Recommended
- yes
- Languages
- javascriptpython
Live telemetry
15 / 58 scans
Fired in 26% of scanned codebases.
After every docs commit
docs(api): idempotency key in the create-a-charge example
9d2c05a · merged 2 weeks ago · PR drafted by api-doctor
A fix for your docs page
Wherever this rule fires, a page on your docs site taught it. api-doctor writes the edit and opens it as a pull request on your docs repo — you review and merge.
Draft a docs fix for this rule
api-doctor writes the docs change from the fire pattern — you review it
History
Name the retried call in the lint message
1 week ago · via GitHub
Exempt charges created inside an explicit dedupe transaction
6 weeks ago · via GitHub
Initial rule — charges.create without an idempotency key
12 weeks ago · via GitHub