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, while leaving room for additional card settings in the public contract.

Overview

Adds a nested cardConfigs object to platform config responses and PATCH /config. Its first setting, cardConfigs.maxSpendPerTransaction, is a platform-level cap: a positive int64 sets it, 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 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's existing warning set and no errors
  • git diff --check

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Aug 26, 2026 5:32pm
grid-wallet-demo Ignored Ignored Preview Aug 26, 2026 5:32pm

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 new note diagnostic, which is a regression from the base state.
generate ⚠️build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/a431b9989d64eb49a0eb9f83672221a3b9cb8205/dist.tar.gz
New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`
grid-openapi studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️

New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`
grid-ruby studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ✅lint ✅test ✅

New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`
grid-go studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@964810afcc01dc6fff8f35b8b2defef3683363b8
New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`
grid-kotlin studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ✅lint ✅test ❗

New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`
grid-python studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/grid-python/7091b315718f5499d2f853a8d3e9a5ce75b4e8ea/grid-0.0.1-py3-none-any.whl
New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`
grid-php studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️lint ✅test ✅

New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`
grid-cli studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ❗lint ❗test ❗

New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CardConfig`

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-26 17:38:38 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

@DhruvPareek
DhruvPareek force-pushed the dp/platform-card-spend-cap-api branch from b59d674 to 0d5bb9a Compare August 26, 2026 17:31
@github-actions github-actions Bot added the breaking-change Introduces a breaking change to the OpenAPI spec label Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Breaking OpenAPI changes detected

oasdiff reports 26 error / 0 warning changes to openapi.yaml.
This PR will need approval from an API reviewer before merge.

Errors (26)

  • POST webhook:agent-action — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:agent-action — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:bulk-upload — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:bulk-upload — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-funding-source-change — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-funding-source-change — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-state-change — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-state-change — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-transaction — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-transaction — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:customer-update — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:customer-update — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:external-account-status — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:external-account-status — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:incoming-payment — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:incoming-payment — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:internal-account-status — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:internal-account-status — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:invitation-claimed — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:invitation-claimed — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:outgoing-payment — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:outgoing-payment — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:test-webhook — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:test-webhook — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:verification-update — removed the enum value WALLET_OPERATION.COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:verification-update — removed the enum value WALLET_OPERATION.FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].

Detected by oasdiff. Full report: job summary or the oasdiff-report artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Introduces a breaking change to the OpenAPI spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant