diff --git a/.github/workflows/stainless-action.yml b/.github/workflows/stainless-action.yml index 0de4a72..895b84b 100644 --- a/.github/workflows/stainless-action.yml +++ b/.github/workflows/stainless-action.yml @@ -37,6 +37,7 @@ jobs: org: ${{ env.STAINLESS_ORG }} project: ${{ env.STAINLESS_PROJECT }} oas_path: ${{ env.OAS_PATH }} + guess_config: true merge: if: github.event.action == 'closed' && github.event.pull_request.merged == true diff --git a/.stainless/stainless.yml b/.stainless/stainless.yml index 5817a8a..c99d3bf 100644 --- a/.stainless/stainless.yml +++ b/.stainless/stainless.yml @@ -10,7 +10,7 @@ organization: # and headings. name: grid # Link to your API documentation. - docs: '' + docs: 'grid.lightspark.com' # Contact email for bug reports, questions, and support requests. contact: support@lightspark.com @@ -229,6 +229,11 @@ resources: list: get /tokens retrieve: get /tokens/{tokenId} delete: delete /tokens/{tokenId} + exchange_rates: + methods: + list: + endpoint: get /exchange-rates + paginated: false settings: # All generated integration tests that hit the prism mock http server are marked @@ -326,6 +331,86 @@ openapi: args: unionPath: AllErrors enumProperty: code + # ── customerType: IndividualCustomerFields / BusinessCustomerFields ── + - command: remove + reason: >- + Remove inline customerType enums from customer fields schemas to avoid + conflicting types when allOf merges them with base schemas (Customer, + CustomerCreateRequest, CustomerUpdateRequest) that define customerType + via the shared CustomerType $ref + args: + target: + - "$.components.schemas.IndividualCustomerFields.properties" + - "$.components.schemas.BusinessCustomerFields.properties" + keys: [ "customerType" ] + + # ── accountType: common account info schemas ── + - command: remove + reason: >- + Remove inline accountType enums from common account info schemas to + avoid conflicting types when allOf merges them with + BaseExternalAccountInfo or BasePaymentAccountInfo, which define + accountType via shared $ref enums + args: + target: + - "$.components.schemas.UsAccountInfo.properties" + - "$.components.schemas.ClabeAccountInfo.properties" + - "$.components.schemas.PixAccountInfo.properties" + - "$.components.schemas.IbanAccountInfo.properties" + - "$.components.schemas.UpiAccountInfo.properties" + - "$.components.schemas.NgnAccountInfo.properties" + - "$.components.schemas.CadAccountInfo.properties" + - "$.components.schemas.GbpAccountInfo.properties" + - "$.components.schemas.PhpAccountInfo.properties" + - "$.components.schemas.SgdAccountInfo.properties" + - "$.components.schemas.SparkWalletInfo.properties" + - "$.components.schemas.LightningInfo.properties" + - "$.components.schemas.SolanaWalletInfo.properties" + - "$.components.schemas.TronWalletInfo.properties" + - "$.components.schemas.PolygonWalletInfo.properties" + - "$.components.schemas.BaseWalletInfo.properties" + keys: [ "accountType" ] + + # ── sourceType: transaction and quote source schemas ── + - command: remove + reason: >- + Remove inline sourceType enums from transaction and quote source + allOf variants to avoid conflicting types with their base schemas + which define sourceType via shared $ref enums + args: + target: + - "$.components.schemas.AccountTransactionSource.allOf[1].properties" + - "$.components.schemas.UmaAddressTransactionSource.allOf[1].properties" + - "$.components.schemas.AccountQuoteSource.allOf[1].properties" + - "$.components.schemas.RealtimeFundingQuoteSource.allOf[1].properties" + keys: [ "sourceType" ] + + # ── destinationType: transaction and quote destination schemas ── + - command: remove + reason: >- + Remove inline destinationType enums from transaction and quote + destination allOf variants to avoid conflicting types with their + base schemas which define destinationType via shared $ref enums + args: + target: + - "$.components.schemas.AccountTransactionDestination.allOf[1].properties" + - "$.components.schemas.UmaAddressTransactionDestination.allOf[1].properties" + - "$.components.schemas.AccountDestination.allOf[1].properties" + - "$.components.schemas.UmaAddressDestination.allOf[1].properties" + - "$.components.schemas.ExternalAccountDetailsDestination.allOf[1].properties" + keys: [ "destinationType" ] + + # ── beneficiaryType: beneficiary schemas ── + - command: remove + reason: >- + Remove inline beneficiaryType enums from beneficiary allOf variants + to avoid conflicting types with BaseBeneficiary which defines + beneficiaryType via a shared $ref enum + args: + target: + - "$.components.schemas.IndividualBeneficiary.allOf[1].properties" + - "$.components.schemas.BusinessBeneficiary.allOf[1].properties" + keys: [ "beneficiaryType" ] errors: union: @@ -339,3 +424,4 @@ diagnostics: ignored: Schema/ObjectHasNoProperties: - pagination.0.response.data.items + Schema/EnumHasOneMember: true diff --git a/.stainless/workspace.json b/.stainless/workspace.json index 1af9854..7cdd3c1 100644 --- a/.stainless/workspace.json +++ b/.stainless/workspace.json @@ -5,6 +5,9 @@ "targets": { "typescript": { "output_path": "../sdks/grid-typescript" + }, + "kotlin": { + "output_path": "../sdks/grid-kotlin" } } } diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index 5a660fe..92cf6f6 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -38,6 +38,8 @@ tags: description: Endpoints to trigger test cases in sandbox - name: API Tokens description: Endpoints to programmatically manage API tokens + - name: Exchange Rates + description: Endpoints for retrieving cached foreign exchange rates. Rates are cached for approximately 5 minutes and include platform-specific fees. paths: /config: get: @@ -140,6 +142,126 @@ paths: application/json: schema: $ref: '#/components/schemas/Error501' + /exchange-rates: + get: + summary: Get exchange rates + description: | + Retrieve cached exchange rates for currency corridors. Returns FX rates that are cached + for approximately 5 minutes. Rates include fees specific to your platform for authenticated requests. + + **Filtering Options:** + - Filter by source currency to get all available destination corridors + - Filter by specific destination currency or currencies + - Provide a sending amount to get calculated receiving amounts + operationId: getExchangeRates + tags: + - Exchange Rates + security: + - BasicAuth: [] + parameters: + - name: sourceCurrency + in: query + description: Filter by source currency code (e.g., USD) + required: false + schema: + type: string + example: USD + - name: destinationCurrency + in: query + description: Filter by destination currency code(s). Can be repeated for multiple currencies (e.g., &destinationCurrency=INR&destinationCurrency=GBP) + required: false + style: form + explode: true + schema: + type: array + items: + type: string + example: + - INR + - name: sendingAmount + in: query + description: Sending amount in the smallest unit of the source currency (e.g., cents for USD). If no amount is provided, the default is 10000 in the sending currency smallest unit. + required: false + schema: + type: integer + format: int64 + minimum: 0 + default: 10000 + example: 10000 + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + description: List of exchange rates matching the filter criteria + items: + $ref: '#/components/schemas/ExchangeRate' + examples: + allRatesFromUSD: + summary: All exchange rates from USD + value: + data: + - sourceCurrency: + code: USD + decimals: 2 + name: US Dollar + symbol: $ + sourcePaymentRail: RTP + sendingAmount: 10000 + destinationCurrency: + code: INR + decimals: 2 + name: Indian Rupee + symbol: ₹ + destinationPaymentRail: UPI + receivingAmount: 1650000 + exchangeRate: 82.5 + fees: + fixed: 100 + updatedAt: '2025-02-05T12:00:00Z' + - sourceCurrency: + code: USD + decimals: 2 + name: US Dollar + symbol: $ + sourcePaymentRail: RTP + sendingAmount: 10000 + destinationCurrency: + code: EUR + decimals: 2 + name: Euro + symbol: € + destinationPaymentRail: SEPA_INSTANT + receivingAmount: 18500 + exchangeRate: 0.925 + fees: + fixed: 10 + updatedAt: '2025-02-05T12:00:00Z' + '400': + description: Bad request - Invalid parameters + content: + application/json: + schema: + $ref: '#/components/schemas/Error400' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error401' + '500': + description: Internal service error + content: + application/json: + schema: + $ref: '#/components/schemas/Error500' /customers: post: summary: Add a new customer @@ -4113,6 +4235,84 @@ components: type: object description: Additional error details additionalProperties: true + Currency: + type: object + properties: + code: + type: string + description: Three-letter currency code (ISO 4217) for fiat currencies. Some cryptocurrencies may use their own ticker symbols (e.g. "BTC" for Bitcoin, "USDC" for USDC, etc.) + example: USD + name: + type: string + description: Full name of the currency + example: United States Dollar + symbol: + type: string + description: Symbol of the currency + example: $ + decimals: + type: integer + description: Number of decimal places for the currency + minimum: 0 + example: 2 + ExchangeRateFees: + type: object + description: Fees associated with an exchange rate + properties: + fixed: + type: integer + format: int64 + description: Fixed fee in the smallest unit of the sending currency (e.g., cents for USD) + minimum: 0 + example: 100 + ExchangeRate: + type: object + description: Exchange rate information for a currency corridor + required: + - sourceCurrency + - destinationCurrency + - destinationPaymentRail + - receivingAmount + - exchangeRate + - fees + - updatedAt + properties: + sourceCurrency: + $ref: '#/components/schemas/Currency' + sourcePaymentRail: + type: string + description: The payment rail used for the source (e.g., ACCOUNT, RTP) + example: ACCOUNT + sendingAmount: + type: integer + format: int64 + description: The sending amount in the smallest unit of the source currency (e.g., cents for USD). Echoed back from the request if provided. + minimum: 0 + example: 10000 + destinationCurrency: + $ref: '#/components/schemas/Currency' + destinationPaymentRail: + type: string + description: The payment rail used for the destination (e.g., UPI, SEPA_INSTANT, MOBILE_MONEY, FASTER_PAYMENTS) + example: UPI + receivingAmount: + type: integer + format: int64 + description: The receiving amount in the smallest unit of the destination currency + minimum: 0 + example: 1650000 + exchangeRate: + type: number + description: Number of destination currency units per sending currency unit + exclusiveMinimum: 0 + example: 82.5 + fees: + $ref: '#/components/schemas/ExchangeRateFees' + updatedAt: + type: string + format: date-time + description: Timestamp when this exchange rate was last refreshed + example: '2025-02-05T12:00:00Z' CustomerType: type: string enum: @@ -4273,8 +4473,6 @@ components: example: CEO, COO, President BusinessCustomerFields: type: object - required: - - customerType properties: customerType: type: string @@ -4328,8 +4526,6 @@ components: example: APPROVED IndividualCustomerFields: type: object - required: - - customerType properties: customerType: type: string @@ -4537,26 +4733,6 @@ components: mapping: INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdateRequest' BUSINESS: '#/components/schemas/BusinessCustomerUpdateRequest' - Currency: - type: object - properties: - code: - type: string - description: Three-letter currency code (ISO 4217) for fiat currencies. Some cryptocurrencies may use their own ticker symbols (e.g. "BTC" for Bitcoin, "USDC" for USDC, etc.) - example: USD - name: - type: string - description: Full name of the currency - example: United States Dollar - symbol: - type: string - description: Symbol of the currency - example: $ - decimals: - type: integer - description: Number of decimal places for the currency - minimum: 0 - example: 2 CurrencyAmount: type: object required: @@ -4610,7 +4786,6 @@ components: - accountNumber - routingNumber - accountCategory - - accountType properties: accountType: type: string @@ -4656,7 +4831,6 @@ components: - pixKey - pixKeyType - taxId - - accountType properties: accountType: type: string @@ -4689,7 +4863,6 @@ components: required: - iban - swiftBic - - accountType properties: accountType: type: string @@ -4724,7 +4897,6 @@ components: type: object required: - vpa - - accountType properties: accountType: type: string @@ -4743,7 +4915,6 @@ components: required: - accountNumber - bankName - - accountType properties: accountType: type: string @@ -4776,7 +4947,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4819,7 +4989,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4845,7 +5014,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4870,7 +5038,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4895,7 +5062,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4937,7 +5103,6 @@ components: type: object required: - clabeNumber - - accountType properties: accountType: type: string @@ -5087,7 +5252,6 @@ components: - fullName - birthDate - nationality - - beneficiaryType properties: beneficiaryType: type: string @@ -5126,7 +5290,6 @@ components: - type: object required: - legalName - - beneficiaryType properties: beneficiaryType: type: string @@ -5236,7 +5399,6 @@ components: - bankCode - branchCode - accountNumber - - accountType properties: accountType: type: string @@ -5278,7 +5440,6 @@ components: required: - sortCode - accountNumber - - accountType properties: accountType: type: string @@ -5311,7 +5472,6 @@ components: required: - bankName - accountNumber - - accountType properties: accountType: type: string @@ -5341,7 +5501,6 @@ components: - bankName - swiftCode - accountNumber - - accountType properties: accountType: type: string @@ -5376,31 +5535,31 @@ components: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SparkWalletInfo' + LightningInfo: + type: object + description: | + Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. + properties: + accountType: + type: string + enum: + - LIGHTNING + invoice: + type: string + description: 1-time use lightning bolt11 invoice payout destination + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + bolt12: + type: string + description: A bolt12 offer which can be reused as a payment destination + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + lightningAddress: + type: string + description: A lightning address which can be used as a payment destination. Note that for UMA addresses, no external account is needed. You can use the UMA address directly as a destination. + example: john.doe@lightningwallet.com LightningExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - - type: object - description: | - Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. - required: - - accountType - properties: - accountType: - type: string - enum: - - LIGHTNING - invoice: - type: string - description: 1-time use lightning bolt11 invoice payout destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - bolt12: - type: string - description: A bolt12 offer which can be reused as a payment destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - lightningAddress: - type: string - description: A lightning address which can be used as a payment destination. Note that for UMA addresses, no external account is needed. You can use the UMA address directly as a destination. - example: john.doe@lightningwallet.com + - $ref: '#/components/schemas/LightningInfo' SolanaWalletExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' @@ -5670,7 +5829,6 @@ components: - type: object required: - accountId - - sourceType properties: sourceType: type: string @@ -5703,7 +5861,6 @@ components: - type: object required: - umaAddress - - sourceType properties: sourceType: type: string @@ -5962,7 +6119,6 @@ components: - type: object required: - accountId - - destinationType properties: destinationType: type: string @@ -5995,7 +6151,6 @@ components: - type: object required: - umaAddress - - destinationType properties: destinationType: type: string @@ -6137,7 +6292,6 @@ components: - type: object required: - accountId - - sourceType properties: sourceType: type: string @@ -6170,7 +6324,6 @@ components: - type: object required: - currency - - sourceType properties: sourceType: type: string @@ -6209,7 +6362,6 @@ components: - type: object required: - accountId - - destinationType properties: destinationType: type: string @@ -6239,7 +6391,6 @@ components: - type: object required: - umaAddress - - destinationType properties: destinationType: type: string @@ -6268,7 +6419,6 @@ components: - type: object required: - externalAccountDetails - - destinationType properties: destinationType: type: string diff --git a/openapi.yaml b/openapi.yaml index 5a660fe..92cf6f6 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -38,6 +38,8 @@ tags: description: Endpoints to trigger test cases in sandbox - name: API Tokens description: Endpoints to programmatically manage API tokens + - name: Exchange Rates + description: Endpoints for retrieving cached foreign exchange rates. Rates are cached for approximately 5 minutes and include platform-specific fees. paths: /config: get: @@ -140,6 +142,126 @@ paths: application/json: schema: $ref: '#/components/schemas/Error501' + /exchange-rates: + get: + summary: Get exchange rates + description: | + Retrieve cached exchange rates for currency corridors. Returns FX rates that are cached + for approximately 5 minutes. Rates include fees specific to your platform for authenticated requests. + + **Filtering Options:** + - Filter by source currency to get all available destination corridors + - Filter by specific destination currency or currencies + - Provide a sending amount to get calculated receiving amounts + operationId: getExchangeRates + tags: + - Exchange Rates + security: + - BasicAuth: [] + parameters: + - name: sourceCurrency + in: query + description: Filter by source currency code (e.g., USD) + required: false + schema: + type: string + example: USD + - name: destinationCurrency + in: query + description: Filter by destination currency code(s). Can be repeated for multiple currencies (e.g., &destinationCurrency=INR&destinationCurrency=GBP) + required: false + style: form + explode: true + schema: + type: array + items: + type: string + example: + - INR + - name: sendingAmount + in: query + description: Sending amount in the smallest unit of the source currency (e.g., cents for USD). If no amount is provided, the default is 10000 in the sending currency smallest unit. + required: false + schema: + type: integer + format: int64 + minimum: 0 + default: 10000 + example: 10000 + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + description: List of exchange rates matching the filter criteria + items: + $ref: '#/components/schemas/ExchangeRate' + examples: + allRatesFromUSD: + summary: All exchange rates from USD + value: + data: + - sourceCurrency: + code: USD + decimals: 2 + name: US Dollar + symbol: $ + sourcePaymentRail: RTP + sendingAmount: 10000 + destinationCurrency: + code: INR + decimals: 2 + name: Indian Rupee + symbol: ₹ + destinationPaymentRail: UPI + receivingAmount: 1650000 + exchangeRate: 82.5 + fees: + fixed: 100 + updatedAt: '2025-02-05T12:00:00Z' + - sourceCurrency: + code: USD + decimals: 2 + name: US Dollar + symbol: $ + sourcePaymentRail: RTP + sendingAmount: 10000 + destinationCurrency: + code: EUR + decimals: 2 + name: Euro + symbol: € + destinationPaymentRail: SEPA_INSTANT + receivingAmount: 18500 + exchangeRate: 0.925 + fees: + fixed: 10 + updatedAt: '2025-02-05T12:00:00Z' + '400': + description: Bad request - Invalid parameters + content: + application/json: + schema: + $ref: '#/components/schemas/Error400' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error401' + '500': + description: Internal service error + content: + application/json: + schema: + $ref: '#/components/schemas/Error500' /customers: post: summary: Add a new customer @@ -4113,6 +4235,84 @@ components: type: object description: Additional error details additionalProperties: true + Currency: + type: object + properties: + code: + type: string + description: Three-letter currency code (ISO 4217) for fiat currencies. Some cryptocurrencies may use their own ticker symbols (e.g. "BTC" for Bitcoin, "USDC" for USDC, etc.) + example: USD + name: + type: string + description: Full name of the currency + example: United States Dollar + symbol: + type: string + description: Symbol of the currency + example: $ + decimals: + type: integer + description: Number of decimal places for the currency + minimum: 0 + example: 2 + ExchangeRateFees: + type: object + description: Fees associated with an exchange rate + properties: + fixed: + type: integer + format: int64 + description: Fixed fee in the smallest unit of the sending currency (e.g., cents for USD) + minimum: 0 + example: 100 + ExchangeRate: + type: object + description: Exchange rate information for a currency corridor + required: + - sourceCurrency + - destinationCurrency + - destinationPaymentRail + - receivingAmount + - exchangeRate + - fees + - updatedAt + properties: + sourceCurrency: + $ref: '#/components/schemas/Currency' + sourcePaymentRail: + type: string + description: The payment rail used for the source (e.g., ACCOUNT, RTP) + example: ACCOUNT + sendingAmount: + type: integer + format: int64 + description: The sending amount in the smallest unit of the source currency (e.g., cents for USD). Echoed back from the request if provided. + minimum: 0 + example: 10000 + destinationCurrency: + $ref: '#/components/schemas/Currency' + destinationPaymentRail: + type: string + description: The payment rail used for the destination (e.g., UPI, SEPA_INSTANT, MOBILE_MONEY, FASTER_PAYMENTS) + example: UPI + receivingAmount: + type: integer + format: int64 + description: The receiving amount in the smallest unit of the destination currency + minimum: 0 + example: 1650000 + exchangeRate: + type: number + description: Number of destination currency units per sending currency unit + exclusiveMinimum: 0 + example: 82.5 + fees: + $ref: '#/components/schemas/ExchangeRateFees' + updatedAt: + type: string + format: date-time + description: Timestamp when this exchange rate was last refreshed + example: '2025-02-05T12:00:00Z' CustomerType: type: string enum: @@ -4273,8 +4473,6 @@ components: example: CEO, COO, President BusinessCustomerFields: type: object - required: - - customerType properties: customerType: type: string @@ -4328,8 +4526,6 @@ components: example: APPROVED IndividualCustomerFields: type: object - required: - - customerType properties: customerType: type: string @@ -4537,26 +4733,6 @@ components: mapping: INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdateRequest' BUSINESS: '#/components/schemas/BusinessCustomerUpdateRequest' - Currency: - type: object - properties: - code: - type: string - description: Three-letter currency code (ISO 4217) for fiat currencies. Some cryptocurrencies may use their own ticker symbols (e.g. "BTC" for Bitcoin, "USDC" for USDC, etc.) - example: USD - name: - type: string - description: Full name of the currency - example: United States Dollar - symbol: - type: string - description: Symbol of the currency - example: $ - decimals: - type: integer - description: Number of decimal places for the currency - minimum: 0 - example: 2 CurrencyAmount: type: object required: @@ -4610,7 +4786,6 @@ components: - accountNumber - routingNumber - accountCategory - - accountType properties: accountType: type: string @@ -4656,7 +4831,6 @@ components: - pixKey - pixKeyType - taxId - - accountType properties: accountType: type: string @@ -4689,7 +4863,6 @@ components: required: - iban - swiftBic - - accountType properties: accountType: type: string @@ -4724,7 +4897,6 @@ components: type: object required: - vpa - - accountType properties: accountType: type: string @@ -4743,7 +4915,6 @@ components: required: - accountNumber - bankName - - accountType properties: accountType: type: string @@ -4776,7 +4947,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4819,7 +4989,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4845,7 +5014,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4870,7 +5038,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4895,7 +5062,6 @@ components: type: object required: - address - - accountType properties: accountType: type: string @@ -4937,7 +5103,6 @@ components: type: object required: - clabeNumber - - accountType properties: accountType: type: string @@ -5087,7 +5252,6 @@ components: - fullName - birthDate - nationality - - beneficiaryType properties: beneficiaryType: type: string @@ -5126,7 +5290,6 @@ components: - type: object required: - legalName - - beneficiaryType properties: beneficiaryType: type: string @@ -5236,7 +5399,6 @@ components: - bankCode - branchCode - accountNumber - - accountType properties: accountType: type: string @@ -5278,7 +5440,6 @@ components: required: - sortCode - accountNumber - - accountType properties: accountType: type: string @@ -5311,7 +5472,6 @@ components: required: - bankName - accountNumber - - accountType properties: accountType: type: string @@ -5341,7 +5501,6 @@ components: - bankName - swiftCode - accountNumber - - accountType properties: accountType: type: string @@ -5376,31 +5535,31 @@ components: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SparkWalletInfo' + LightningInfo: + type: object + description: | + Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. + properties: + accountType: + type: string + enum: + - LIGHTNING + invoice: + type: string + description: 1-time use lightning bolt11 invoice payout destination + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + bolt12: + type: string + description: A bolt12 offer which can be reused as a payment destination + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + lightningAddress: + type: string + description: A lightning address which can be used as a payment destination. Note that for UMA addresses, no external account is needed. You can use the UMA address directly as a destination. + example: john.doe@lightningwallet.com LightningExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - - type: object - description: | - Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. - required: - - accountType - properties: - accountType: - type: string - enum: - - LIGHTNING - invoice: - type: string - description: 1-time use lightning bolt11 invoice payout destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - bolt12: - type: string - description: A bolt12 offer which can be reused as a payment destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - lightningAddress: - type: string - description: A lightning address which can be used as a payment destination. Note that for UMA addresses, no external account is needed. You can use the UMA address directly as a destination. - example: john.doe@lightningwallet.com + - $ref: '#/components/schemas/LightningInfo' SolanaWalletExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' @@ -5670,7 +5829,6 @@ components: - type: object required: - accountId - - sourceType properties: sourceType: type: string @@ -5703,7 +5861,6 @@ components: - type: object required: - umaAddress - - sourceType properties: sourceType: type: string @@ -5962,7 +6119,6 @@ components: - type: object required: - accountId - - destinationType properties: destinationType: type: string @@ -5995,7 +6151,6 @@ components: - type: object required: - umaAddress - - destinationType properties: destinationType: type: string @@ -6137,7 +6292,6 @@ components: - type: object required: - accountId - - sourceType properties: sourceType: type: string @@ -6170,7 +6324,6 @@ components: - type: object required: - currency - - sourceType properties: sourceType: type: string @@ -6209,7 +6362,6 @@ components: - type: object required: - accountId - - destinationType properties: destinationType: type: string @@ -6239,7 +6391,6 @@ components: - type: object required: - umaAddress - - destinationType properties: destinationType: type: string @@ -6268,7 +6419,6 @@ components: - type: object required: - externalAccountDetails - - destinationType properties: destinationType: type: string diff --git a/openapi/components/schemas/common/BaseWalletInfo.yaml b/openapi/components/schemas/common/BaseWalletInfo.yaml index 6a3ef9a..3cd4cc8 100644 --- a/openapi/components/schemas/common/BaseWalletInfo.yaml +++ b/openapi/components/schemas/common/BaseWalletInfo.yaml @@ -1,7 +1,6 @@ type: object required: - address - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/CadAccountInfo.yaml b/openapi/components/schemas/common/CadAccountInfo.yaml index 5504fe9..90d203b 100644 --- a/openapi/components/schemas/common/CadAccountInfo.yaml +++ b/openapi/components/schemas/common/CadAccountInfo.yaml @@ -3,7 +3,6 @@ required: - bankCode - branchCode - accountNumber - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/ClabeAccountInfo.yaml b/openapi/components/schemas/common/ClabeAccountInfo.yaml index 6f70a2f..d9dc24d 100644 --- a/openapi/components/schemas/common/ClabeAccountInfo.yaml +++ b/openapi/components/schemas/common/ClabeAccountInfo.yaml @@ -1,7 +1,6 @@ type: object required: - clabeNumber - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/GbpAccountInfo.yaml b/openapi/components/schemas/common/GbpAccountInfo.yaml index 68a9a16..2d218a7 100644 --- a/openapi/components/schemas/common/GbpAccountInfo.yaml +++ b/openapi/components/schemas/common/GbpAccountInfo.yaml @@ -2,7 +2,6 @@ type: object required: - sortCode - accountNumber - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/IbanAccountInfo.yaml b/openapi/components/schemas/common/IbanAccountInfo.yaml index 51a2c9d..4455d6d 100644 --- a/openapi/components/schemas/common/IbanAccountInfo.yaml +++ b/openapi/components/schemas/common/IbanAccountInfo.yaml @@ -2,7 +2,6 @@ type: object required: - iban - swiftBic - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/LightningInfo.yaml b/openapi/components/schemas/common/LightningInfo.yaml new file mode 100644 index 0000000..e935731 --- /dev/null +++ b/openapi/components/schemas/common/LightningInfo.yaml @@ -0,0 +1,20 @@ +type: object +description: > + Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. +properties: + accountType: + type: string + enum: + - LIGHTNING + invoice: + type: string + description: 1-time use lightning bolt11 invoice payout destination + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + bolt12: + type: string + description: A bolt12 offer which can be reused as a payment destination + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + lightningAddress: + type: string + description: A lightning address which can be used as a payment destination. Note that for UMA addresses, no external account is needed. You can use the UMA address directly as a destination. + example: john.doe@lightningwallet.com diff --git a/openapi/components/schemas/common/NgnAccountInfo.yaml b/openapi/components/schemas/common/NgnAccountInfo.yaml index cd9eb30..ece1be4 100644 --- a/openapi/components/schemas/common/NgnAccountInfo.yaml +++ b/openapi/components/schemas/common/NgnAccountInfo.yaml @@ -2,7 +2,6 @@ type: object required: - accountNumber - bankName - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/PhpAccountInfo.yaml b/openapi/components/schemas/common/PhpAccountInfo.yaml index 9b01eda..028ed9b 100644 --- a/openapi/components/schemas/common/PhpAccountInfo.yaml +++ b/openapi/components/schemas/common/PhpAccountInfo.yaml @@ -2,7 +2,6 @@ type: object required: - bankName - accountNumber - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/PixAccountInfo.yaml b/openapi/components/schemas/common/PixAccountInfo.yaml index fb37639..3d0d53b 100644 --- a/openapi/components/schemas/common/PixAccountInfo.yaml +++ b/openapi/components/schemas/common/PixAccountInfo.yaml @@ -3,7 +3,6 @@ required: - pixKey - pixKeyType - taxId - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/PolygonWalletInfo.yaml b/openapi/components/schemas/common/PolygonWalletInfo.yaml index 0b52715..9329b51 100644 --- a/openapi/components/schemas/common/PolygonWalletInfo.yaml +++ b/openapi/components/schemas/common/PolygonWalletInfo.yaml @@ -1,7 +1,6 @@ type: object required: - address - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/SgdAccountInfo.yaml b/openapi/components/schemas/common/SgdAccountInfo.yaml index 1821b63..a770309 100644 --- a/openapi/components/schemas/common/SgdAccountInfo.yaml +++ b/openapi/components/schemas/common/SgdAccountInfo.yaml @@ -3,7 +3,6 @@ required: - bankName - swiftCode - accountNumber - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/SolanaWalletInfo.yaml b/openapi/components/schemas/common/SolanaWalletInfo.yaml index a2ff50c..1e423f3 100644 --- a/openapi/components/schemas/common/SolanaWalletInfo.yaml +++ b/openapi/components/schemas/common/SolanaWalletInfo.yaml @@ -1,7 +1,6 @@ type: object required: - address - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/SparkWalletInfo.yaml b/openapi/components/schemas/common/SparkWalletInfo.yaml index 0706532..5274a1d 100644 --- a/openapi/components/schemas/common/SparkWalletInfo.yaml +++ b/openapi/components/schemas/common/SparkWalletInfo.yaml @@ -1,7 +1,6 @@ type: object required: - address - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/TronWalletInfo.yaml b/openapi/components/schemas/common/TronWalletInfo.yaml index 3bffa8c..79f5e46 100644 --- a/openapi/components/schemas/common/TronWalletInfo.yaml +++ b/openapi/components/schemas/common/TronWalletInfo.yaml @@ -1,7 +1,6 @@ type: object required: - address - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/UpiAccountInfo.yaml b/openapi/components/schemas/common/UpiAccountInfo.yaml index dc579b6..1ba4134 100644 --- a/openapi/components/schemas/common/UpiAccountInfo.yaml +++ b/openapi/components/schemas/common/UpiAccountInfo.yaml @@ -1,7 +1,6 @@ type: object required: - vpa - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/common/UsAccountInfo.yaml b/openapi/components/schemas/common/UsAccountInfo.yaml index e567351..6b5fab3 100644 --- a/openapi/components/schemas/common/UsAccountInfo.yaml +++ b/openapi/components/schemas/common/UsAccountInfo.yaml @@ -3,7 +3,6 @@ required: - accountNumber - routingNumber - accountCategory - - accountType properties: accountType: type: string diff --git a/openapi/components/schemas/customers/BusinessCustomerFields.yaml b/openapi/components/schemas/customers/BusinessCustomerFields.yaml index 998bf83..ad97eb6 100644 --- a/openapi/components/schemas/customers/BusinessCustomerFields.yaml +++ b/openapi/components/schemas/customers/BusinessCustomerFields.yaml @@ -1,6 +1,4 @@ type: object -required: - - customerType properties: customerType: type: string diff --git a/openapi/components/schemas/customers/IndividualCustomerFields.yaml b/openapi/components/schemas/customers/IndividualCustomerFields.yaml index 95616fe..90479b9 100644 --- a/openapi/components/schemas/customers/IndividualCustomerFields.yaml +++ b/openapi/components/schemas/customers/IndividualCustomerFields.yaml @@ -1,6 +1,4 @@ type: object -required: - - customerType properties: customerType: type: string diff --git a/openapi/components/schemas/exchange_rates/ExchangeRate.yaml b/openapi/components/schemas/exchange_rates/ExchangeRate.yaml new file mode 100644 index 0000000..1f20276 --- /dev/null +++ b/openapi/components/schemas/exchange_rates/ExchangeRate.yaml @@ -0,0 +1,47 @@ +type: object +description: Exchange rate information for a currency corridor +required: + - sourceCurrency + - destinationCurrency + - destinationPaymentRail + - receivingAmount + - exchangeRate + - fees + - updatedAt +properties: + sourceCurrency: + $ref: ../common/Currency.yaml + sourcePaymentRail: + type: string + description: The payment rail used for the source (e.g., ACCOUNT, RTP) + example: ACCOUNT + sendingAmount: + type: integer + format: int64 + description: The sending amount in the smallest unit of the source currency (e.g., cents for USD). Echoed back from the request if provided. + minimum: 0 + example: 10000 + destinationCurrency: + $ref: ../common/Currency.yaml + destinationPaymentRail: + type: string + description: The payment rail used for the destination (e.g., UPI, SEPA_INSTANT, MOBILE_MONEY, FASTER_PAYMENTS) + example: UPI + receivingAmount: + type: integer + format: int64 + description: The receiving amount in the smallest unit of the destination currency + minimum: 0 + example: 1650000 + exchangeRate: + type: number + description: Number of destination currency units per sending currency unit + exclusiveMinimum: 0 + example: 82.50 + fees: + $ref: ./ExchangeRateFees.yaml + updatedAt: + type: string + format: date-time + description: Timestamp when this exchange rate was last refreshed + example: "2025-02-05T12:00:00Z" diff --git a/openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml b/openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml new file mode 100644 index 0000000..3c58d7c --- /dev/null +++ b/openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml @@ -0,0 +1,9 @@ +type: object +description: Fees associated with an exchange rate +properties: + fixed: + type: integer + format: int64 + description: Fixed fee in the smallest unit of the sending currency (e.g., cents for USD) + minimum: 0 + example: 100 diff --git a/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml b/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml index bb6ae23..05502c9 100644 --- a/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml +++ b/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - legalName - - beneficiaryType properties: beneficiaryType: type: string diff --git a/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml b/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml index 288ef94..bc380d8 100644 --- a/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml +++ b/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml @@ -5,7 +5,6 @@ allOf: - fullName - birthDate - nationality - - beneficiaryType properties: beneficiaryType: type: string diff --git a/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml index 754c07c..9af277b 100644 --- a/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml @@ -1,24 +1,3 @@ allOf: - $ref: ./BaseExternalAccountInfo.yaml - - type: object - description: > - Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. - required: - - accountType - properties: - accountType: - type: string - enum: - - LIGHTNING - invoice: - type: string - description: 1-time use lightning bolt11 invoice payout destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - bolt12: - type: string - description: A bolt12 offer which can be reused as a payment destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - lightningAddress: - type: string - description: A lightning address which can be used as a payment destination. Note that for UMA addresses, no external account is needed. You can use the UMA address directly as a destination. - example: john.doe@lightningwallet.com + - $ref: ../common/LightningInfo.yaml diff --git a/openapi/components/schemas/quotes/AccountDestination.yaml b/openapi/components/schemas/quotes/AccountDestination.yaml index 8b66265..7bec4de 100644 --- a/openapi/components/schemas/quotes/AccountDestination.yaml +++ b/openapi/components/schemas/quotes/AccountDestination.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - accountId - - destinationType properties: destinationType: type: string diff --git a/openapi/components/schemas/quotes/AccountQuoteSource.yaml b/openapi/components/schemas/quotes/AccountQuoteSource.yaml index 6a31def..4484037 100644 --- a/openapi/components/schemas/quotes/AccountQuoteSource.yaml +++ b/openapi/components/schemas/quotes/AccountQuoteSource.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - accountId - - sourceType properties: sourceType: type: string diff --git a/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml b/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml index 376083f..07b6da5 100644 --- a/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml +++ b/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - externalAccountDetails - - destinationType properties: destinationType: type: string diff --git a/openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml b/openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml index a45b294..0ca1f78 100644 --- a/openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml +++ b/openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - currency - - sourceType properties: sourceType: type: string diff --git a/openapi/components/schemas/quotes/UmaAddressDestination.yaml b/openapi/components/schemas/quotes/UmaAddressDestination.yaml index b60dbe3..77052a7 100644 --- a/openapi/components/schemas/quotes/UmaAddressDestination.yaml +++ b/openapi/components/schemas/quotes/UmaAddressDestination.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - umaAddress - - destinationType properties: destinationType: type: string diff --git a/openapi/components/schemas/transactions/AccountTransactionDestination.yaml b/openapi/components/schemas/transactions/AccountTransactionDestination.yaml index cc04118..87d40a9 100644 --- a/openapi/components/schemas/transactions/AccountTransactionDestination.yaml +++ b/openapi/components/schemas/transactions/AccountTransactionDestination.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - accountId - - destinationType properties: destinationType: type: string diff --git a/openapi/components/schemas/transactions/AccountTransactionSource.yaml b/openapi/components/schemas/transactions/AccountTransactionSource.yaml index a086235..fd9f72e 100644 --- a/openapi/components/schemas/transactions/AccountTransactionSource.yaml +++ b/openapi/components/schemas/transactions/AccountTransactionSource.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - accountId - - sourceType properties: sourceType: type: string diff --git a/openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml b/openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml index 8d1b5dc..c4d242f 100644 --- a/openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml +++ b/openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - umaAddress - - destinationType properties: destinationType: type: string diff --git a/openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml b/openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml index 6bf3678..ade3e7f 100644 --- a/openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml +++ b/openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - umaAddress - - sourceType properties: sourceType: type: string diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 822bbce..45d66a1 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -35,6 +35,10 @@ tags: description: Endpoints to trigger test cases in sandbox - name: API Tokens description: Endpoints to programmatically manage API tokens + - name: Exchange Rates + description: >- + Endpoints for retrieving cached foreign exchange rates. Rates are cached + for approximately 5 minutes and include platform-specific fees. servers: - url: https://api.lightspark.com/grid/2025-10-13 description: Production server @@ -84,6 +88,8 @@ components: paths: /config: $ref: paths/platform/config.yaml + /exchange-rates: + $ref: paths/exchange-rates/exchange_rates.yaml /customers: $ref: paths/customers/customers.yaml /customers/{customerId}: diff --git a/openapi/paths/exchange-rates/exchange_rates.yaml b/openapi/paths/exchange-rates/exchange_rates.yaml new file mode 100644 index 0000000..8fdb97f --- /dev/null +++ b/openapi/paths/exchange-rates/exchange_rates.yaml @@ -0,0 +1,122 @@ +get: + summary: Get exchange rates + description: | + Retrieve cached exchange rates for currency corridors. Returns FX rates that are cached + for approximately 5 minutes. Rates include fees specific to your platform for authenticated requests. + + **Filtering Options:** + - Filter by source currency to get all available destination corridors + - Filter by specific destination currency or currencies + - Provide a sending amount to get calculated receiving amounts + + operationId: getExchangeRates + tags: + - Exchange Rates + security: + - BasicAuth: [] + parameters: + - name: sourceCurrency + in: query + description: Filter by source currency code (e.g., USD) + required: false + schema: + type: string + example: USD + - name: destinationCurrency + in: query + description: >- + Filter by destination currency code(s). Can be repeated for multiple currencies + (e.g., &destinationCurrency=INR&destinationCurrency=GBP) + required: false + style: form + explode: true + schema: + type: array + items: + type: string + example: + - INR + - name: sendingAmount + in: query + description: Sending amount in the smallest unit of the source currency (e.g., cents for USD). If no amount is provided, the default is 10000 in the sending currency smallest unit. + required: false + schema: + type: integer + format: int64 + minimum: 0 + default: 10000 + example: 10000 + responses: + "200": + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + description: List of exchange rates matching the filter criteria + items: + $ref: ../../components/schemas/exchange_rates/ExchangeRate.yaml + examples: + allRatesFromUSD: + summary: All exchange rates from USD + value: + data: + - sourceCurrency: + code: USD + decimals: 2 + name: US Dollar + symbol: "$" + sourcePaymentRail: RTP + sendingAmount: 10000 + destinationCurrency: + code: INR + decimals: 2 + name: Indian Rupee + symbol: "₹" + destinationPaymentRail: UPI + receivingAmount: 1650000 + exchangeRate: 82.50 + fees: + fixed: 100 + updatedAt: "2025-02-05T12:00:00Z" + - sourceCurrency: + code: USD + decimals: 2 + name: US Dollar + symbol: "$" + sourcePaymentRail: RTP + sendingAmount: 10000 + destinationCurrency: + code: EUR + decimals: 2 + name: Euro + symbol: "€" + destinationPaymentRail: SEPA_INSTANT + receivingAmount: 18500 + exchangeRate: 0.925 + fees: + fixed: 10 + updatedAt: "2025-02-05T12:00:00Z" + "400": + description: Bad request - Invalid parameters + content: + application/json: + schema: + $ref: ../../components/schemas/errors/Error400.yaml + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: ../../components/schemas/errors/Error401.yaml + "500": + description: Internal service error + content: + application/json: + schema: + $ref: ../../components/schemas/errors/Error500.yaml