Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions mintlify/snippets/cards/freezing-and-closing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ credential revocation and wallet export. This page covers the flow,
what each transition does, and how to handle the signing step.


`PATCH /cards/{id}` covers both freeze / unfreeze (`state`) and funding
source updates (`fundingSources`); see
`PATCH /cards/{id}` covers freeze / unfreeze (`state`), funding source
updates (`fundingSources`), and per-transaction spending limits
(`maxSpendPerTransaction`). See
[Funding sources](/cards/card-management/funding-sources) for the
funding-source-only flow. The signed-retry mechanics below apply to all
three.
fields.

## Valid state transitions

Expand Down Expand Up @@ -126,6 +127,24 @@ curl -X PATCH "$GRID_BASE_URL/cards/Card:019542f5-b3e7-1d02-0000-000000000010" \
`409 CARD_ALREADY_CLOSED` is returned if the card is already in the
terminal `CLOSED` state.

## Updating the per-transaction limit

To set or change the per-transaction spending limit:

```bash
curl -X PATCH "$GRID_BASE_URL/cards/Card:019542f5-b3e7-1d02-0000-000000000010" \
-u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
Comment on lines +135 to +136

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.

P1 Signed-retry flow contradicts PATCH contract

When a developer follows this new limit-update example, the guide requires a prior 202 challenge plus Grid-Wallet-Signature and Request-Id, while the current PATCH /cards/{id} contract uses platform credentials and returns 200 directly. The developer therefore waits for a challenge and request ID that the endpoint never returns, preventing completion of the documented update flow.

Knowledge Base Used: Mintlify Documentation Site

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/snippets/cards/freezing-and-closing.mdx
Line: 135-136

Comment:
**Signed-retry flow contradicts PATCH contract**

When a developer follows this new limit-update example, the guide requires a prior `202` challenge plus `Grid-Wallet-Signature` and `Request-Id`, while the current `PATCH /cards/{id}` contract uses platform credentials and returns `200` directly. The developer therefore waits for a challenge and request ID that the endpoint never returns, preventing completion of the documented update flow.

**Knowledge Base Used:** [Mintlify Documentation Site](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/mintlify-docs-site.md)

---

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

-H "Content-Type: application/json" \
-H "Grid-Wallet-Signature: <base64 signature>" \
-H "Request-Id: <requestId from prior 202>" \
-d '{ "maxSpendPerTransaction": 10000 }'
```

Supply a positive integer to set the limit (in the smallest unit of the
card's currency) or `null` to clear it. Omitting the field leaves the
current limit unchanged. `maxSpendPerTransaction` cannot be supplied
alongside `state: CLOSED`.

## Sandbox behavior

In Sandbox the state changes are instant — no issuer round-trip is
Expand Down
4 changes: 3 additions & 1 deletion mintlify/snippets/cards/issuing-cards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ curl -X POST "$GRID_BASE_URL/cards" \
"form": "VIRTUAL",
"fundingSources": [
"InternalAccount:019542f5-b3e7-1d02-0000-000000000002"
]
],
"maxSpendPerTransaction": 5000
}'
```

Expand All @@ -24,6 +25,7 @@ curl -X POST "$GRID_BASE_URL/cards" \
| `platformCardId` | No | Your own identifier. System-generated when omitted, mirroring `platformCustomerId`. |
| `form` | Yes | `VIRTUAL` in v1. `PHYSICAL` will be added later. |
| `fundingSources` | Yes | Ordered array of `InternalAccount` ids. Each must belong to the cardholder and share one card-eligible currency. The first entry is tried first by Authorization Decisioning. |
| `maxSpendPerTransaction` | No | Largest amount a single card transaction may authorize, in the smallest unit of the card's currency. Omit for no limit. Supported only for card programs where Grid makes the authorization decision. |

The card's `currency` is derived from the funding sources at issue time
and surfaces on the returned `Card` resource — all bound sources share
Expand Down
Loading