feat(sandbox): add the card correction simulate endpoint - #1010
ls-bolt[bot] wants to merge 1 commit into
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-typescript studio · code · diff
✅ grid-cli studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-python studio · code · diff
✅ grid-php studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |

Summary
Adds
POST /sandbox/cards/{id}/simulate/correction, so integrators can drive a network correction against a settled card transaction in the sandbox.A correction is an adjustment the card network makes to money it has already moved. The two directions behave differently and the request says which:
DEBITtakes further funds from the cardholder. It is permanent — nothing releases it and no capture settles against it.CREDITreturns funds the network took in error, the way a return does.The resulting card operation is delivered asynchronously via the events webhook, like every other card simulator, and the endpoint 404s in production.
Why the direction is an explicit field
Every card transaction event carries an
effective_polarity(CREDIT | DEBIT) — the network's own statement of which way the money moved. Taking the direction explicitly on the request keeps the simulated event's polarity consistent with its type, so a simulated correction exercises the same direction contract a real one would rather than having it inferred.Changes
openapi/paths/sandbox/cards/sandbox_cards_{id}_simulate_correction.yaml— new path, modelled on the other card simulators (same auth, same error set, same202+SandboxCardSimulationResponse).openapi/components/schemas/cards/SandboxCardCorrectionRequest.yaml— new request body:cardTransactionId,amount,direction.openapi/openapi.yaml— path registration.openapi.yaml/mintlify/openapi.yaml— rebundled vianpm run build:openapi.Testing
npm run build:openapibundles clean.npm run lint(redocly + spectral) reports nothing against the new path or schema; the remaining output is the repo's pre-existingschema-properties-have-examples/-have-descriptionswarnings on unrelated schemas.correctionDebit,correctionCredit) are spelled out on the request body.The implementation of this route lands separately in the internal backend.
Requested by @AaryamanBhute