Commit 9e5595a
authored
feat(transactions): add sentAmount, exchangeRate, quoteId, refund to base Transaction (#725)
## Summary
Changes to the Grid transaction resources:
1. **Base-transaction fields** — moves `sentAmount`, `exchangeRate`,
`quoteId`, and `refund` onto the base `Transaction` schema as
**optional** properties. `IncomingTransaction` now inherits all four as
optional fields (it had none before); `OutgoingTransaction` continues to
enforce `sentAmount` as required.
2. **Incoming fees denomination** — the incoming-transaction `fees`
field is now documented as expressed in the smallest unit of the
**sending** currency (previously the receiving currency), matching the
outgoing `fees` field.
3. **Remove `IncomingRateDetails`** — the `rateDetails` field and its
`IncomingRateDetails` schema are removed from the incoming-transaction
resource.
## Changes
- `openapi/components/schemas/transactions/Transaction.yaml` — add
optional `sentAmount`, `exchangeRate`, `quoteId`, `refund`.
- `openapi/components/schemas/transactions/OutgoingTransaction.yaml` —
remove the now-inherited `exchangeRate`, `quoteId`, `refund`
definitions; keep `sentAmount` defined and required (the Redocly
`no-required-schema-properties-undefined` rule requires a required
property to be defined in the same subschema).
- `openapi/components/schemas/transactions/IncomingTransaction.yaml` —
change `fees` description from receiving to sending currency; remove the
`rateDetails` field.
- `openapi/components/schemas/transactions/IncomingRateDetails.yaml` —
deleted (no remaining references).
- `openapi.yaml`, `mintlify/openapi.yaml` — regenerated bundle (`make
build`).
`IncomingTransaction` picks up the four optional base fields via its
`allOf` reference to `Transaction`.
## Docs audit (all changes)
No guide or example needed correction:
- Incoming-transaction examples (e.g. the receiving-payments guide,
incoming-payment webhook samples) don't render a `fees` or `rateDetails`
field or assert a fee currency, and the four new fields are optional, so
existing examples stay valid.
- `snippets/receipts.mdx` already maps `fees` as "smallest unit of the
sending currency" — now consistent for incoming too.
- The `quote-system` / `cross-currency` notes describe quote-level
rate-detail components and the Quote's own `rateDetails`, which are
unaffected.
## Note on implementation
This is a spec/contract change. The backend that populates these
resources is sparkcore; landing the actual behavior (populating the new
fields on incoming transactions, converting incoming `fees` to sending
currency, and dropping the incoming rate-details payload) is separate
follow-up work there.
## Verification
- `make build` — bundle regenerated cleanly.
- `make lint-openapi` — passes (exit 0).
Additive base fields are non-breaking; removing `IncomingRateDetails` is
a removal from the incoming response shape. No `info.version` bump made
— flag if the rate-details removal should be treated as a breaking
version bump.
Original PR: #7231 parent 4a5ebca commit 9e5595a
7 files changed
Lines changed: 122 additions & 235 deletions
File tree
- .stainless
- mintlify
- openapi/components/schemas/transactions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | 326 | | |
328 | 327 | | |
329 | 328 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments