feat(cards): declare card error codes in Error400/Error409 enums - #814
Conversation
The card endpoints' response descriptions document these codes, but they
were missing from the machine-readable `code` enums, so the generated
typed SDKs reject deserializing them (code_validate_enum fails). Add:
- Error400: CARDHOLDER_KYC_NOT_APPROVED (POST /cards, cardholder KYC not APPROVED)
- Error409: INVALID_STATE_TRANSITION, CARD_ALREADY_CLOSED, CARD_NOT_MUTABLE (PATCH /cards/{id})
These match exactly the codes the Grid implementation now returns.
Re-bundled openapi.yaml + mintlify/openapi.yaml.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile SummaryThe PR synchronizes the machine-readable shared error enums with card error responses already documented by the API.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The new enum values match the documented card response codes, remain synchronized between source schemas and generated bundles, and preserve the repository’s established shared-error-schema workflow.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/errors/Error400.yaml | Adds the cardholder KYC error consistently to the description table and machine-readable 400-code enum. |
| openapi/components/schemas/errors/Error409.yaml | Adds the three card state-conflict errors consistently to the description table and machine-readable 409-code enum. |
| openapi.yaml | Regenerated SDK-facing bundle accurately reflects both source-schema changes. |
| mintlify/openapi.yaml | Regenerated documentation bundle remains identical to the root OpenAPI bundle. |
Reviews (1): Last reviewed commit: "feat(cards): declare card error codes in..." | Re-trigger Greptile
What
The card endpoints already document these error codes in their response descriptions, but the codes were missing from the machine-readable
codeenums onError400/Error409. Since the generated typed SDKs validatecodeagainst those enums on deserialize (code_validate_enum), a client would fail to parse a card error response carrying one of these codes.This adds them so the enums match what the Grid implementation actually returns:
POST /cards):CARDHOLDER_KYC_NOT_APPROVED— cardholder KYC status is notAPPROVED.PATCH /cards/{id}):INVALID_STATE_TRANSITION,CARD_ALREADY_CLOSED,CARD_NOT_MUTABLE.Both the
code.descriptiontable and theenumlist are updated in each source schema;openapi.yamlandmintlify/openapi.yamlare re-bundled.redocly lintpasses.Why now
The Grid implementation change that returns these codes is in webdev (kph/grid-cards-0a-error-codes). Until this lands and the vendored client is regenerated, a strict SDK consumer can't deserialize those error responses.
Note (out of scope, pre-existing)
The
POST /cards400description also mentionsFUNDING_SOURCE_INELIGIBLE, but the implementation does not currently return that code (it returnsINVALID_INPUT), so it is deliberately not added here. That description-vs-implementation gap predates this change and should be closed separately (either implement the code or drop it from the prose).