Add required totalBalance field to InternalAccount#582
Conversation
Add a totalBalance field (total balance including pending/held funds) alongside the existing balance (spendable). Marked required in the response and rebundled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
⏳ grid-go studio · code
|
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is an additive, backward-compatible spec extension and the rollout note correctly calls out that the server should be deployed before this spec is published. The change is purely additive: a new required field is added to the response schema, the source YAML files are the only things edited, and the bundles are correctly regenerated. No existing fields are modified or removed, and all inline examples maintain the invariant that totalBalance >= balance. No files require special attention. The only stylistic note is that the PATCH response example uses equal values for balance and totalBalance, which misses an opportunity to illustrate the field distinction but has no runtime impact.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/customers/InternalAccount.yaml | Adds totalBalance to the required array and as a new property (with $ref + sibling description, valid in OpenAPI 3.1); also adds a description to the existing balance field. |
| openapi/paths/internal_accounts/internal_accounts_{id}.yaml | Adds totalBalance to the PATCH 200 response example; balance and totalBalance values are identical (12550) which misses an opportunity to illustrate their distinction. |
| openapi/webhooks/internal-account-status.yaml | Adds totalBalance to both webhook examples; balanceDecrease correctly shows balance: 10000 vs totalBalance: 12500, illustrating the semantic difference. |
| openapi/components/schemas/common/GbpBeneficiary.yaml | Adds example values to each field — a bundled-together documentation improvement, no issues. |
| openapi.yaml | Generated bundle — correctly reflects all source changes after make build. |
| mintlify/openapi.yaml | Generated Mintlify bundle — correctly reflects all source changes after make build. |
Entity Relationship Diagram
%%{init: {'theme': 'neutral'}}%%
erDiagram
InternalAccount {
string id
string customerId
string type
string status
CurrencyAmount balance "available to spend (excl. pending/held)"
CurrencyAmount totalBalance "total incl. pending and held funds [NEW - required]"
array fundingPaymentInstructions
boolean privateEnabled
datetime createdAt
datetime updatedAt
}
CurrencyAmount {
integer amount
Currency currency
}
Currency {
string code
string name
string symbol
integer decimals
}
InternalAccount ||--|| CurrencyAmount : balance
InternalAccount ||--|| CurrencyAmount : totalBalance
CurrencyAmount ||--|| Currency : currency
Reviews (2): Last reviewed commit: "Fix lint: add totalBalance to InternalAc..." | Re-trigger Greptile
…bpBeneficiary The new required totalBalance field broke example validation in the PATCH internal-account response and the two internal-account-status webhook examples; add totalBalance to each. Also add property examples to GbpBeneficiary to satisfy schema-properties-have-examples. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Adds a new
totalBalancefield to the Grid internal account schema, alongside the existingbalance:balance— the balance available to spend, excluding pending and held fundstotalBalance— the total balance, including pending and held fundstotalBalanceis marked required in the response. Both fields now carry descriptions distinguishing them. Spec rebundled (openapi.yaml+mintlify/openapi.yaml).Rollout note
This marks
totalBalanceas a required response field in the public contract. The Grid API server (webdev) should be deployed returningtotal_balancebefore this spec change is published, so external clients regenerating from the spec never expect a field the server isn't yet returning. Server-side wiring is in the companion webdev PR.🤖 Generated with Claude Code