Skip to content

feat(cards): add PENDING_AUTH funding authorization status - #1108

Merged
DhruvPareek merged 6 commits into
mainfrom
dp/card-pending-api
Oct 9, 2026
Merged

DhruvPareek merged 6 commits into
mainfrom
dp/card-pending-api

Conversation

@DhruvPareek

@DhruvPareek DhruvPareek commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Reason

A provisioned USDB Embedded Wallet card cannot fund purchases until its delegated signing key is usable. Exposing it as ACTIVE hides the remaining signed authorization steps, including when an active USD card is switched to USDB.

Overview

  • Add server-managed PENDING_AUTH and DELEGATION_REQUIRED to the public card lifecycle.
  • Show terminal CLOSED transitions in both USD and USDB lifecycle diagrams, including closure from pending and frozen cards.
  • Document provisioning to PENDING_AUTH, USD-to-USDB and key-revocation transitions to PENDING_AUTH, PENDING_AUTH → FROZEN status-change webhooks, and automatic activation after the final delegated-key retry or a switch back to USD.
  • Preserve PROCESSING, FROZEN, and CLOSED during delegation completion. Explicit activation without usable delegation returns 409 INVALID_STATE_TRANSITION; callers cannot request PENDING_AUTH.
  • Add PENDING_AUTH-related issuance, funding, delegated-key, and webhook documentation and examples. Align the Embedded Wallet guide with pending status after key revocation, CARD_NOT_ACTIVE declines on new synchronous authorizations, and recovery through both signed retries. Preserve the existing state definitions and asynchronous issuance wording, and rebuild both bundled specifications.
  • Remove the unused global Mintlify install from the lint workflow. make lint uses the tools installed by npm ci; the global install was failing on an unpublished dependency before lint ran.

The webdev implementation is separately gated by card_program.pending_state.enabled, default off. Coordinate this contract with webdev #36815 (generated artifacts) and the implementation stack: core lifecycle #36857, delegation/backfill #36859, issuer provisioning #36860, and dashboard #36816. Publishing these docs does not enable the rollout. The webdev stack has been rebased and validated against current main.

The card status PENDING_AUTH distinguishes funding authorization from PENDING_KYC. Delegated keys retain their separate PENDING status.

Test Plan

  • make build — passed; regenerated openapi.yaml and mintlify/openapi.yaml.

  • make lint — passed with 0 errors and existing warnings/informational findings.

  • node_modules/.bin/markdownlint mintlify/snippets/cards/funding-sources.mdx mintlify/snippets/cards/implementation-overview.mdx mintlify/snippets/cards/intro.mdx mintlify/snippets/cards/issuing-cards.mdx mintlify/snippets/cards/quickstart.mdx mintlify/snippets/cards/webhooks.mdx — passed.

  • git diff --check — passed.

  • node_modules/.bin/markdownlint mintlify/snippets/cards/embedded-wallet-funding.mdx — passed after aligning the pending/revocation guidance.

  • CI refresh: restacked onto Grid API main at a80638013eadc4675ddbd762cca83e4851bf4a14; npm run lint passed with 0 errors, Markdown lint passed for all changed card snippets, and the bundled source matches webdev’s vendored spec byte-for-byte. The webdev grid-api-spec check still requires this PR to merge before the generated-artifact PR.

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
grid-cards-demo Ignored Ignored Preview Oct 8, 2026 10:58pm UTC
grid-flow-builder Ignored Ignored Preview Oct 8, 2026 10:58pm UTC
grid-wallet-demo Ignored Ignored Preview Oct 8, 2026 10:58pm UTC

Request Review

@mintlify

mintlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Grid 🟢 Ready View Preview Oct 8, 2026, 10:58 PM

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Critical risk] Adds new card funding authorization status to public API contract.

The PR appears safe to merge, with non-blocking documentation inconsistencies to correct.

Findings

  1. P2 Revocation guidance conflicts ▶
  2. P2 Pending freeze event omitted ▶
  3. P2 Already-active response needs handling ▶
  4. P2 Lifecycle state count is stale ▶
Fix with agent prompt
### Issue 1
openapi/paths/auth/auth_delegated-keys_{id}.yaml:48-50
The new contract says revoking a delegated key moves an active card to `PENDING`, but the Embedded Wallet funding guide still says the card stays `ACTIVE` and every authorization declines. Please align the guide so integrators expect the right status and troubleshoot a missing key using the right flow.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
openapi/webhooks/card-status-change.yaml:5-8
PATCH permits `PENDING → FROZEN` and sends a status-change webhook for every successful status transition, but this event list does not include that transition. Add it here and in the webhook guide so consumers know to handle a pending card being frozen.

### Issue 3
mintlify/snippets/cards/quickstart.mdx:49-53
The quickstart now says creation can return an `ACTIVE` card, then directs readers to wait for an activation webhook. An already-active response needs no later activation transition, so a reader could wait for an event that never follows. Tell readers to use that response directly and wait for the webhook only when activation is still pending.

```suggestion
The card returns `status: "PROCESSING"` if issuer provisioning is still
in progress. Synchronous provisioning can return `ACTIVE` for USD funding
or `PENDING` for USDB funding awaiting delegated signing authorization.
`platformCardId` is generated by the server, and any value supplied in the
request is ignored. If the response is already `ACTIVE`, use it directly.
Otherwise, when activation completes, a `CARD.STATUS_CHANGE` webhook fires
with `status: "ACTIVE"`:
```

### Issue 4
mintlify/snippets/cards/intro.mdx:32
Adding `PENDING` brings this table to six states, while the introduction still says five. Update the count so the overview matches the public lifecycle it presents.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR adds a server-managed PENDING card status for provisioned USDB-funded cards awaiting delegated signing authorization, updates lifecycle and webhook documentation, regenerates both OpenAPI bundles, and removes an unused global Mint installation from lint CI.

  • The contract distinguishes issuer provisioning from funding readiness and documents automatic status changes on delegation, revocation, and funding-source replacement.
  • Several card guides still need alignment with the new lifecycle, particularly revocation and synchronous issuance.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  PROCESSING -->|USD or usable delegation| ACTIVE
  PROCESSING -->|USDB, delegation needed| PENDING
  PENDING -->|delegation completes or USD funding| ACTIVE
  ACTIVE -->|required key revoked or USDB funding lacks key| PENDING
  PENDING -->|platform freezes| FROZEN
  ACTIVE <--> FROZEN
  PENDING --> CLOSED
  ACTIVE --> CLOSED
  FROZEN --> CLOSED
Loading

Reviews (1) · Last reviewed commit: "fix(ci): use locked dependencies for doc..."

Comment on lines +48 to +50
Revoke an `ACTIVE` delegated signing key. An active card using this funding
source becomes `PENDING` with `statusReason: "DELEGATION_REQUIRED"`. Frozen
and closed cards retain their status. Grid uses the custodied

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Revocation guidance conflicts The new contract says revoking a delegated key moves an active card to PENDING, but the Embedded Wallet funding guide still says the card stays ACTIVE and every authorization declines. Please align the guide so integrators expect the right status and troubleshoot a missing key using the right flow.

Knowledge Base Used: Cards API

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/auth/auth_delegated-keys_{id}.yaml
Line: 48-50

Comment:
**Revocation guidance conflicts** The new contract says revoking a delegated key moves an active card to `PENDING`, but the Embedded Wallet funding guide still says the card stays `ACTIVE` and every authorization declines. Please align the guide so integrators expect the right status and troubleshoot a missing key using the right flow.

**Knowledge Base Used:** [Cards API](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/cards-api.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread openapi/webhooks/card-status-change.yaml Outdated
Comment thread mintlify/snippets/cards/quickstart.mdx Outdated
Comment thread mintlify/snippets/cards/intro.mdx Outdated
PROCESSING ──► ACTIVE ◄──► FROZEN
│
└──► CLOSED
USD: PROCESSING ──► ACTIVE ◄──► FROZEN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, this is missing PENDING_KYC?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe we remove PENDING_KYC and make sure its represented as a statusReason?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also just curious but what if it needs KYC AND delegation. Are we sure this will still work properly in that case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea if we need KYC and delegation, we are in PROCESSING status because something still needs to be done on our side. If:
- KYC completes, status moves to PENDING
- Delegation completes, status moces to PROCESSING

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PROCESSING is also the status when KYC needs to be approved on our side

| State | When you see it |
|-------|-----------------|
| `PROCESSING` | Returned synchronously from `POST /cards`. The card cannot transact yet. |
| `PENDING` | The issuer has provisioned the card, but its USDB Embedded Wallet funding source has no active delegated key. Complete delegated-key setup. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this more specific? PENDING_DELEGATED_AUTH?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nvm i see 'statusReason'

@ls-bolt

ls-bolt Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🦣 Congratulations @benwgold - your substantive review earned a Giant moa! (common)

Female giant moa towered over males and were among the tallest birds known.

View your Frost-dex: https://zeus.dev.dev.sparkinfra.net/#/dinodex/benwgold?section=ice-age

enum:
- PENDING_KYC
- PROCESSING
- PENDING

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we call it PENDING_AUTH or NEEDS_AUTH, i feel like PENDING is kinda confusing with PENDING_KYC

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@ls-bolt

ls-bolt Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🦣 Congratulations @shreyav - your substantive review earned a Sinomastodon! (common)

This short-jawed gomphothere lived across eastern Asia into the Early Pleistocene.

View your Frost-dex: https://zeus.dev.dev.sparkinfra.net/#/dinodex/shreyav?section=ice-age

@DhruvPareek DhruvPareek changed the title feat(cards): add PENDING funding authorization status feat(cards): add PENDING_AUTH funding authorization status Oct 7, 2026

DhruvPareek commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Oct 9, 12:06 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 9, 12:07 AM UTC: @DhruvPareek merged this pull request with Graphite.

@DhruvPareek
DhruvPareek merged commit dec16da into main Oct 9, 2026
11 checks passed
@DhruvPareek
DhruvPareek deleted the dp/card-pending-api branch October 9, 2026 00:07

This branch was successfully deployed

1 active deployment
staging - mintlify — fc54e5a5 Deployed Oct 8, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants