Skip to content

docs(cards): drop the never-emitted REFUNDED card transaction status - #903

Open
AaryamanBhute wants to merge 2 commits into
mainfrom
aaryaman/drop-card-refunded-status
Open

docs(cards): drop the never-emitted REFUNDED card transaction status#903
AaryamanBhute wants to merge 2 commits into
mainfrom
aaryaman/drop-card-refunded-status

Conversation

@AaryamanBhute

Copy link
Copy Markdown
Contributor

Reason

Grid stopped deriving REFUNDED for card transactions in lightsparkdev/webdev#30710 (2026-07-20). A merchant return leaves the transaction SETTLED and reports the returned value in refundedAmount; the server enum, the status derivation, and the webhook type mapper have not carried REFUNDED since. That PR noted the spec change belonged here and left it undone, so the published CardTransactionStatus value, the CARD_TRANSACTION.REFUNDED webhook type, and the sandbox return / return-reversal descriptions have documented a transition that never fires.

No integrator ever received it: card transaction webhooks only started firing on 2026-08-11, and the only production card traffic postdates the change.

Overview

  • CardTransactionStatus: remove REFUNDED; the SETTLED row now says a return does not change the status and shows up in refundedAmount.
  • WebhookType and CardTransactionWebhook: remove CARD_TRANSACTION.REFUNDED. The webhook description and its "returned by the merchant" example now describe a CARD_TRANSACTION.SETTLED delivery.
  • Sandbox return and return-reversal simulators, plus SandboxCardReturnRequest: reworded around refundedAmount. Return reversal requires a non-zero refundedAmount, which is what the server checks.
  • Mintlify card snippets (implementation overview, terminology, reconciliation, sandbox testing): same correction.

No info.version bump: nothing observable changes, the value was never emitted.

Webdev side (dead enum member, dashboard leftover): lightsparkdev/webdev#34465.

Test plan

make build and npm run lint:openapi (Redocly + Spectral) pass with no new findings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EvF4PtTuGgETX8vFnsYEjQ

Grid stopped deriving REFUNDED for card transactions in webdev#30710
(2026-07-20): a merchant return leaves the transaction SETTLED and
reports the returned value in refundedAmount. The server enum, the
status derivation, and the webhook type mapper have not carried
REFUNDED since, so the published CardTransactionStatus value, the
CARD_TRANSACTION.REFUNDED webhook type, and the sandbox return /
return-reversal descriptions documented a transition that never fires.

Remove the value and the webhook type, reword the return simulators
and the card docs snippets around refundedAmount, and turn the webhook
example for a returned purchase into a SETTLED delivery.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvF4PtTuGgETX8vFnsYEjQ
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated
grid-flow-builder Ignored Ignored Preview Sep 5, 2026 7:55am UTC
grid-wallet-demo Ignored Ignored Preview Sep 5, 2026 7:55am UTC

Request Review

@mintlify

mintlify Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

Project Status Preview Updated
Grid 🟢 Ready View Preview Sep 5, 2026, 6:50 AM

@github-actions github-actions Bot added the breaking-change Introduces a breaking change to the OpenAPI spec label Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Breaking OpenAPI changes detected

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

Errors (17)

  • POST webhook:agent-action — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:agent-action — removed the enum value REFUNDED of the request property allOf[subschema #2]/data/transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #3: Card Transaction]/status [request-property-enum-value-removed].
  • POST webhook:bulk-upload — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-funding-source-change — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-state-change — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-transaction — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:card-transaction — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[subschema #2]/type [request-property-enum-value-removed].
  • POST webhook:card-transaction — removed the enum value REFUNDED of the request property allOf[subschema #2]/data/status [request-property-enum-value-removed].
  • POST webhook:customer-update — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:external-account-status — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:incoming-payment — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:internal-account-status — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:invitation-claimed — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:outgoing-payment — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:test-webhook — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:verification-update — removed the enum value CARD_TRANSACTION.REFUNDED of the request property allOf[#/components/schemas/BaseWebhook]/type [request-property-enum-value-removed].
  • POST webhook:wallet-operation — removed the enum value CARD_TRANSACTION.REFUNDED 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.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

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

cli

docs(api): clarify refund behavior in sandbox card simulate return

go

fix(types): remove REFUNDED status from card transaction and webhook types

kotlin

fix(types): remove REFUNDED status from CardTransaction and CardTransactionWebhookEvent

openapi

fix(types): remove REFUNDED status from card transactions and webhook events

php

fix(types): remove REFUNDED from CardTransaction status and webhook event enums

python

fix(types): remove REFUNDED from CardTransaction status and webhook events

ruby

fix(types): remove REFUNDED from CardTransaction status and webhook event enums

typescript

fix(types): remove REFUNDED status from CardTransaction and webhook events

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 "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/1b13726cd9215c4e910fe7684e4d71c9986c3a29/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 a failure in the build CI job, which is a regression from the base state.
generate ✅build ❗ (prev: build ✅) → lint ✅test ✅

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-go studio · code · diff

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

go get github.com/stainless-sdks/grid-go@f3aad16c9ccf703f5c734c2535cc2c93582f4961
grid-python studio · code · diff

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

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

Your SDK build had at least one "note" 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-09-05 07:59:56 UTC

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR aligns the public card documentation and OpenAPI schemas with the implemented return behavior:

  • Removes the never-emitted card REFUNDED status and CARD_TRANSACTION.REFUNDED webhook type.
  • Documents returns as repeated SETTLED deliveries carrying an updated refundedAmount.
  • Updates sandbox return and return-reversal descriptions and Mintlify card guidance.
  • The enum removals alter generated public types without the version transition required for breaking specification changes.

Confidence Score: 4/5

The PR should not merge until the breaking enum removals are released under a new matching API version and server path; the return-reversal result should also be clarified.

The documentation consistently reflects same-status returns, but removing two published enum members changes generated SDK contracts while retaining the existing API version, violating the repository's breaking-change versioning requirement.

Files Needing Attention: openapi/components/schemas/cards/CardTransactionStatus.yaml, openapi/components/schemas/webhooks/WebhookType.yaml, openapi/paths/sandbox/cards/sandbox_cards_{id}_simulate_return_reversal.yaml

Important Files Changed

Filename Overview
openapi/components/schemas/cards/CardTransactionStatus.yaml Removes a published enum member and documents returns as preserving SETTLED, but does so without the required API version transition.
openapi/components/schemas/webhooks/WebhookType.yaml Removes the public CARD_TRANSACTION.REFUNDED webhook enum member, contributing to the unversioned generated-client contract change.
openapi/webhooks/card-transaction.yaml Consistently updates webhook prose and examples to use CARD_TRANSACTION.SETTLED with refundedAmount.
openapi/paths/sandbox/cards/sandbox_cards_{id}_simulate_return_reversal.yaml Corrects the reversal precondition but leaves the resulting effect on refundedAmount undocumented.
mintlify/snippets/cards/reconciliation.mdx Updates the card lifecycle diagram and status table consistently with same-status returns.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[AUTHORIZED] --> P[PARTIALLY_SETTLED]
  A --> S[SETTLED]
  P --> S
  P --> E[EXCEPTION]
  S -->|Merchant return| S
  S -. updated refundedAmount .-> W[CARD_TRANSACTION.SETTLED webhook]
Loading
Prompt To Fix All With AI
### Issue 1
openapi/components/schemas/cards/CardTransactionStatus.yaml:3-6
**Unversioned breaking enum removal**

Removing `REFUNDED` and `CARD_TRANSACTION.REFUNDED` changes the public enum types generated for SDKs. Existing consumers that reference either member will fail when they regenerate or upgrade. The repository requires breaking changes to bump `info.version` and use a matching new `servers.url`, but both remain on `2025-10-13`. This version transition must be made before merging. The same issue applies to the removals in `WebhookType.yaml` and `CardTransactionWebhook.yaml`.

### Issue 2
openapi/paths/sandbox/cards/sandbox_cards_{id}_simulate_return_reversal.yaml:3-8
**Reversal result remains unclear**

The revised description makes a non-zero `refundedAmount` the return-reversal precondition, but it does not explain how a successful reversal changes that field. Without saying whether the amount decreases or returns to zero, sandbox users cannot reliably assert the resulting transaction state and may treat it as an irreversible cumulative total.

---

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

Reviews (1): Last reviewed commit: "docs(cards): drop the never-emitted REFU..." | Re-trigger Greptile

Comment thread openapi/components/schemas/cards/CardTransactionStatus.yaml
Comment thread openapi/paths/sandbox/cards/sandbox_cards_{id}_simulate_return_reversal.yaml Outdated
A successful reversal is netted off refundedAmount (a full reversal brings
it back to 0) and the status stays SETTLED, matching the server's
returns-minus-reversals derivation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvF4PtTuGgETX8vFnsYEjQ
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