docs(payments): sync quote/transfer/webhook examples with schema#503
docs(payments): sync quote/transfer/webhook examples with schema#503jklein24 wants to merge 6 commits into
Conversation
Quote responses:
- Use id (not quoteId)
- Flat totalSendingAmount/totalReceivingAmount/feesIncluded integers
+ separate sendingCurrency/receivingCurrency Currency objects
(was nested sendingAmount/receivingAmount CurrencyAmount objects)
- Required sourceType/destinationType discriminators added
- Removed invented currency field from source/destination
- Quote-execute response is a Quote (not a transaction with invented executedAt)
Webhooks:
- Envelope: {id, type, timestamp, data} per BaseWebhook
(was {webhookId, transaction, ...})
- Event types use OBJECT.EVENT dot-notation
(OUTGOING_PAYMENT.COMPLETED, INCOMING_PAYMENT.PENDING, etc.)
Receivers / UMA:
- receiving-payments.mdx migrated from User* to Customer* vocabulary
- UMA lookup endpoint corrected to /receiver/uma/{address}?customerId=...
with response shape matching ReceiverUmaLookupResponse
Other:
- currencies-and-rails.mdx: MXN decimals 8 -> 2; reconciled prose math
- Idempotency-Key sent as HTTP header (not body field)
- fiat-crypto-conversion.mdx: fixed broken JSON; receivingAmount -> totalReceivingAmount
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
@greptile review |
Greptile SummaryThis PR synchronizes 20 documentation files with the current OpenAPI schema across the payments, ramps, rewards, and global-p2p product areas. The changes are broadly correct and well-scoped, but the
Confidence Score: 4/5Safe to merge with a small follow-up: the same-currency transfer request bodies in transaction-lifecycle.mdx are missing the discriminator fields that this PR adds as required everywhere else. The transfer-out and transfer-in request bodies in transaction-lifecycle.mdx omit sourceType/destinationType that the rest of the PR marks as required — a developer following only that guide will build requests that fail schema validation. All other structural changes (envelope migration, flat quote amounts, Customer vocabulary, UMA endpoint) are applied correctly and consistently across the remaining 19 files. mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx — transfer-out and transfer-in request bodies need sourceType/destinationType added.
|
| Filename | Overview |
|---|---|
| mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx | Idempotency-Key correctly moved to HTTP header; transfer-out and transfer-in request bodies still missing required sourceType/destinationType discriminators that every other file in this PR adds. |
| mintlify/snippets/sending/cross-currency.mdx | Quote schema aligned (flat amounts, discriminators, USDC decimals now consistent at 2); OUTGOING_PAYMENT.COMPLETED envelope id added; BALANCE_UPDATED restructured to new data-wrapped format. |
| mintlify/ramps/conversion-flows/fiat-crypto-conversion.mdx | Broken JSON fixed, totalReceivingAmount replaces receivingAmount, reference field path corrected to accountOrWalletInfo.reference, sourceType/destinationType added to quote request. |
| mintlify/global-p2p/quickstart.mdx | Quote response expanded to full schema, webhook envelope migrated; REALTIME_FUNDING source retains currency field (consistent with fiat-crypto-conversion but inconsistent with other REALTIME_FUNDING examples elsewhere in the PR). |
| mintlify/global-p2p/sending-receiving-payments/receiving-payments.mdx | Customer vocabulary migration (User→Customer) complete; webhook envelopes use distinct IDs for PENDING/COMPLETED; requestedReceiverCustomerInfoFields correctly placed inside data. |
| mintlify/snippets/sending/uma.mdx | UMA lookup endpoint corrected to /receiver/uma/{address}; response updated to ReceiverUmaLookupResponse shape with supportedCurrencies expanded and requiredPayerDataFields with mandatory flags. |
| mintlify/ramps/platform-tools/webhooks.mdx | Webhook envelope migrated (id/type/data), idempotency and transaction-dedup code updated to read from correct fields; test webhook id field renamed. |
| mintlify/platform-overview/core-concepts/currencies-and-rails.mdx | MXN decimals corrected 8→2; totalSendingAmount/totalReceivingAmount/feesIncluded scaled to match $1,000 example; prose math reconciled. |
| mintlify/payouts-and-b2b/quickstart.mdx | Webhook envelopes updated to new format; event types updated (INCOMING_PAYMENT.COMPLETED, OUTGOING_PAYMENT.COMPLETED); quote id/sourceType/destinationType fields corrected. |
| mintlify/snippets/reconciliation/reconciliation.mdx | Webhook envelope restructured to new format; transactionId→id corrected; idempotency prose updated to reference envelope id, data.id, and timestamp. |
Sequence Diagram
sequenceDiagram
participant C as Client
participant G as Grid API
participant W as Webhook Endpoint
C->>G: "POST /quotes {source: {sourceType, ...}, destination: {destinationType, ...}}"
G-->>C: "Quote {id, status:PENDING, totalSendingAmount, totalReceivingAmount, feesIncluded, sendingCurrency, receivingCurrency}"
alt ACCOUNT source (internal balance)
C->>G: "POST /quotes/{id}/execute"
G-->>C: "Quote {id, status:PROCESSING, transactionId}"
else REALTIME_FUNDING source
G-->>C: "Quote {id, paymentInstructions[{accountOrWalletInfo}]}"
C->>G: External payment (ACH / crypto deposit)
W-->>C: "{id, type:INTERNAL_ACCOUNT.BALANCE_UPDATED, timestamp, data:{id, balance}}"
end
W-->>C: "{id, type:OUTGOING_PAYMENT.COMPLETED, timestamp, data:{id:Transaction, sentAmount, receivedAmount, quoteId}}"
note over C,W: Idempotent dedup on envelope id
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx:84-88
The `transfer-out` and `transfer-in` request bodies are missing the `sourceType`/`destinationType` discriminators that this PR marks as required throughout every other example. A developer following only the transaction lifecycle guide will omit these fields and get a schema validation error (or a silently wrong request if the server applies lenient coercion).
```suggestion
{
"source": {"sourceType": "ACCOUNT", "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"},
"destination": {"destinationType": "ACCOUNT", "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"},
"amount": 100000
}
```
### Issue 2 of 2
mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx:108-112
Same missing discriminator issue for the `transfer-in` request body — `sourceType` is absent from the `source` object, inconsistent with every other updated example in this PR.
```suggestion
{
"source": {"sourceType": "ACCOUNT", "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"},
"destination": {"destinationType": "ACCOUNT", "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"},
"amount": 100000
}
```
Reviews (6): Last reviewed commit: "complete envelope migration on USDC webh..." | Re-trigger Greptile
- cross-currency.mdx: USDC sendingCurrency decimals 6 -> 2 to match the 100 USDC amount the example was calibrated for and the BALANCE_UPDATED webhook lower in the same file - receiving-payments.mdx: distinct envelope id for the COMPLETED webhook so the reconciliation guidance (dedupe on envelope id) doesn't collapse the PENDING and COMPLETED deliveries Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile review |
- fiat-crypto-conversion.mdx: reference lives on accountOrWalletInfo,
not at the top level of paymentInstructions[i]
- ramps/platform-tools/webhooks.mdx: best-practices accordions used
old {webhookId, transaction} envelope; updated to {id, data} that
matches the canonical webhook envelope
- quote-system.mdx: webhook handler used {transaction, type} and bare
'OUTGOING_PAYMENT' string; updated to dot-notation and {data}
- global-p2p/quickstart.mdx: sandbox/send response showed UMA_ADDRESS
for $bob but the surrounding flow uses the CLABE ExternalAccount;
destination now matches that account
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile review |
…view) The quote response example was only half-migrated — it had feesIncluded but was missing source/destination discriminators, sendingCurrency, receivingCurrency, totalSendingAmount, and totalReceivingAmount. Added those fields and reconciled the transaction sentAmount/receivedAmount math so the whole sandbox flow is internally consistent (100 USDC at 16.85 MXN/USDC = 1685 MXN). USDC decimals now use 2 throughout this file, matching the rest of the PR. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile review |
The schema's RealtimeFundingQuoteSource requires the currency field; other docs already include it. Restored currency on the quote and sandbox/send response source objects in global-p2p/quickstart.mdx. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile review |
The OUTGOING_PAYMENT.COMPLETED webhook in the USDC funding section of cross-currency.mdx was missing the envelope id and used USD on sentAmount despite the surrounding USDC -> EUR flow. Added id and corrected the currency code. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile review |
|
On the latest finding — confirmed against the schema: |
Comprehensive sync of payments documentation examples with the current OpenAPI schema.
Changes
Quote responses:
id(notquoteId).totalSendingAmount/totalReceivingAmount/feesIncludedintegers + separatesendingCurrency/receivingCurrencyCurrency objects (was nestedsendingAmount/receivingAmountCurrencyAmount objects).sourceType/destinationTypediscriminators added.currencyfield fromsource/destination.Quote, not a transaction with inventedexecutedAt.Webhooks:
{id, type, timestamp, data}perBaseWebhook(was{webhookId, transaction, ...}).OBJECT.EVENTdot-notation (OUTGOING_PAYMENT.COMPLETED,INCOMING_PAYMENT.PENDING, etc.).Receivers / UMA:
global-p2p/sending-receiving-payments/receiving-payments.mdxmigrated fromUser*→Customer*vocabulary (userId→customerId, etc.)./receiver/uma/{address}?customerId=...; response matchesReceiverUmaLookupResponse.Other:
currencies-and-rails.mdx: MXNdecimals: 8→2; reconciled prose math.Idempotency-Keyshown as HTTP header (not body field).fiat-crypto-conversion.mdx: fixed broken JSON;receivingAmount→totalReceivingAmount.Sibling PRs
Split from a larger sync effort. Two companion draft PRs cover onboarding (#502) and accounts/auth/cards.
🤖 Generated with Claude Code