feat: document SCA_SESSION_REQUIRED (409) and ACCOUNT_LOCKED (423) on quote authorize - #761
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile Summary⚔️☠️🎸 THE SCA ERROR CODE DRAGON NOW ROARS IN THE OPENAPI ABYSS! 🎸☠️⚔️
Confidence Score: 5/5The PR appears safe to merge, with the source specification and both generated bundles consistently documenting the existing error responses. The shared error enum, endpoint response definitions, and generated artifacts follow the repository’s established OpenAPI conventions without introducing a concrete contract, build, or security failure.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/errors/Error409.yaml | Adds the existing SCA_SESSION_REQUIRED backend error to the shared 409 error-code contract using the repository’s established status-level enum convention. |
| openapi/paths/quotes/quotes_{quoteId}_authorize.yaml | Documents the missing-session 409 recovery flow and adds the existing Error423 response for temporarily locked customer logins. |
| openapi.yaml | Regenerated root bundle accurately mirrors the modular path and error-schema changes. |
| mintlify/openapi.yaml | Regenerated Mintlify bundle remains synchronized with the root OpenAPI bundle. |
Reviews (1): Last reviewed commit: "feat: document SCA_SESSION_REQUIRED (409..." | Re-trigger Greptile

Summary
Two error codes the API already returns were missing from the spec, so a generated client rejected the response instead of surfacing the code.
SCA_SESSION_REQUIREDadded to theError409codeenum. The API returns this with HTTP 409 when the customer's Strong Customer Authentication login session is missing or expired. Because it was absent from the enum, a generated client raised a validation error while deserializing the response — so an integrator got an opaque failure rather than a code they could act on. It is deliberately distinct from a401, which means the platform's API credentials were rejected: a401is not customer-recoverable, whereasSCA_SESSION_REQUIREDmeans "re-authenticate the customer, then retry".POST /quotes/{quoteId}/authorizenow documents409 SCA_SESSION_REQUIREDand423 ACCOUNT_LOCKED. This is the endpoint that surfaces both. Its409description previously covered only the "SCA not required / no pending challenge" cases, and it declared no423at all — even though the endpoint returnsACCOUNT_LOCKEDwhen the customer's login is temporarily locked after too many failed authorization attempts.Error423already existed and needed no change; this just references it.Both changes are additive and non-breaking, so
info.versionstays2025-10-13.Known limitation this does not fix
While verifying the above against the running implementation, I found that the error envelope does not match what the
ErrorNNNschemas declare. The API sends:{"code": "SCA_SESSION_REQUIRED", "reason": "..."}but every
ErrorNNNschema requiresstatus,code, andmessage. So a generated Python client rejects a real error body onstatus(int_type) andmessage(string_type) regardless of this change:This is pre-existing and applies to every documented error response across the spec, not just the two codes here — it is not introduced by this PR, and this PR is still a strict improvement (the enum is the published contract, and integrators reading the raw JSON body now have the code documented). But it does mean the typed-model path is not yet usable for error handling, so reconciling the envelope is worth its own change. Two options, both spec-wide decisions I did not want to make unilaterally: make the server emit
status/message, or change the schemas to match reality (reason, andstatusnot required).Relatedly,
Error423's own description points readers atdetails.lockedUntil/details.failedAttempts, but no error path populates them — those fields appear only on the200body ofPOST /sca/record-event. I left that description alone rather than expand this PR's scope, and worded the new423on the authorize endpoint to promise only what is actually sent.Test plan
make lintexits 0 (Redocly + Spectral,--fail-severity=error); the 630 remaining findings are pre-existing warnings/infos, 0 errors.make buildrebundledopenapi.yamlandmintlify/openapi.yaml; re-running it is a no-op, so the committed bundles byte-match the build output.423case is newly covered by a test added alongside this change. The423body was captured directly to confirm the wording matches what is sent.Public
Documents two error codes the Grid API already returns:
SCA_SESSION_REQUIRED(409) is added to the sharedError409enum, andPOST /quotes/{quoteId}/authorizenow documents both it and423 ACCOUNT_LOCKED.Original PR: #759