Skip to content

feat(cards): add a platform per-transaction spending cap - #865

Open
DhruvPareek wants to merge 1 commit into
mainfrom
dp/platform-card-spend-cap-api
Open

feat(cards): add a platform per-transaction spending cap#865
DhruvPareek wants to merge 1 commit into
mainfrom
dp/platform-card-spend-cap-api

Conversation

@DhruvPareek

@DhruvPareek DhruvPareek commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Reason

Platforms need one reversible control that caps every Grid-decided card transaction without destroying stricter per-card settings.

Overview

Adds maxCardSpendPerTransaction to platform config responses and PATCH /config. A positive int64 sets the platform cap, omission preserves it, and null clears it. Grid enforces the lower of this cap and each card-specific maxSpendPerTransaction; the contract states that the cap applies immediately to existing and future cards while provider-decided card programs remain unaffected.

Updates card create, update, and response documentation to distinguish the stored card-specific cap from the effective enforced limit. This PR defines the source OpenAPI contract only; generated Webdev artifacts and server implementation follow in separate Webdev PRs.

Test Plan

  • make build
  • make lint — passed with the repository existing warning set and no errors

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
grid-wallet-demo Building Building Preview Aug 25, 2026 9:33pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Aug 25, 2026 9:33pm

Request Review

@mintlify

mintlify Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Aug 25, 2026, 9:34 PM

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

feat(api): add max_card_spend_per_transaction parameter to config update

go

feat(api): add maxCardSpendPerTransaction to config

kotlin

feat(api): add maxCardSpendPerTransaction field to platform config

openapi

feat(api): add maxCardSpendPerTransaction field to platform configuration

php

feat(api): add maxCardSpendPerTransaction parameter to config

python

feat(api): add max_card_spend_per_transaction to config

ruby

feat(api): add max_card_spend_per_transaction to platform config

typescript

feat(api): add maxCardSpendPerTransaction to platform config

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-typescript studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/38fd35e4f3995465bbdaa7abdde03bd933dc0048/dist.tar.gz
grid-openapi studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️

grid-ruby studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ✅test ✅

grid-go studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@d463781c7b06fa4abac04e23d03cceaaa402e41c
grid-kotlin studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ✅test ❗

grid-python studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/grid-python/a2034e7af32869d7ce7be35998a680fe931c2670/grid-0.0.1-py3-none-any.whl
grid-php studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️lint ✅test ✅

grid-cli studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ❗lint ❗test ❗


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-08-25 21:38:49 UTC

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds an optional, nullable platform-wide per-transaction card spending cap to the platform configuration contract and documents that Grid enforces the lower of the platform and card-specific caps.

  • Defines positive-int64 set, omission-preserves, and null-clears semantics for PATCH /config.
  • Clarifies that card responses retain the configured card-specific cap rather than reporting the effective cap.
  • Applies the platform cap to existing and future Grid-decided cards while excluding provider-decided programs.
  • Rebuilds both checked-in OpenAPI bundles from the modular source.

Confidence Score: 5/5

The contract change appears safe to merge, with no concrete blocking or independently actionable non-blocking defect identified.

The new field follows the established nullable int64 pattern, preserves omission-versus-null semantics in the contract, consistently distinguishes stored and effective card limits, and appears in both generated bundles.

Important Files Changed

Filename Overview
openapi/components/schemas/config/PlatformConfig.yaml Adds the nullable platform-level card cap to configuration responses with its scope and immediate-effect semantics.
openapi/components/schemas/config/PlatformConfigUpdateRequest.yaml Adds consistent tri-state update semantics using the repository’s established nullable-int64 schema pattern.
openapi/components/schemas/cards/Card.yaml Clarifies that the returned card field is the stored card-specific cap and not the lower effective limit.
openapi/paths/platform/config.yaml Documents the new PATCH behavior and includes the cap in the request example.
openapi/paths/cards/cards.yaml Updates card issuance documentation to explain interaction between card and platform caps.
openapi/paths/cards/cards_{id}.yaml Updates card modification documentation while preserving existing set, clear, and closed-card constraints.
openapi.yaml Generated root bundle is aligned with the modular OpenAPI source.
mintlify/openapi.yaml Generated Mintlify contract is aligned with the modular OpenAPI source.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    P[Platform maxCardSpendPerTransaction] --> E{Both caps configured?}
    C[Card maxSpendPerTransaction] --> E
    E -->|Yes| L[Effective limit = lower value]
    E -->|Platform only| P1[Effective limit = platform cap]
    E -->|Card only| C1[Effective limit = card cap]
    E -->|Neither| N[No Grid per-transaction cap]
    G{Who decides authorization?} -->|Grid| E
    G -->|Provider| U[Platform cap does not apply]
Loading

Reviews (1): Last reviewed commit: "feat(cards): add a platform per-transact..." | Re-trigger Greptile

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.

1 participant