Skip to content

add total fees to exchange rate api#575

Merged
shreyav merged 1 commit into
mainfrom
06-11-add_total_fees_to_exchange_rate_api
Jun 12, 2026
Merged

add total fees to exchange rate api#575
shreyav merged 1 commit into
mainfrom
06-11-add_total_fees_to_exchange_rate_api

Conversation

@shreyav

@shreyav shreyav commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 12, 2026 12:11am

Request Review

shreyav commented Jun 12, 2026

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 Jun 12, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

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

cli

chore(internal): regenerate SDK with no functional changes

csharp

feat(api): add total fee field to exchange rates

go

feat(api): add total field to exchange rate fees

kotlin

feat(api): add total field to ExchangeRate.Fees model

openapi

feat(api): add total field to fees

php

feat(api): add total field to exchange rates fees model

python

feat(api): add total fee field to exchange rate

ruby

feat(api): add total field to exchange_rate fees model

typescript

feat(api): add total field to exchange rate fees
grid-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

grid-ruby studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

grid-typescript studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/c0d40f50492fe0ecaed30b394055e95625680441/dist.tar.gz
⚠️ grid-go studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@89d919e2f71e07b72fa4a2d69038cdcdbc48f4f4
grid-kotlin studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

⚠️ grid-python studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/grid-python/097bfd97539d4990c92792361a82d03e9b446c15/grid-0.0.1-py3-none-any.whl
⚠️ grid-csharp studio · code

Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ⚠️build ❗lint ✅test ❗

grid-php studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅lint ✅test ✅

⚠️ grid-cli studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
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-06-12 00:50:19 UTC

@shreyav shreyav marked this pull request as ready for review June 12, 2026 00:11
@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a total field to the ExchangeRateFees schema to surface the all-in fee (fixed + any variable/percentage component) alongside the existing fixed fee, with both the source schema and the bundled OpenAPI files updated consistently.

  • Schema change (ExchangeRateFees.yaml): new total integer field (int64, minimum 0) with a description noting the value is sending-amount-dependent and falls back to the default when none is supplied.
  • Example updates (exchange_rates.yaml, both bundles): response examples now include total: 150 (USD→INR) and total: 15 (USD→EUR), both greater than their corresponding fixed values, correctly illustrating the variable component.
  • Both openapi.yaml and mintlify/openapi.yaml reflect identical changes, consistent with a make build run.

Confidence Score: 4/5

Safe to merge — additive schema change with no breaking modifications to existing fields.

The change is purely additive: a new optional field on an existing response schema. Both generated bundles are in sync with the source. The only thing worth addressing before publishing is the schema-level example for total being identical to fixed, which could mislead consumers about when variable fees apply.

openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml — the example value for the new total field.

Important Files Changed

Filename Overview
openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml Adds total field to ExchangeRateFees schema; schema example value (100) equals the fixed fee example, which may mislead consumers about variable fee components
openapi/paths/exchange-rates/exchange_rates.yaml Adds total values to both response examples (150 for USD→INR, 15 for USD→EUR); values are consistently greater than fixed, which correctly illustrates the variable component
openapi.yaml Generated bundle file — changes are identical to the source edits, indicating make build was run correctly
mintlify/openapi.yaml Generated Mintlify bundle — mirrors the main openapi.yaml changes as expected from a make build run

Sequence Diagram

sequenceDiagram
    participant Client
    participant GridAPI as Grid API

    Client->>GridAPI: "GET /exchange-rates?sourceCurrency=USD&sendingAmount=10000"
    GridAPI-->>Client: 200 OK
    note over Client,GridAPI: ExchangeRate object
    Client->>Client: "fees.fixed = 100 (fixed fee, cents)"
    Client->>Client: "fees.total = 150 (fixed + variable, cents) - varies with sendingAmount"
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml:10-18
The `example` value for `total` is `100`, identical to the `fixed` fee example. Since `total` is meant to capture fixed + any variable/percentage component, an example where they are equal implies there is never a variable fee, which contradicts the response examples in the path file (where total is `150` vs fixed `100`, or `15` vs `10`). Using `150` here aligns with the live example and signals clearly to API consumers that total can exceed fixed.

```suggestion
  total:
    type: integer
    format: int64
    description: >-
      Total fees in the smallest unit of the sending currency (e.g., cents for
      USD). This value may change depending on the sending amount used; if no
      sending amount is specified, it falls back to the default.
    minimum: 0
    example: 150
```

Reviews (1): Last reviewed commit: "add total fees to exchange rate api" | Re-trigger Greptile

Comment on lines +10 to +18
total:
type: integer
format: int64
description: >-
Total fees in the smallest unit of the sending currency (e.g., cents for
USD). This value may change depending on the sending amount used; if no
sending amount is specified, it falls back to the default.
minimum: 0
example: 100

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The example value for total is 100, identical to the fixed fee example. Since total is meant to capture fixed + any variable/percentage component, an example where they are equal implies there is never a variable fee, which contradicts the response examples in the path file (where total is 150 vs fixed 100, or 15 vs 10). Using 150 here aligns with the live example and signals clearly to API consumers that total can exceed fixed.

Suggested change
total:
type: integer
format: int64
description: >-
Total fees in the smallest unit of the sending currency (e.g., cents for
USD). This value may change depending on the sending amount used; if no
sending amount is specified, it falls back to the default.
minimum: 0
example: 100
total:
type: integer
format: int64
description: >-
Total fees in the smallest unit of the sending currency (e.g., cents for
USD). This value may change depending on the sending amount used; if no
sending amount is specified, it falls back to the default.
minimum: 0
example: 150
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml
Line: 10-18

Comment:
The `example` value for `total` is `100`, identical to the `fixed` fee example. Since `total` is meant to capture fixed + any variable/percentage component, an example where they are equal implies there is never a variable fee, which contradicts the response examples in the path file (where total is `150` vs fixed `100`, or `15` vs `10`). Using `150` here aligns with the live example and signals clearly to API consumers that total can exceed fixed.

```suggestion
  total:
    type: integer
    format: int64
    description: >-
      Total fees in the smallest unit of the sending currency (e.g., cents for
      USD). This value may change depending on the sending amount used; if no
      sending amount is specified, it falls back to the default.
    minimum: 0
    example: 150
```

How can I resolve this? If you propose a fix, please make it concise.

@shreyav shreyav merged commit 7ad42bf into main Jun 12, 2026
10 checks passed
@shreyav shreyav deleted the 06-11-add_total_fees_to_exchange_rate_api branch June 12, 2026 00:43
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