Skip to content

add the sandbox authorization reversal and expiry simulators to the spec - #919

Merged
shreyav merged 1 commit into
mainfrom
claude/sandbox-authorization-reversal-expiry
Sep 9, 2026
Merged

add the sandbox authorization reversal and expiry simulators to the spec#919
shreyav merged 1 commit into
mainfrom
claude/sandbox-authorization-reversal-expiry

Conversation

@shreyav

@shreyav shreyav commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

POST /sandbox/cards/{id}/simulate/authorization_reversal and POST /sandbox/cards/{id}/simulate/authorization_expiry have been live for some time but were never in the spec, so generated clients could not call them and integrators had no way to discover them.

The return_reversal endpoint's description went further and stated that neither existed:

Note: authorization reversal / void has no dedicated card-issuer simulate path (the void simulator emits a distinct VOID event), so — like authorization expiry — it is not exposed here.

Both are documented now and that note is gone.

What changed

Two new paths

  • simulate/authorization_reversal — a merchant cancelling an authorization before it settles, in full or in part. Takes a new SandboxCardReversalRequest: the transaction plus an optional amount. Omit amount to reverse the whole authorization; send one to reverse only that much. The schema does not admit 0 — leaving the field out is the only way to express a full reversal, the same shape as the return simulator's amount. Same production-platform gating as simulate/authorization.
  • simulate/authorization_expiry — the card network letting an authorization lapse because the merchant never followed through. Reuses SandboxCardTransactionRefRequest, whose description now names both of its callers. Sandbox-only, like return_reversal.

Both act on an authorization that is still fully open with nothing settled, since the issuer's void simulator rejects a partially-cleared one. Both return 202 with the issuer transaction token and land their result via the events webhook, matching the other simulators.

The descriptions are written for an integrator deciding whether to call the endpoint — what real-world event it stands in for and what to expect afterwards — rather than for someone who already knows the issuer's event names.

Corrected prose — the incorrect note in return_reversal is removed.

Lint config — the two paths join the kebab-case allowlist in .spectral.yaml for the same reason the other simulators are there: they mirror the issuer's routes verbatim and the SDK must call those exact URLs.

Breaking-change check

Additive only: two new paths and one new request schema. No existing path, schema, or enum value changes. Nothing a client has already received is affected.

Test plan

This is a spec + docs repo with no application code, so verification is the spec toolchain:

  • npm run lint:openapi — Redocly validates clean at 55 warnings, one fewer than main. Spectral is 901 problems / 0 errors / 179 warnings, identical to main when both are linted in place.
  • npm run build:openapi — rebundled openapi.yaml and mintlify/openapi.yaml; the two are identical, and the bundle diff contains exactly the source edits.
  • Both new request bodies round-trip through the bundled schema: a reversal with and without amount, and an expiry with only cardTransactionId.

🤖 Generated with Claude Code

@mintlify

mintlify Bot commented Sep 9, 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 9, 2026, 5:37 PM

@vercel

vercel Bot commented Sep 9, 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 9, 2026 6:48pm UTC
grid-wallet-demo Ignored Ignored Preview Sep 9, 2026 6:48pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 9, 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: add the sandbox authorization reversal and expiry simulators to the spec

go

feat: add the sandbox authorization reversal and expiry simulators to the spec

kotlin

feat: add the sandbox authorization reversal and expiry simulators to the spec

openapi

feat: add the sandbox authorization reversal and expiry simulators to the spec

php

feat: add the sandbox authorization reversal and expiry simulators to the spec

python

feat: add the sandbox authorization reversal and expiry simulators to the spec

ruby

feat: add the sandbox authorization reversal and expiry simulators to the spec

typescript

feat: add the sandbox authorization reversal and expiry simulators to the spec
grid-typescript studio
grid-openapi studio
grid-ruby studio
grid-kotlin studio
grid-go studio
grid-python studio
grid-php studio
grid-cli studio

⏳ These are partial results; builds are still running.


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-09 19:07:47 UTC

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge with no actionable contract, documentation, or security failures identified.

Summary

  • Documents full and partial authorization reversal through a new request schema.
  • Documents authorization expiry using the existing card-transaction reference request.
  • Preserves the established Basic authentication, asynchronous webhook delivery, issuer-token correlation, and sandbox error-response patterns.
  • Updates generated bundles, Spectral path exceptions, and the public changelog consistently.

Diagram

sequenceDiagram
  participant Client
  participant SandboxAPI as Sandbox API
  participant Issuer
  participant Webhook as Events webhook
  Client->>SandboxAPI: POST authorization_reversal or authorization_expiry
  SandboxAPI->>Issuer: Simulate operation on open authorization
  SandboxAPI-->>Client: 202 + issuerTransactionToken
  Issuer-->>Webhook: Resulting card operation
Loading

shreyav added a commit that referenced this pull request Sep 9, 2026
…tall (#922)

## Summary

The `Lint Code & Documentation` job runs `sudo apt-get update && sudo
apt-get install -y libsecret-1-dev` before anything else. `apt-get
update` exits non-zero if *any* configured source fails a hash check —
and the `ubuntu-latest` runner image ships Google's Chrome apt source,
which this job never installs from.

When that mirror is mid-republish it serves a `Packages.gz` that doesn't
match its own `Release` file, and the whole job dies in setup before
`npm ci` or a single lint rule runs. That happened on #919 twice in a
row today, ten minutes apart, with the identical hash mismatch both
times:

```
E: Failed to fetch https://dl.google.com/linux/chrome-stable/deb/dists/stable/main/binary-amd64/Packages.gz  Hash Sum mismatch
   Last modification reported: Wed, 09 Sep 2026 09:41:12 +0000
   Release file created at: Wed, 09 Sep 2026 17:16:59 +0000
##[error]Process completed with exit code 100.
```

Every check that actually exercises the spec on that PR —
breaking-change detection, both OpenAPI builds, preview, Mintlify — was
green. The lint job was red only because an unrelated third-party mirror
had a veto over it.

## What changed

One step. The Chrome apt source list is removed before `apt-get update`:

```yaml
sudo rm -f /etc/apt/sources.list.d/google-chrome*.list
sudo apt-get update && sudo apt-get install -y libsecret-1-dev
```

Nothing about what gets installed changes. `libsecret-1-dev` still
installs from Ubuntu's own archive; a mirror this job doesn't use just
loses the ability to fail it.

## Test plan

- The workflow YAML parses; the job still has six steps and the install
step still references `libsecret-1-dev`.
- This is the standard mitigation for this runner-image behaviour, and
it's purely subtractive — it can't make the install pull from anywhere
it didn't already.
- Worth knowing for review: `.github/workflows/` is not in the Lint
workflow's own `paths:` filter, so the real lint job won't run on this
PR; `dummy.yml` reports the check instead. The actual validation is #919
going green once it's rebased onto this.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
_Generated by [Claude
Code](https://claude.ai/code/session_017bvbs2nhqaqCRn1BiZJU4G)_

Co-authored-by: Claude <noreply@anthropic.com>
POST /sandbox/cards/{id}/simulate/authorization_reversal and
/sandbox/cards/{id}/simulate/authorization_expiry have been live for some
time but were never in the spec, so generated clients could not call
them. The return reversal endpoint's description went further and stated
that neither existed. Both are documented now and that note is gone.

Reversal takes a new SandboxCardReversalRequest: the transaction plus an
optional amount. Omit it to reverse the whole authorization; send an
amount to reverse only that much. The schema does not admit 0 — leaving
the field out is how a full reversal is expressed, the same shape as the
return simulator's amount. Expiry reuses SandboxCardTransactionRefRequest,
whose description now names both of its callers.

The descriptions are written for an integrator deciding whether to call
the endpoint, not for someone who already knows the issuer's event names.

The two paths join the kebab-case allowlist in .spectral.yaml for the
same reason the other simulators are there: they mirror the issuer's
routes verbatim and the SDK must call those exact URLs.

Redocly validates clean at 55 warnings, one fewer than main.
Spectral: ✖ 901 problems (0 errors, 179 warnings, 722 infos, 0 hints)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@shreyav
shreyav force-pushed the claude/sandbox-authorization-reversal-expiry branch from 9047258 to 5d8e6f7 Compare September 9, 2026 18:48
@shreyav
shreyav merged commit 3d8d258 into main Sep 9, 2026
9 of 10 checks passed
@shreyav
shreyav deleted the claude/sandbox-authorization-reversal-expiry branch September 9, 2026 18:56
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