From e7d2ae0fdf0f6ff92a87c21a3bb5cfccb2863d19 Mon Sep 17 00:00:00 2001 From: Peng Ying Date: Sat, 24 Jan 2026 14:33:20 -0800 Subject: [PATCH] feat: add Quote/Transaction discriminators and remove inline examples --- mintlify/openapi.yaml | 498 +++++++++--------- openapi.yaml | 498 +++++++++--------- openapi/components/schemas/quotes/Quote.yaml | 56 +- .../quotes/QuoteAccountDestination.yaml | 18 + .../schemas/quotes/QuoteAccountSource.yaml | 14 + .../quotes/QuoteRealtimeFundingSource.yaml | 27 + .../schemas/quotes/QuoteRequest.yaml | 54 +- .../QuoteRequestAccountDestination.yaml | 22 + ...uestExternalAccountDetailsDestination.yaml | 16 + .../QuoteRequestUmaAddressDestination.yaml | 22 + .../schemas/quotes/QuoteSource.yaml | 50 +- .../quotes/QuoteUmaAddressDestination.yaml | 28 + .../transactions/AccountDestination.yaml | 19 + .../schemas/transactions/AccountSource.yaml | 19 + .../transactions/IncomingTransaction.yaml | 34 +- .../transactions/OutgoingTransaction.yaml | 43 +- .../schemas/transactions/Transaction.yaml | 35 +- .../transactions/UmaAddressDestination.yaml | 18 + .../transactions/UmaAddressSource.yaml | 18 + openapi/paths/quotes/quotes.yaml | 41 -- 20 files changed, 785 insertions(+), 745 deletions(-) create mode 100644 openapi/components/schemas/quotes/QuoteAccountDestination.yaml create mode 100644 openapi/components/schemas/quotes/QuoteAccountSource.yaml create mode 100644 openapi/components/schemas/quotes/QuoteRealtimeFundingSource.yaml create mode 100644 openapi/components/schemas/quotes/QuoteRequestAccountDestination.yaml create mode 100644 openapi/components/schemas/quotes/QuoteRequestExternalAccountDetailsDestination.yaml create mode 100644 openapi/components/schemas/quotes/QuoteRequestUmaAddressDestination.yaml create mode 100644 openapi/components/schemas/quotes/QuoteUmaAddressDestination.yaml create mode 100644 openapi/components/schemas/transactions/AccountDestination.yaml create mode 100644 openapi/components/schemas/transactions/AccountSource.yaml create mode 100644 openapi/components/schemas/transactions/UmaAddressDestination.yaml create mode 100644 openapi/components/schemas/transactions/UmaAddressSource.yaml diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index 3115175..d6cf1a5 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -1649,47 +1649,6 @@ paths: application/json: schema: $ref: '#/components/schemas/QuoteRequest' - examples: - accountToAccount: - summary: Account to Account Transfer - value: - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 10000 - description: Transfer between accounts, either internal or external. - accountToUma: - summary: Account to UMA Address Transfer - value: - lookupId: LookupRequest:019542f5-b3e7-1d02-0000-000000000009 - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - umaAddress: $receiver@uma.domain.com - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 1000 - description: 'Payment for invoice #1234' - realTimeFundingToSparkWallet: - summary: Real-time funding to Spark Wallet as an on-ramp flow. Immediate execution. - value: - source: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: USD - destination: - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - lockedCurrencySide: RECEIVING - lockedCurrencyAmount: 10000 - immediatelyExecute: true - description: Bitcoin reward payout! responses: '201': description: | @@ -5416,34 +5375,13 @@ components: $ref: '#/components/schemas/TransactionType' destination: oneOf: - - title: Account Destination - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR + - $ref: '#/components/schemas/AccountDestination' + - $ref: '#/components/schemas/UmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) @@ -5484,6 +5422,45 @@ components: mapping: INCOMING: '#/components/schemas/IncomingTransaction' OUTGOING: '#/components/schemas/OutgoingTransaction' + AccountSource: + type: object + required: + - sourceType + - accountId + - currency + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + currency: + type: string + description: Currency code for the source account + example: USD + description: Source account details + UmaAddressSource: + type: object + required: + - sourceType + - umaAddress + properties: + sourceType: + type: string + const: UMA_ADDRESS + description: Source type identifier + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + currency: + type: string + description: Currency code for the source + example: USD + description: UMA address source details ReconciliationInstructions: type: object required: @@ -5548,34 +5525,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' receivedAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount received in the recipient's currency @@ -5677,34 +5634,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' sentAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount sent in the sender's currency @@ -5735,15 +5672,6 @@ components: description: Payment instructions for executing the payment. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs refund: $ref: '#/components/schemas/Refund' description: The refund if transaction was refunded. @@ -5765,6 +5693,45 @@ components: - REFUNDED - EXPIRED description: Status of a payment transaction + AccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + UmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + description: UMA address destination details CurrencyPreference: type: object required: @@ -5867,37 +5834,97 @@ components: details: type: object description: Additional error details + QuoteAccountSource: + type: object + required: + - sourceType + - accountId + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + description: Source account details + QuoteRealtimeFundingSource: + type: object + required: + - sourceType + - currency + properties: + sourceType: + type: string + const: REALTIME_FUNDING + description: Source type identifier + customerId: + type: string + description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. + example: Customer:019542f5-b3e7-1d02-0000-000000000009 + currency: + type: string + description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: USD + description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). QuoteSource: + required: + - sourceType oneOf: - - title: Account - type: object - required: - - accountId - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Source account details - - title: Real-time funding + - $ref: '#/components/schemas/QuoteAccountSource' + - $ref: '#/components/schemas/QuoteRealtimeFundingSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountSource' + REALTIME_FUNDING: '#/components/schemas/QuoteRealtimeFundingSource' + QuoteAccountDestination: + type: object + required: + - destinationType + - accountId + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + QuoteUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + counterpartyInformation: type: object - required: - - currency - - customerId - properties: - customerId: - type: string - description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. - example: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). + description: Information about the recipient, as required by the platform in their configuration. + additionalProperties: true + example: + FULL_NAME: Jane Receiver + BIRTH_DATE: '1990-01-01' + NATIONALITY: FR + description: UMA address destination details Quote: type: object required: @@ -5942,43 +5969,16 @@ components: source: $ref: '#/components/schemas/QuoteSource' destination: + required: + - destinationType oneOf: - - title: Account Destination - type: object - required: - - accountId - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR - counterpartyInformation: - type: object - description: Information about the recipient, as required by the platform in their configuration. - additionalProperties: true - example: - FULL_NAME: Jane Receiver - BIRTH_DATE: '1990-01-01' - NATIONALITY: FR - description: UMA address destination details + - $ref: '#/components/schemas/QuoteAccountDestination' + - $ref: '#/components/schemas/QuoteUmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteUmaAddressDestination' sendingCurrency: $ref: '#/components/schemas/Currency' description: Currency for the sending amount @@ -6012,15 +6012,6 @@ components: description: Payment instructions for executing the payment. This is not required when using an internal account source. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs transactionId: type: string description: The ID of the transaction created from this quote. @@ -6032,6 +6023,59 @@ components: rateDetails: $ref: '#/components/schemas/OutgoingRateDetails' description: Details about the rate and fees for the transaction. + QuoteRequestAccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: Destination account details + QuoteRequestUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + - currency + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: UMA address destination details + QuoteRequestExternalAccountDetailsDestination: + type: object + required: + - destinationType + - externalAccountDetails + properties: + destinationType: + type: string + const: EXTERNAL_ACCOUNT_DETAILS + description: Destination type identifier + externalAccountDetails: + $ref: '#/components/schemas/ExternalAccountCreateRequest' + description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. QuoteLockSide: type: string enum: @@ -6057,43 +6101,17 @@ components: destination: oneOf: - title: Account - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: Destination account details + $ref: '#/components/schemas/QuoteRequestAccountDestination' - title: UMA Address - type: object - required: - - umaAddress - - currency - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: UMA address destination details + $ref: '#/components/schemas/QuoteRequestUmaAddressDestination' - title: External Account Details - type: object - required: - - externalAccountDetails - properties: - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. + $ref: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteRequestAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteRequestUmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' lockedCurrencySide: $ref: '#/components/schemas/QuoteLockSide' lockedCurrencyAmount: diff --git a/openapi.yaml b/openapi.yaml index 3115175..d6cf1a5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1649,47 +1649,6 @@ paths: application/json: schema: $ref: '#/components/schemas/QuoteRequest' - examples: - accountToAccount: - summary: Account to Account Transfer - value: - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 10000 - description: Transfer between accounts, either internal or external. - accountToUma: - summary: Account to UMA Address Transfer - value: - lookupId: LookupRequest:019542f5-b3e7-1d02-0000-000000000009 - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - umaAddress: $receiver@uma.domain.com - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 1000 - description: 'Payment for invoice #1234' - realTimeFundingToSparkWallet: - summary: Real-time funding to Spark Wallet as an on-ramp flow. Immediate execution. - value: - source: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: USD - destination: - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - lockedCurrencySide: RECEIVING - lockedCurrencyAmount: 10000 - immediatelyExecute: true - description: Bitcoin reward payout! responses: '201': description: | @@ -5416,34 +5375,13 @@ components: $ref: '#/components/schemas/TransactionType' destination: oneOf: - - title: Account Destination - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR + - $ref: '#/components/schemas/AccountDestination' + - $ref: '#/components/schemas/UmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) @@ -5484,6 +5422,45 @@ components: mapping: INCOMING: '#/components/schemas/IncomingTransaction' OUTGOING: '#/components/schemas/OutgoingTransaction' + AccountSource: + type: object + required: + - sourceType + - accountId + - currency + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + currency: + type: string + description: Currency code for the source account + example: USD + description: Source account details + UmaAddressSource: + type: object + required: + - sourceType + - umaAddress + properties: + sourceType: + type: string + const: UMA_ADDRESS + description: Source type identifier + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + currency: + type: string + description: Currency code for the source + example: USD + description: UMA address source details ReconciliationInstructions: type: object required: @@ -5548,34 +5525,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' receivedAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount received in the recipient's currency @@ -5677,34 +5634,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' sentAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount sent in the sender's currency @@ -5735,15 +5672,6 @@ components: description: Payment instructions for executing the payment. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs refund: $ref: '#/components/schemas/Refund' description: The refund if transaction was refunded. @@ -5765,6 +5693,45 @@ components: - REFUNDED - EXPIRED description: Status of a payment transaction + AccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + UmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + description: UMA address destination details CurrencyPreference: type: object required: @@ -5867,37 +5834,97 @@ components: details: type: object description: Additional error details + QuoteAccountSource: + type: object + required: + - sourceType + - accountId + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + description: Source account details + QuoteRealtimeFundingSource: + type: object + required: + - sourceType + - currency + properties: + sourceType: + type: string + const: REALTIME_FUNDING + description: Source type identifier + customerId: + type: string + description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. + example: Customer:019542f5-b3e7-1d02-0000-000000000009 + currency: + type: string + description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: USD + description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). QuoteSource: + required: + - sourceType oneOf: - - title: Account - type: object - required: - - accountId - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Source account details - - title: Real-time funding + - $ref: '#/components/schemas/QuoteAccountSource' + - $ref: '#/components/schemas/QuoteRealtimeFundingSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountSource' + REALTIME_FUNDING: '#/components/schemas/QuoteRealtimeFundingSource' + QuoteAccountDestination: + type: object + required: + - destinationType + - accountId + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + QuoteUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + counterpartyInformation: type: object - required: - - currency - - customerId - properties: - customerId: - type: string - description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. - example: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). + description: Information about the recipient, as required by the platform in their configuration. + additionalProperties: true + example: + FULL_NAME: Jane Receiver + BIRTH_DATE: '1990-01-01' + NATIONALITY: FR + description: UMA address destination details Quote: type: object required: @@ -5942,43 +5969,16 @@ components: source: $ref: '#/components/schemas/QuoteSource' destination: + required: + - destinationType oneOf: - - title: Account Destination - type: object - required: - - accountId - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR - counterpartyInformation: - type: object - description: Information about the recipient, as required by the platform in their configuration. - additionalProperties: true - example: - FULL_NAME: Jane Receiver - BIRTH_DATE: '1990-01-01' - NATIONALITY: FR - description: UMA address destination details + - $ref: '#/components/schemas/QuoteAccountDestination' + - $ref: '#/components/schemas/QuoteUmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteUmaAddressDestination' sendingCurrency: $ref: '#/components/schemas/Currency' description: Currency for the sending amount @@ -6012,15 +6012,6 @@ components: description: Payment instructions for executing the payment. This is not required when using an internal account source. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs transactionId: type: string description: The ID of the transaction created from this quote. @@ -6032,6 +6023,59 @@ components: rateDetails: $ref: '#/components/schemas/OutgoingRateDetails' description: Details about the rate and fees for the transaction. + QuoteRequestAccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: Destination account details + QuoteRequestUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + - currency + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: UMA address destination details + QuoteRequestExternalAccountDetailsDestination: + type: object + required: + - destinationType + - externalAccountDetails + properties: + destinationType: + type: string + const: EXTERNAL_ACCOUNT_DETAILS + description: Destination type identifier + externalAccountDetails: + $ref: '#/components/schemas/ExternalAccountCreateRequest' + description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. QuoteLockSide: type: string enum: @@ -6057,43 +6101,17 @@ components: destination: oneOf: - title: Account - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: Destination account details + $ref: '#/components/schemas/QuoteRequestAccountDestination' - title: UMA Address - type: object - required: - - umaAddress - - currency - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: UMA address destination details + $ref: '#/components/schemas/QuoteRequestUmaAddressDestination' - title: External Account Details - type: object - required: - - externalAccountDetails - properties: - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. + $ref: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteRequestAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteRequestUmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' lockedCurrencySide: $ref: '#/components/schemas/QuoteLockSide' lockedCurrencyAmount: diff --git a/openapi/components/schemas/quotes/Quote.yaml b/openapi/components/schemas/quotes/Quote.yaml index 92edf2a..e3fdd08 100644 --- a/openapi/components/schemas/quotes/Quote.yaml +++ b/openapi/components/schemas/quotes/Quote.yaml @@ -42,45 +42,16 @@ properties: source: $ref: ./QuoteSource.yaml destination: + required: + - destinationType oneOf: - - title: Account Destination - type: object - required: - - accountId - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR - counterpartyInformation: - type: object - description: >- - Information about the recipient, as required by the platform in their - configuration. - additionalProperties: true - example: - FULL_NAME: Jane Receiver - BIRTH_DATE: '1990-01-01' - NATIONALITY: FR - description: UMA address destination details + - $ref: ./QuoteAccountDestination.yaml + - $ref: ./QuoteUmaAddressDestination.yaml + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./QuoteAccountDestination.yaml + UMA_ADDRESS: ./QuoteUmaAddressDestination.yaml sendingCurrency: $ref: ../common/Currency.yaml description: Currency for the sending amount @@ -120,15 +91,6 @@ properties: description: Payment instructions for executing the payment. This is not required when using an internal account source. items: $ref: ../common/PaymentInstructions.yaml - example: - - accountType: US_ACCOUNT - accountNumber: "1234567890" - routingNumber: "021000021" - bankName: "Chase Bank" - referenceCode: "REF123456" - - accountType: SPARK_WALLET - address: "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - invoice: "lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs" transactionId: type: string description: The ID of the transaction created from this quote. diff --git a/openapi/components/schemas/quotes/QuoteAccountDestination.yaml b/openapi/components/schemas/quotes/QuoteAccountDestination.yaml new file mode 100644 index 0000000..3a553df --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteAccountDestination.yaml @@ -0,0 +1,18 @@ +type: object +required: + - destinationType + - accountId +properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR +description: Destination account details diff --git a/openapi/components/schemas/quotes/QuoteAccountSource.yaml b/openapi/components/schemas/quotes/QuoteAccountSource.yaml new file mode 100644 index 0000000..bc6582a --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteAccountSource.yaml @@ -0,0 +1,14 @@ +type: object +required: + - sourceType + - accountId +properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 +description: Source account details diff --git a/openapi/components/schemas/quotes/QuoteRealtimeFundingSource.yaml b/openapi/components/schemas/quotes/QuoteRealtimeFundingSource.yaml new file mode 100644 index 0000000..8f033e8 --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRealtimeFundingSource.yaml @@ -0,0 +1,27 @@ +type: object +required: + - sourceType + - currency +properties: + sourceType: + type: string + const: REALTIME_FUNDING + description: Source type identifier + customerId: + type: string + description: >- + Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. + If customerId is not provided, the quote will be created on behalf of the platform itself. + example: Customer:019542f5-b3e7-1d02-0000-000000000009 + currency: + type: string + description: >- + Currency code for the funding source. See + [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) + for the full list of supported fiat and crypto currencies. + example: USD +description: >- + Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). + This will require manual just-in-time funding using `paymentInstructions` in the response. + Because quotes expire quickly, this option is only valid for instant payment methods. Do not try + to fund a quote with a non-instant payment method (ACH, etc.). diff --git a/openapi/components/schemas/quotes/QuoteRequest.yaml b/openapi/components/schemas/quotes/QuoteRequest.yaml index 5e27a72..842cc4d 100644 --- a/openapi/components/schemas/quotes/QuoteRequest.yaml +++ b/openapi/components/schemas/quotes/QuoteRequest.yaml @@ -19,53 +19,17 @@ properties: destination: oneOf: - title: Account - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: >- - Currency code for the destination account. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: EUR - description: Destination account details + $ref: ./QuoteRequestAccountDestination.yaml - title: UMA Address - type: object - required: - - umaAddress - - currency - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: >- - Currency code for the destination. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: EUR - description: UMA address destination details + $ref: ./QuoteRequestUmaAddressDestination.yaml - title: External Account Details - type: object - required: - - externalAccountDetails - properties: - externalAccountDetails: - $ref: ../external_accounts/ExternalAccountCreateRequest.yaml - description: >- - A convenient destination option which adds the external account and creates - the quote in one step rather than first needing to call /external-accounts - to add the account. Useful for one-off payments to some destination. - See the external accounts endpoints for test values in sandbox mode. + $ref: ./QuoteRequestExternalAccountDetailsDestination.yaml + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./QuoteRequestAccountDestination.yaml + UMA_ADDRESS: ./QuoteRequestUmaAddressDestination.yaml + EXTERNAL_ACCOUNT_DETAILS: ./QuoteRequestExternalAccountDetailsDestination.yaml lockedCurrencySide: $ref: ./QuoteLockSide.yaml lockedCurrencyAmount: diff --git a/openapi/components/schemas/quotes/QuoteRequestAccountDestination.yaml b/openapi/components/schemas/quotes/QuoteRequestAccountDestination.yaml new file mode 100644 index 0000000..4e38c1a --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRequestAccountDestination.yaml @@ -0,0 +1,22 @@ +type: object +required: + - destinationType + - accountId + - currency +properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: >- + Currency code for the destination account. See + [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) + for the full list of supported fiat and crypto currencies. + example: EUR +description: Destination account details diff --git a/openapi/components/schemas/quotes/QuoteRequestExternalAccountDetailsDestination.yaml b/openapi/components/schemas/quotes/QuoteRequestExternalAccountDetailsDestination.yaml new file mode 100644 index 0000000..18e66ee --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRequestExternalAccountDetailsDestination.yaml @@ -0,0 +1,16 @@ +type: object +required: + - destinationType + - externalAccountDetails +properties: + destinationType: + type: string + const: EXTERNAL_ACCOUNT_DETAILS + description: Destination type identifier + externalAccountDetails: + $ref: ../external_accounts/ExternalAccountCreateRequest.yaml +description: >- + A convenient destination option which adds the external account and creates + the quote in one step rather than first needing to call /external-accounts + to add the account. Useful for one-off payments to some destination. + See the external accounts endpoints for test values in sandbox mode. diff --git a/openapi/components/schemas/quotes/QuoteRequestUmaAddressDestination.yaml b/openapi/components/schemas/quotes/QuoteRequestUmaAddressDestination.yaml new file mode 100644 index 0000000..aa9177d --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRequestUmaAddressDestination.yaml @@ -0,0 +1,22 @@ +type: object +required: + - destinationType + - umaAddress + - currency +properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: >- + Currency code for the destination. See + [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) + for the full list of supported fiat and crypto currencies. + example: EUR +description: UMA address destination details diff --git a/openapi/components/schemas/quotes/QuoteSource.yaml b/openapi/components/schemas/quotes/QuoteSource.yaml index d12a92d..2a225b8 100644 --- a/openapi/components/schemas/quotes/QuoteSource.yaml +++ b/openapi/components/schemas/quotes/QuoteSource.yaml @@ -1,42 +1,10 @@ +required: + - sourceType oneOf: - - title: Account - type: object - required: - - accountId - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: >- - Currency code for the funding source. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: USD - description: Source account details - - title: Real-time funding - type: object - required: - - currency - - customerId - properties: - customerId: - type: string - description: >- - Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. - If customerId is not provided, the quote will be created on behalf of the platform itself. - example: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: - type: string - description: >- - Currency code for the funding source. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: USD - description: >- - Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). - This will require manual just-in-time funding using `paymentInstructions` in the response. - Because quotes expire quickly, this option is only valid for instant payment methods. Do not try - to fund a quote with a non-instant payment method (ACH, etc.). + - $ref: ./QuoteAccountSource.yaml + - $ref: ./QuoteRealtimeFundingSource.yaml +discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./QuoteAccountSource.yaml + REALTIME_FUNDING: ./QuoteRealtimeFundingSource.yaml diff --git a/openapi/components/schemas/quotes/QuoteUmaAddressDestination.yaml b/openapi/components/schemas/quotes/QuoteUmaAddressDestination.yaml new file mode 100644 index 0000000..14bf5ab --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteUmaAddressDestination.yaml @@ -0,0 +1,28 @@ +type: object +required: + - destinationType + - umaAddress +properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + counterpartyInformation: + type: object + description: >- + Information about the recipient, as required by the platform in their + configuration. + additionalProperties: true + example: + FULL_NAME: Jane Receiver + BIRTH_DATE: '1990-01-01' + NATIONALITY: FR +description: UMA address destination details diff --git a/openapi/components/schemas/transactions/AccountDestination.yaml b/openapi/components/schemas/transactions/AccountDestination.yaml new file mode 100644 index 0000000..847b568 --- /dev/null +++ b/openapi/components/schemas/transactions/AccountDestination.yaml @@ -0,0 +1,19 @@ +type: object +required: + - destinationType + - accountId + - currency +properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR +description: Destination account details diff --git a/openapi/components/schemas/transactions/AccountSource.yaml b/openapi/components/schemas/transactions/AccountSource.yaml new file mode 100644 index 0000000..4e049a7 --- /dev/null +++ b/openapi/components/schemas/transactions/AccountSource.yaml @@ -0,0 +1,19 @@ +type: object +required: + - sourceType + - accountId + - currency +properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + currency: + type: string + description: Currency code for the source account + example: USD +description: Source account details diff --git a/openapi/components/schemas/transactions/IncomingTransaction.yaml b/openapi/components/schemas/transactions/IncomingTransaction.yaml index ebd4fe0..e2dc458 100644 --- a/openapi/components/schemas/transactions/IncomingTransaction.yaml +++ b/openapi/components/schemas/transactions/IncomingTransaction.yaml @@ -7,34 +7,14 @@ allOf: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: ./AccountSource.yaml - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: ./UmaAddressSource.yaml + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountSource.yaml + UMA_ADDRESS: ./UmaAddressSource.yaml receivedAmount: $ref: ../common/CurrencyAmount.yaml description: Amount received in the recipient's currency diff --git a/openapi/components/schemas/transactions/OutgoingTransaction.yaml b/openapi/components/schemas/transactions/OutgoingTransaction.yaml index 56700ff..88ad323 100644 --- a/openapi/components/schemas/transactions/OutgoingTransaction.yaml +++ b/openapi/components/schemas/transactions/OutgoingTransaction.yaml @@ -9,34 +9,14 @@ allOf: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: ./AccountSource.yaml - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: ./UmaAddressSource.yaml + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountSource.yaml + UMA_ADDRESS: ./UmaAddressSource.yaml sentAmount: $ref: ../common/CurrencyAmount.yaml description: Amount sent in the sender's currency @@ -70,15 +50,6 @@ allOf: description: Payment instructions for executing the payment. items: $ref: ../common/PaymentInstructions.yaml - example: - - accountType: US_ACCOUNT - accountNumber: "1234567890" - routingNumber: "021000021" - bankName: "Chase Bank" - referenceCode: "REF123456" - - accountType: SPARK_WALLET - address: "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - invoice: "lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs" refund: $ref: ../common/Refund.yaml description: The refund if transaction was refunded. diff --git a/openapi/components/schemas/transactions/Transaction.yaml b/openapi/components/schemas/transactions/Transaction.yaml index 83f5c80..05cfb01 100644 --- a/openapi/components/schemas/transactions/Transaction.yaml +++ b/openapi/components/schemas/transactions/Transaction.yaml @@ -17,34 +17,13 @@ properties: $ref: ./TransactionType.yaml destination: oneOf: - - title: Account Destination - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR + - $ref: ./AccountDestination.yaml + - $ref: ./UmaAddressDestination.yaml + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./AccountDestination.yaml + UMA_ADDRESS: ./UmaAddressDestination.yaml customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) diff --git a/openapi/components/schemas/transactions/UmaAddressDestination.yaml b/openapi/components/schemas/transactions/UmaAddressDestination.yaml new file mode 100644 index 0000000..5b7e6a7 --- /dev/null +++ b/openapi/components/schemas/transactions/UmaAddressDestination.yaml @@ -0,0 +1,18 @@ +type: object +required: + - destinationType + - umaAddress +properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR +description: UMA address destination details diff --git a/openapi/components/schemas/transactions/UmaAddressSource.yaml b/openapi/components/schemas/transactions/UmaAddressSource.yaml new file mode 100644 index 0000000..5b5fc11 --- /dev/null +++ b/openapi/components/schemas/transactions/UmaAddressSource.yaml @@ -0,0 +1,18 @@ +type: object +required: + - sourceType + - umaAddress +properties: + sourceType: + type: string + const: UMA_ADDRESS + description: Source type identifier + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + currency: + type: string + description: Currency code for the source + example: USD +description: UMA address source details diff --git a/openapi/paths/quotes/quotes.yaml b/openapi/paths/quotes/quotes.yaml index 30c5e75..05b660a 100644 --- a/openapi/paths/quotes/quotes.yaml +++ b/openapi/paths/quotes/quotes.yaml @@ -37,47 +37,6 @@ post: application/json: schema: $ref: ../../components/schemas/quotes/QuoteRequest.yaml - examples: - accountToAccount: - summary: Account to Account Transfer - value: - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 10000 - description: 'Transfer between accounts, either internal or external.' - accountToUma: - summary: Account to UMA Address Transfer - value: - lookupId: LookupRequest:019542f5-b3e7-1d02-0000-000000000009 - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - umaAddress: $receiver@uma.domain.com - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 1000 - description: 'Payment for invoice #1234' - realTimeFundingToSparkWallet: - summary: Real-time funding to Spark Wallet as an on-ramp flow. Immediate execution. - value: - source: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: USD - destination: - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - lockedCurrencySide: RECEIVING - lockedCurrencyAmount: 10000 - immediatelyExecute: true - description: 'Bitcoin reward payout!' responses: '201': description: |