From f173a877a2a6299a2190f681cb615d4e34c405a9 Mon Sep 17 00:00:00 2001 From: Peng Ying Date: Wed, 28 Jan 2026 11:25:16 -0800 Subject: [PATCH] fix: reverting back to using enums instead of const for openapi generator --- mintlify/openapi.yaml | 1537 +++++++++-------- openapi.yaml | 1537 +++++++++-------- .../common/BasePaymentAccountInfo.yaml | 21 + .../schemas/common/BaseWalletInfo.yaml | 6 +- .../schemas/common/CadAccountInfo.yaml | 6 +- .../schemas/common/ClabeAccountInfo.yaml | 6 +- .../schemas/common/FboAccountInfo.yaml | 14 - .../schemas/common/GbpAccountInfo.yaml | 6 +- .../schemas/common/IbanAccountInfo.yaml | 6 +- .../schemas/common/NgnAccountInfo.yaml | 6 +- ...alletType.yaml => PaymentAccountType.yaml} | 4 +- .../schemas/common/PaymentBaseWalletInfo.yaml | 13 +- .../common/PaymentClabeAccountInfo.yaml | 20 +- .../common/PaymentIbanAccountInfo.yaml | 20 +- .../schemas/common/PaymentInstructions.yaml | 2 +- .../common/PaymentLightningInvoiceInfo.yaml | 23 +- .../schemas/common/PaymentNgnAccountInfo.yaml | 20 +- .../schemas/common/PaymentPixAccountInfo.yaml | 1 + .../common/PaymentPolygonWalletInfo.yaml | 14 +- .../common/PaymentSolanaWalletInfo.yaml | 16 +- .../common/PaymentSparkWalletInfo.yaml | 28 +- .../schemas/common/PaymentTronWalletInfo.yaml | 12 +- .../schemas/common/PaymentUpiAccountInfo.yaml | 1 + .../schemas/common/PaymentUsAccountInfo.yaml | 20 +- .../schemas/common/PhpAccountInfo.yaml | 6 +- .../schemas/common/PixAccountInfo.yaml | 6 +- .../schemas/common/PolygonWalletInfo.yaml | 6 +- .../schemas/common/SgdAccountInfo.yaml | 6 +- .../schemas/common/SolanaWalletInfo.yaml | 6 +- .../schemas/common/SparkWalletInfo.yaml | 6 +- .../schemas/common/TronWalletInfo.yaml | 6 +- .../schemas/common/UpiAccountInfo.yaml | 6 +- .../schemas/common/UsAccountInfo.yaml | 6 +- .../schemas/customers/BusinessCustomer.yaml | 6 + .../customers/BusinessCustomerUpdate.yaml | 2 +- .../schemas/customers/CustomerOneOf.yaml | 10 + .../schemas/customers/IndividualCustomer.yaml | 6 + .../components/schemas/errors/Error400.yaml | 3 +- .../components/schemas/errors/Error401.yaml | 3 +- .../components/schemas/errors/Error403.yaml | 3 +- .../components/schemas/errors/Error404.yaml | 3 +- .../components/schemas/errors/Error409.yaml | 3 +- .../components/schemas/errors/Error412.yaml | 5 +- .../components/schemas/errors/Error424.yaml | 3 +- .../components/schemas/errors/Error500.yaml | 3 +- .../components/schemas/errors/Error501.yaml | 3 +- .../external_accounts/BaseBeneficiary.yaml | 13 + .../BaseExternalAccountInfo.yaml | 25 + .../BaseWalletExternalAccountInfo.yaml | 10 +- .../external_accounts/BeneficiaryOneOf.yaml | 10 + .../external_accounts/BeneficiaryType.yaml | 6 + .../BusinessBeneficiary.yaml | 46 +- .../CadAccountExternalAccountInfo.yaml | 15 +- .../ClabeAccountExternalAccountInfo.yaml | 16 +- .../external_accounts/ExternalAccount.yaml | 2 +- .../ExternalAccountCreateRequest.yaml | 2 +- ...nfo.yaml => ExternalAccountInfoOneOf.yaml} | 0 .../ExternalAccountType.yaml | 20 + .../GbpAccountExternalAccountInfo.yaml | 15 +- .../IbanAccountExternalAccountInfo.yaml | 16 +- .../IndividualBeneficiary.yaml | 52 +- .../LightningExternalAccountInfo.yaml | 46 +- .../NgnAccountExternalAccountInfo.yaml | 17 +- .../PhpAccountExternalAccountInfo.yaml | 15 +- .../PixAccountExternalAccountInfo.yaml | 16 +- .../PolygonWalletExternalAccountInfo.yaml | 10 +- .../SgdAccountExternalAccountInfo.yaml | 15 +- .../SolanaWalletExternalAccountInfo.yaml | 10 +- .../SparkWalletExternalAccountInfo.yaml | 10 +- .../TronWalletExternalAccountInfo.yaml | 10 +- .../UpiAccountExternalAccountInfo.yaml | 16 +- .../UsAccountExternalAccountInfo.yaml | 15 +- .../schemas/quotes/AccountDestination.yaml | 16 + .../schemas/quotes/AccountQuoteSource.yaml | 20 + .../schemas/quotes/BaseDestination.yaml | 12 + .../schemas/quotes/BaseQuoteSource.yaml | 11 + .../schemas/quotes/DestinationType.yaml | 7 + .../ExternalAccountDetailsDestination.yaml | 18 + openapi/components/schemas/quotes/Quote.yaml | 42 +- .../schemas/quotes/QuoteDestinationOneOf.yaml | 13 + .../schemas/quotes/QuoteRequest.yaml | 52 +- .../schemas/quotes/QuoteSourceOneOf.yaml | 10 + .../schemas/quotes/QuoteSourceType.yaml | 6 + ...e.yaml => RealtimeFundingQuoteSource.yaml} | 29 +- .../schemas/quotes/UmaAddressDestination.yaml | 33 + .../AccountTransactionDestination.yaml | 16 + .../AccountTransactionSource.yaml | 16 + .../BaseTransactionDestination.yaml | 15 + .../transactions/BaseTransactionSource.yaml | 15 + .../transactions/IncomingTransaction.yaml | 31 +- .../transactions/OutgoingTransaction.yaml | 31 +- .../schemas/transactions/Transaction.yaml | 30 +- .../TransactionDestinationOneOf.yaml | 10 + .../TransactionDestinationType.yaml | 6 + .../transactions/TransactionSourceOneOf.yaml | 10 + .../transactions/TransactionSourceType.yaml | 7 + .../UmaAddressTransactionDestination.yaml | 16 + .../UmaAddressTransactionSource.yaml | 16 + .../webhooks/InvitationClaimedWebhook.yaml | 2 +- openapi/paths/customers/customers.yaml | 116 +- 100 files changed, 2269 insertions(+), 2211 deletions(-) create mode 100644 openapi/components/schemas/common/BasePaymentAccountInfo.yaml delete mode 100644 openapi/components/schemas/common/FboAccountInfo.yaml rename openapi/components/schemas/common/{BankAccountOrWalletType.yaml => PaymentAccountType.yaml} (73%) create mode 100644 openapi/components/schemas/customers/CustomerOneOf.yaml create mode 100644 openapi/components/schemas/external_accounts/BaseBeneficiary.yaml create mode 100644 openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/BeneficiaryOneOf.yaml create mode 100644 openapi/components/schemas/external_accounts/BeneficiaryType.yaml rename openapi/components/schemas/external_accounts/{ExternalAccountInfo.yaml => ExternalAccountInfoOneOf.yaml} (100%) create mode 100644 openapi/components/schemas/external_accounts/ExternalAccountType.yaml create mode 100644 openapi/components/schemas/quotes/AccountDestination.yaml create mode 100644 openapi/components/schemas/quotes/AccountQuoteSource.yaml create mode 100644 openapi/components/schemas/quotes/BaseDestination.yaml create mode 100644 openapi/components/schemas/quotes/BaseQuoteSource.yaml create mode 100644 openapi/components/schemas/quotes/DestinationType.yaml create mode 100644 openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml create mode 100644 openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml create mode 100644 openapi/components/schemas/quotes/QuoteSourceOneOf.yaml create mode 100644 openapi/components/schemas/quotes/QuoteSourceType.yaml rename openapi/components/schemas/quotes/{QuoteSource.yaml => RealtimeFundingQuoteSource.yaml} (63%) create mode 100644 openapi/components/schemas/quotes/UmaAddressDestination.yaml create mode 100644 openapi/components/schemas/transactions/AccountTransactionDestination.yaml create mode 100644 openapi/components/schemas/transactions/AccountTransactionSource.yaml create mode 100644 openapi/components/schemas/transactions/BaseTransactionDestination.yaml create mode 100644 openapi/components/schemas/transactions/BaseTransactionSource.yaml create mode 100644 openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml create mode 100644 openapi/components/schemas/transactions/TransactionDestinationType.yaml create mode 100644 openapi/components/schemas/transactions/TransactionSourceOneOf.yaml create mode 100644 openapi/components/schemas/transactions/TransactionSourceType.yaml create mode 100644 openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml create mode 100644 openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index 673d433..1ae4b5c 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -154,115 +154,14 @@ paths: content: application/json: schema: - oneOf: - - title: New Individual Customer - allOf: - - $ref: '#/components/schemas/IndividualCustomerUpdate' - - type: object - required: - - platformCustomerId - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your individual customer if KYC needs to be completed - example: https://example.com/kyc - - title: New Business Customer - allOf: - - $ref: '#/components/schemas/BusinessCustomerUpdate' - - type: object - required: - - platformCustomerId - - businessInfo - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your business customer if KYC needs to be completed - example: https://example.com/kyc - businessInfo: - type: object - required: - - legalName - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - examples: - individualCustomerWithUmaAddress: - summary: Create individual customer with UMA address, including deposit bank account information. - value: - umaAddress: $jane.doe@uma.domain.com - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: Jane Doe - birthDate: '1992-03-25' - address: - line1: 123 Pine Street - line2: Unit 501 - city: Seattle - state: WA - postalCode: '98101' - country: US - individualCustomerWithoutUmaAddress: - summary: Create individual customer without UMA address (will be generated) - value: - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-10' - address: - line1: 456 Oak Avenue - city: Portland - state: OR - postalCode: '97201' - country: US - businessCustomer: - summary: Create business customer example - value: - platformCustomerId: 6e4d2c0b8a9f3 - customerType: BUSINESS - businessInfo: - legalName: Acme Corporation - registrationNumber: BRN-456789123 - taxId: EIN-987123456 - address: - line1: 400 Commerce Way - city: Austin - state: TX - postalCode: '78701' - country: US + $ref: '#/components/schemas/CustomerOneOf' responses: '201': description: Customer created successfully content: application/json: schema: - oneOf: - - title: Individual Customer - $ref: '#/components/schemas/IndividualCustomer' - - title: Business Customer - $ref: '#/components/schemas/BusinessCustomer' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomer' - BUSINESS: '#/components/schemas/BusinessCustomer' + $ref: '#/components/schemas/CustomerOneOf' '400': description: Bad request content: @@ -386,16 +285,7 @@ paths: type: array description: List of customers matching the filter criteria items: - oneOf: - - title: Individual Customer - $ref: '#/components/schemas/IndividualCustomer' - - title: Business Customer - $ref: '#/components/schemas/BusinessCustomer' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomer' - BUSINESS: '#/components/schemas/BusinessCustomer' + $ref: '#/components/schemas/CustomerOneOf' hasMore: type: boolean description: Indicates if more results are available beyond this page @@ -4044,8 +3934,9 @@ components: - code properties: status: - const: 401 type: integer + enum: + - 401 description: HTTP status code code: type: string @@ -4071,8 +3962,9 @@ components: - code properties: status: - const: 500 type: integer + enum: + - 500 description: HTTP status code code: type: string @@ -4098,8 +3990,9 @@ components: - code properties: status: - const: 400 type: integer + enum: + - 400 description: HTTP status code code: type: string @@ -4175,8 +4068,9 @@ components: - code properties: status: - const: 501 type: integer + enum: + - 501 description: HTTP status code code: type: string @@ -4205,7 +4099,13 @@ components: allOf: - $ref: '#/components/schemas/Customer' - type: object + required: + - customerType properties: + customerType: + type: string + enum: + - INDIVIDUAL fullName: type: string description: Individual's full name @@ -4356,7 +4256,13 @@ components: allOf: - $ref: '#/components/schemas/Customer' - type: object + required: + - customerType properties: + customerType: + type: string + enum: + - BUSINESS address: $ref: '#/components/schemas/Address' businessInfo: @@ -4393,72 +4299,17 @@ components: - MANUALLY_REJECTED description: The current KYC status of a customer example: APPROVED - IndividualCustomerUpdate: - type: object - required: - - customerType - properties: - customerType: - type: string - enum: - - INDIVIDUAL - description: Customer type - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' - umaAddress: - type: string - description: | - Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. - If provided during customer update, the UMA address will be updated to the provided value. This is an optional - identifier to route payments to the customer. - example: $john.doe@uma.domain.com - BusinessCustomerUpdate: - type: object - required: - - customerType - properties: - customerType: - type: string - const: BUSINESS - description: Customer type - umaAddress: - type: string - description: Optional UMA address identifier. If not provided, will be generated by the system. - example: $acme@uma.domain.com - businessInfo: - type: object - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - address: - $ref: '#/components/schemas/Address' - beneficialOwners: - type: array - items: - $ref: '#/components/schemas/UltimateBeneficialOwner' + CustomerOneOf: + oneOf: + - title: Individual Customer + $ref: '#/components/schemas/IndividualCustomer' + - title: Business Customer + $ref: '#/components/schemas/BusinessCustomer' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomer' + BUSINESS: '#/components/schemas/BusinessCustomer' Error409: type: object required: @@ -4467,8 +4318,9 @@ components: - code properties: status: - const: 409 type: integer + enum: + - 409 description: HTTP status code code: type: string @@ -4494,8 +4346,9 @@ components: - code properties: status: - const: 404 type: integer + enum: + - 404 description: HTTP status code code: type: string @@ -4537,6 +4390,73 @@ components: details: type: object description: Additional error details + IndividualCustomerUpdate: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + description: Customer type + fullName: + type: string + description: Individual's full name + example: John Michael Doe + birthDate: + type: string + format: date + description: Date of birth in ISO 8601 format (YYYY-MM-DD) + example: '1990-01-15' + nationality: + type: string + description: Country code (ISO 3166-1 alpha-2) + example: US + address: + $ref: '#/components/schemas/Address' + umaAddress: + type: string + description: | + Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. + If provided during customer update, the UMA address will be updated to the provided value. This is an optional + identifier to route payments to the customer. + example: $john.doe@uma.domain.com + BusinessCustomerUpdate: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - BUSINESS + description: Customer type + umaAddress: + type: string + description: Optional UMA address identifier. If not provided, will be generated by the system. + example: $acme@uma.domain.com + businessInfo: + type: object + properties: + legalName: + type: string + description: Legal name of the business + example: Acme Corporation, Inc. + registrationNumber: + type: string + description: Business registration number + example: BRN-123456789 + taxId: + type: string + description: Tax identification number + example: EIN-987654321 + address: + $ref: '#/components/schemas/Address' + beneficialOwners: + type: array + items: + $ref: '#/components/schemas/UltimateBeneficialOwner' Currency: type: object properties: @@ -4570,45 +4490,52 @@ components: example: 12550 currency: $ref: '#/components/schemas/Currency' - ClabeAccountInfo: - type: object - required: - - accountType - - clabeNumber - properties: - accountType: - type: string - const: CLABE - example: CLABE - clabeNumber: - type: string - description: 18-digit CLABE number (Mexican banking standard) - example: '123456789012345678' - minLength: 18 - maxLength: 18 - pattern: ^[0-9]{18}$ PaymentClabeAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/ClabeAccountInfo' + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF + BasePaymentAccountInfo: + type: object required: - - reference + - accountType properties: - reference: - type: string - description: Unique reference code that must be included with the payment to properly credit it - example: UMA-Q12345-REF + accountType: + $ref: '#/components/schemas/PaymentAccountType' + discriminator: + propertyName: accountType + mapping: + CLABE: '#/components/schemas/PaymentClabeAccountInfo' + US_ACCOUNT: '#/components/schemas/PaymentUsAccountInfo' + PIX: '#/components/schemas/PaymentPixAccountInfo' + IBAN: '#/components/schemas/PaymentIbanAccountInfo' + UPI: '#/components/schemas/PaymentUpiAccountInfo' + NGN_ACCOUNT: '#/components/schemas/PaymentNgnAccountInfo' + SPARK_WALLET: '#/components/schemas/PaymentSparkWalletInfo' + LIGHTNING: '#/components/schemas/PaymentLightningInvoiceInfo' + SOLANA_WALLET: '#/components/schemas/PaymentSolanaWalletInfo' + TRON_WALLET: '#/components/schemas/PaymentTronWalletInfo' + POLYGON_WALLET: '#/components/schemas/PaymentPolygonWalletInfo' + BASE_WALLET: '#/components/schemas/PaymentBaseWalletInfo' UsAccountInfo: type: object required: - - accountType - accountNumber - routingNumber - accountCategory + - accountType properties: accountType: type: string - const: US_ACCOUNT - example: US_ACCOUNT + enum: + - US_ACCOUNT accountNumber: type: string description: US bank account number @@ -4633,26 +4560,28 @@ components: example: Chase Bank PaymentUsAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/UsAccountInfo' - required: - - reference - properties: - reference: - type: string - description: Unique reference code that must be included with the payment to properly credit it - example: UMA-Q12345-REF + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF PixAccountInfo: type: object required: - - accountType - pixKey - pixKeyType - taxId + - accountType properties: accountType: type: string - const: PIX - example: PIX + enum: + - PIX pixKey: type: string description: PIX key for Brazilian instant payments @@ -4673,18 +4602,19 @@ components: example: '1234567890' PaymentPixAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/PixAccountInfo' IbanAccountInfo: type: object required: - - accountType - iban - swiftBic + - accountType properties: accountType: type: string - const: IBAN - example: IBAN + enum: + - IBAN iban: type: string description: International Bank Account Number @@ -4700,164 +4630,246 @@ components: pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$ PaymentIbanAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/IbanAccountInfo' - required: - - reference - properties: - reference: - type: string - description: Unique reference code that must be included with the payment to properly credit it - example: UMA-Q12345-REF + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF UpiAccountInfo: type: object required: - - accountType - vpa + - accountType properties: accountType: type: string - const: UPI - example: UPI + enum: + - UPI vpa: type: string description: Virtual Payment Address for UPI payments example: somecustomers@okbank PaymentUpiAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/UpiAccountInfo' - SparkWalletInfo: + NgnAccountInfo: type: object required: + - accountNumber + - bankName - accountType - - address properties: accountType: type: string - const: SPARK_WALLET - example: SPARK_WALLET - address: - type: string - description: Spark wallet address - example: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - PaymentSparkWalletInfo: - allOf: - - $ref: '#/components/schemas/SparkWalletInfo' - required: - - assetType - properties: - assetType: - type: string - description: Type of asset enum: - - BTC - - USDB - invoice: + - NGN_ACCOUNT + accountNumber: type: string - description: Invoice for the payment - example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s - PaymentLightningInvoiceInfo: - type: object - required: - - accountType - - invoice + description: Nigerian bank account number + example: '0123456789' + minLength: 10 + maxLength: 10 + pattern: ^[0-9]{10}$ + bankName: + type: string + description: Name of the bank + example: First Bank of Nigeria + PaymentNgnAccountInfo: + allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' + - $ref: '#/components/schemas/NgnAccountInfo' + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF + SparkWalletInfo: + type: object + required: + - address + - accountType properties: accountType: - const: LIGHTNING - example: LIGHTNING - invoice: type: string - description: Invoice for the payment - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + enum: + - SPARK_WALLET + address: + type: string + description: Spark wallet address + example: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu + PaymentSparkWalletInfo: + allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' + - $ref: '#/components/schemas/SparkWalletInfo' + - type: object + required: + - assetType + properties: + assetType: + type: string + description: Type of asset + enum: + - BTC + - USDB + invoice: + type: string + description: Invoice for the payment + example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s + PaymentLightningInvoiceInfo: + allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' + - type: object + required: + - invoice + properties: + invoice: + type: string + description: Invoice for the payment + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs SolanaWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: SOLANA_WALLET - example: SOLANA_WALLET + enum: + - SOLANA_WALLET address: type: string description: Solana wallet address example: 4Nd1m6Qkq7RfKuE5vQ9qP9Tn6H94Ueqb4xXHzsAbd8Wg PaymentSolanaWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/SolanaWalletInfo' - properties: - assetType: - type: string - description: Type of asset - enum: - - USDC - - USDT + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC + - USDT TronWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: TRON_WALLET - example: TRON_WALLET + enum: + - TRON_WALLET address: type: string description: Tron wallet address example: TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL PaymentTronWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/TronWalletInfo' - properties: - assetType: - type: string - description: Type of asset - const: USDT + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDT PolygonWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: POLYGON_WALLET - example: POLYGON_WALLET + enum: + - POLYGON_WALLET address: type: string description: Polygon eth wallet address example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentPolygonWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/PolygonWalletInfo' - properties: - assetType: - type: string - description: Type of asset - const: USDC + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC BaseWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: BASE_WALLET - example: BASE_WALLET + enum: + - BASE_WALLET address: type: string description: Base eth wallet address example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentBaseWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/BaseWalletInfo' + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC + PaymentAccountType: + type: string + enum: + - CLABE + - US_ACCOUNT + - PIX + - IBAN + - UPI + - NGN_ACCOUNT + - SPARK_WALLET + - LIGHTNING + - SOLANA_WALLET + - TRON_WALLET + - POLYGON_WALLET + - BASE_WALLET + description: Type of payment account or wallet + example: US_ACCOUNT + ClabeAccountInfo: + type: object + required: + - clabeNumber + - accountType properties: - assetType: + accountType: type: string - description: Type of asset - const: USDC + enum: + - CLABE + clabeNumber: + type: string + description: 18-digit CLABE number (Mexican banking standard) + example: '123456789012345678' + minLength: 18 + maxLength: 18 + pattern: ^[0-9]{18}$ PaymentInstructions: type: object required: @@ -4951,202 +4963,174 @@ components: - UNDER_REVIEW - INACTIVE description: Status of an external account - IndividualBeneficiary: + UsAccountExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/UsAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + $ref: '#/components/schemas/BeneficiaryOneOf' + BaseExternalAccountInfo: type: object required: - - fullName - - birthDate - - nationality - - beneficiaryType + - accountType properties: - beneficiaryType: - type: string - const: INDIVIDUAL - example: INDIVIDUAL - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' - BusinessBeneficiary: + accountType: + $ref: '#/components/schemas/ExternalAccountType' + discriminator: + propertyName: accountType + mapping: + US_ACCOUNT: '#/components/schemas/UsAccountExternalAccountInfo' + CLABE: '#/components/schemas/ClabeAccountExternalAccountInfo' + PIX: '#/components/schemas/PixAccountExternalAccountInfo' + IBAN: '#/components/schemas/IbanAccountExternalAccountInfo' + UPI: '#/components/schemas/UpiAccountExternalAccountInfo' + NGN_ACCOUNT: '#/components/schemas/NgnAccountExternalAccountInfo' + CAD_ACCOUNT: '#/components/schemas/CadAccountExternalAccountInfo' + GBP_ACCOUNT: '#/components/schemas/GbpAccountExternalAccountInfo' + PHP_ACCOUNT: '#/components/schemas/PhpAccountExternalAccountInfo' + SGD_ACCOUNT: '#/components/schemas/SgdAccountExternalAccountInfo' + SPARK_WALLET: '#/components/schemas/SparkWalletExternalAccountInfo' + LIGHTNING: '#/components/schemas/LightningExternalAccountInfo' + SOLANA_WALLET: '#/components/schemas/SolanaWalletExternalAccountInfo' + TRON_WALLET: '#/components/schemas/TronWalletExternalAccountInfo' + POLYGON_WALLET: '#/components/schemas/PolygonWalletExternalAccountInfo' + BASE_WALLET: '#/components/schemas/BaseWalletExternalAccountInfo' + IndividualBeneficiary: + allOf: + - $ref: '#/components/schemas/BaseBeneficiary' + - type: object + required: + - fullName + - birthDate + - nationality + - beneficiaryType + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: Individual's full name + example: John Michael Doe + birthDate: + type: string + format: date + description: Date of birth in ISO 8601 format (YYYY-MM-DD) + example: '1990-01-15' + nationality: + type: string + description: Country code (ISO 3166-1 alpha-2) + example: US + BaseBeneficiary: type: object required: - - legalName - beneficiaryType properties: beneficiaryType: - type: string - const: BUSINESS - example: BUSINESS - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 + $ref: '#/components/schemas/BeneficiaryType' address: $ref: '#/components/schemas/Address' - UsAccountExternalAccountInfo: + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + BusinessBeneficiary: allOf: - - $ref: '#/components/schemas/UsAccountInfo' + - $ref: '#/components/schemas/BaseBeneficiary' - type: object required: - - accountType - - beneficiary + - legalName + - beneficiaryType properties: - accountType: + beneficiaryType: type: string - const: US_ACCOUNT - example: US_ACCOUNT - beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + enum: + - BUSINESS + legalName: + type: string + description: Legal name of the business + example: Acme Corporation, Inc. + registrationNumber: + type: string + description: Business registration number + example: BRN-123456789 + taxId: + type: string + description: Tax identification number + example: EIN-987654321 + BeneficiaryType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Whether the beneficiary is an individual or a business entity + example: INDIVIDUAL + BeneficiaryOneOf: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/IndividualBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' ClabeAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/ClabeAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: CLABE - example: CLABE beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' PixAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PixAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: PIX - example: PIX beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' IbanAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/IbanAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: IBAN - example: IBAN beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' UpiAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/UpiAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: UPI - example: UPI beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' - NgnAccountInfo: - type: object - required: - - accountType - - accountNumber - - bankName - properties: - accountType: - type: string - const: NGN_ACCOUNT - example: NGN_ACCOUNT - accountNumber: - type: string - description: Nigerian bank account number - example: '0123456789' - minLength: 10 - maxLength: 10 - pattern: ^[0-9]{10}$ - bankName: - type: string - description: Name of the bank - example: First Bank of Nigeria + $ref: '#/components/schemas/BeneficiaryOneOf' NgnAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/NgnAccountInfo' - type: object required: - - accountType - purposeOfPayment - beneficiary properties: - accountType: - type: string - const: NGN_ACCOUNT - example: NGN_ACCOUNT - beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' purposeOfPayment: type: string enum: @@ -5164,19 +5148,20 @@ components: - OTHER description: Purpose of payment example: GOODS_OR_SERVICES + beneficiary: + $ref: '#/components/schemas/BeneficiaryOneOf' CadAccountInfo: type: object required: - - accountType - bankCode - branchCode - accountNumber + - accountType properties: accountType: type: string enum: - CAD_ACCOUNT - example: CAD_ACCOUNT bankCode: type: string description: Canadian financial institution number (3 digits) @@ -5200,38 +5185,25 @@ components: pattern: ^[0-9]{7,12}$ CadAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/CadAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - CAD_ACCOUNT - example: CAD_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' GbpAccountInfo: type: object required: - - accountType - sortCode - accountNumber + - accountType properties: accountType: type: string enum: - GBP_ACCOUNT - example: GBP_ACCOUNT sortCode: type: string description: UK bank sort code (6 digits, may include hyphens) @@ -5246,38 +5218,25 @@ components: pattern: ^[0-9]{8}$ GbpAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/GbpAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - GBP_ACCOUNT - example: GBP_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' PhpAccountInfo: type: object required: - - accountType - bankName - accountNumber + - accountType properties: accountType: type: string enum: - PHP_ACCOUNT - example: PHP_ACCOUNT bankName: type: string description: Name of the beneficiary's bank @@ -5288,39 +5247,26 @@ components: example: '001234567890' PhpAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PhpAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - PHP_ACCOUNT - example: PHP_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' SgdAccountInfo: type: object required: - - accountType - bankName - swiftCode - accountNumber + - accountType properties: accountType: type: string enum: - SGD_ACCOUNT - example: SGD_ACCOUNT bankName: type: string description: Name of the beneficiary's bank @@ -5338,105 +5284,81 @@ components: example: '0123456789' SgdAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SgdAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - SGD_ACCOUNT - example: SGD_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' SparkWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SparkWalletInfo' + 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 - const: SPARK_WALLET - example: SPARK_WALLET - LightningExternalAccountInfo: - type: object - required: - - accountType - description: | - Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. - properties: - accountType: - type: string - const: LIGHTNING - example: 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 + 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 SolanaWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SolanaWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: SOLANA_WALLET - example: SOLANA_WALLET TronWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/TronWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: TRON_WALLET - example: TRON_WALLET PolygonWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PolygonWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: POLYGON_WALLET - example: POLYGON_WALLET BaseWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/BaseWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: BASE_WALLET - example: BASE_WALLET - ExternalAccountInfo: + ExternalAccountType: + type: string + enum: + - US_ACCOUNT + - CLABE + - PIX + - IBAN + - UPI + - NGN_ACCOUNT + - CAD_ACCOUNT + - GBP_ACCOUNT + - PHP_ACCOUNT + - SGD_ACCOUNT + - SPARK_WALLET + - LIGHTNING + - SOLANA_WALLET + - TRON_WALLET + - POLYGON_WALLET + - BASE_WALLET + description: Type of external account or wallet + example: US_ACCOUNT + ExternalAccountInfoOneOf: oneOf: - title: US Account $ref: '#/components/schemas/UsAccountExternalAccountInfo' @@ -5523,7 +5445,7 @@ components: description: Whether this account is the default UMA deposit account for the customer. If true, incoming UMA payments to this customer's UMA address will be automatically deposited into this account instead of the primary internal account. False if not provided. Note that at most, one external account can be set as the default UMA deposit account for a customer. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer. example: false accountInfo: - $ref: '#/components/schemas/ExternalAccountInfo' + $ref: '#/components/schemas/ExternalAccountInfoOneOf' ExternalAccountCreateRequest: allOf: - type: object @@ -5548,7 +5470,7 @@ components: description: Whether to set the external account as the default UMA deposit account. When set to true, incoming payments to this customer's UMA address will be automatically deposited into this external account. False if not provided. Note that only one external account can be set as the default UMA deposit account for a customer, so if there is already a default UMA deposit account, this will override the existing default UMA deposit account. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer. default: false accountInfo: - $ref: '#/components/schemas/ExternalAccountInfo' + $ref: '#/components/schemas/ExternalAccountInfoOneOf' PlaidLinkTokenRequest: type: object required: @@ -5621,35 +5543,7 @@ components: type: $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/TransactionDestinationOneOf' customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) @@ -5690,6 +5584,75 @@ components: mapping: INCOMING: '#/components/schemas/IncomingTransaction' OUTGOING: '#/components/schemas/OutgoingTransaction' + AccountTransactionSource: + allOf: + - $ref: '#/components/schemas/BaseTransactionSource' + - type: object + required: + - accountId + - sourceType + properties: + sourceType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + description: Source account details + BaseTransactionSource: + type: object + required: + - sourceType + properties: + sourceType: + $ref: '#/components/schemas/TransactionSourceType' + currency: + type: string + description: Currency code for the source + example: USD + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionSource' + UmaAddressTransactionSource: + allOf: + - $ref: '#/components/schemas/BaseTransactionSource' + - type: object + required: + - umaAddress + - sourceType + properties: + sourceType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + description: UMA address source details + TransactionSourceType: + type: string + enum: + - ACCOUNT + - UMA_ADDRESS + - REALTIME_FUNDING + description: Type of transaction source + example: ACCOUNT + TransactionSourceOneOf: + oneOf: + - title: Account Source + $ref: '#/components/schemas/AccountTransactionSource' + - title: UMA Address Source + $ref: '#/components/schemas/UmaAddressTransactionSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionSource' ReconciliationInstructions: type: object required: @@ -5752,36 +5715,7 @@ components: - receivedAmount properties: 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 - - 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/TransactionSourceOneOf' receivedAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount received in the recipient's currency @@ -5881,36 +5815,7 @@ components: - source properties: 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 - - 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/TransactionSourceOneOf' sentAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount sent in the sender's currency @@ -5971,6 +5876,74 @@ components: - REFUNDED - EXPIRED description: Status of a payment transaction + AccountTransactionDestination: + allOf: + - $ref: '#/components/schemas/BaseTransactionDestination' + - type: object + required: + - accountId + - destinationType + properties: + destinationType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + description: Destination account details + BaseTransactionDestination: + type: object + required: + - destinationType + properties: + destinationType: + $ref: '#/components/schemas/TransactionDestinationType' + currency: + type: string + description: Currency code for the destination + example: EUR + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' + UmaAddressTransactionDestination: + allOf: + - $ref: '#/components/schemas/BaseTransactionDestination' + - type: object + required: + - umaAddress + - destinationType + properties: + destinationType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + description: UMA address destination details + TransactionDestinationType: + type: string + enum: + - ACCOUNT + - UMA_ADDRESS + description: Type of transaction destination + example: ACCOUNT + TransactionDestinationOneOf: + oneOf: + - title: Account Destination + $ref: '#/components/schemas/AccountTransactionDestination' + - title: UMA Address Destination + $ref: '#/components/schemas/UmaAddressTransactionDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' CurrencyPreference: type: object required: @@ -6026,8 +5999,9 @@ components: - code properties: status: - const: 412 type: integer + enum: + - 412 description: HTTP status code code: type: string @@ -6035,7 +6009,8 @@ components: | Error Code | Description | |------------|-------------| | UNSUPPORTED_UMA_VERSION | Counterparty doesn't support the Grid UMA version | - const: UNSUPPORTED_UMA_VERSION + enum: + - UNSUPPORTED_UMA_VERSION message: type: string description: Error message @@ -6050,8 +6025,9 @@ components: - code properties: status: - const: 424 type: integer + enum: + - 424 description: HTTP status code code: type: string @@ -6073,28 +6049,51 @@ components: details: type: object description: Additional error details - QuoteSource: - oneOf: - - title: Account - type: object + AccountQuoteSource: + allOf: + - $ref: '#/components/schemas/BaseQuoteSource' + - type: object required: - accountId + - sourceType properties: + sourceType: + type: string + enum: + - ACCOUNT accountId: type: string description: Source account identifier example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: + customerId: 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: Required when funding from an FBO account to identify the customer on whose behalf the transaction is being initiated. Otherwise, will default to the customerId of the account owner. + example: Customer:019542f5-b3e7-1d02-0000-000000000001 description: Source account details - - title: Real-time funding - type: object + BaseQuoteSource: + type: object + required: + - sourceType + properties: + sourceType: + $ref: '#/components/schemas/QuoteSourceType' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountQuoteSource' + REALTIME_FUNDING: '#/components/schemas/RealtimeFundingQuoteSource' + RealtimeFundingQuoteSource: + allOf: + - $ref: '#/components/schemas/BaseQuoteSource' + - type: object required: - currency - - customerId + - sourceType properties: + sourceType: + type: string + enum: + - REALTIME_FUNDING 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. @@ -6104,6 +6103,120 @@ components: 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.). + QuoteSourceType: + type: string + enum: + - ACCOUNT + - REALTIME_FUNDING + description: Type of quote funding source + example: ACCOUNT + QuoteSourceOneOf: + oneOf: + - title: Account + $ref: '#/components/schemas/AccountQuoteSource' + - title: Real-time Funding + $ref: '#/components/schemas/RealtimeFundingQuoteSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountQuoteSource' + REALTIME_FUNDING: '#/components/schemas/RealtimeFundingQuoteSource' + AccountDestination: + allOf: + - $ref: '#/components/schemas/BaseDestination' + - type: object + required: + - accountId + - destinationType + properties: + destinationType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + description: Destination account details + BaseDestination: + type: object + required: + - destinationType + properties: + destinationType: + $ref: '#/components/schemas/DestinationType' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsDestination' + UmaAddressDestination: + allOf: + - $ref: '#/components/schemas/BaseDestination' + - type: object + required: + - umaAddress + - destinationType + properties: + destinationType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + 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 + 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 + ExternalAccountDetailsDestination: + allOf: + - $ref: '#/components/schemas/BaseDestination' + - type: object + required: + - externalAccountDetails + - destinationType + properties: + destinationType: + type: string + enum: + - EXTERNAL_ACCOUNT_DETAILS + 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. + DestinationType: + type: string + enum: + - ACCOUNT + - UMA_ADDRESS + - EXTERNAL_ACCOUNT_DETAILS + description: Type of payment destination + example: ACCOUNT + QuoteDestinationOneOf: + oneOf: + - title: Account + $ref: '#/components/schemas/AccountDestination' + - title: UMA Address + $ref: '#/components/schemas/UmaAddressDestination' + - title: External Account Details + $ref: '#/components/schemas/ExternalAccountDetailsDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsDestination' Quote: type: object required: @@ -6146,45 +6259,9 @@ components: description: When this quote expires (typically 1-5 minutes after creation) example: '2025-10-03T12:05:00Z' source: - $ref: '#/components/schemas/QuoteSource' + $ref: '#/components/schemas/QuoteSourceOneOf' destination: - 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/QuoteDestinationOneOf' sendingCurrency: $ref: '#/components/schemas/Currency' description: Currency for the sending amount @@ -6259,47 +6336,9 @@ components: NOTE: This is required for UMA destinations due to counterparty institution requirements. See `senderCustomerInfo` for more information. example: Lookup:019542f5-b3e7-1d02-0000-000000000009 source: - $ref: '#/components/schemas/QuoteSource' + $ref: '#/components/schemas/QuoteSourceOneOf' 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 - - 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 - - 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/QuoteDestinationOneOf' lockedCurrencySide: $ref: '#/components/schemas/QuoteLockSide' lockedCurrencyAmount: @@ -6475,8 +6514,9 @@ components: - code properties: status: - const: 403 type: integer + enum: + - 403 description: HTTP status code code: type: string @@ -6690,7 +6730,8 @@ components: $ref: '#/components/schemas/UmaInvitation' type: type: string - const: INVITATION_CLAIMED + enum: + - INVITATION_CLAIMED description: Type of webhook event example: INVITATION_CLAIMED KycStatusWebhook: diff --git a/openapi.yaml b/openapi.yaml index 673d433..1ae4b5c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -154,115 +154,14 @@ paths: content: application/json: schema: - oneOf: - - title: New Individual Customer - allOf: - - $ref: '#/components/schemas/IndividualCustomerUpdate' - - type: object - required: - - platformCustomerId - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your individual customer if KYC needs to be completed - example: https://example.com/kyc - - title: New Business Customer - allOf: - - $ref: '#/components/schemas/BusinessCustomerUpdate' - - type: object - required: - - platformCustomerId - - businessInfo - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your business customer if KYC needs to be completed - example: https://example.com/kyc - businessInfo: - type: object - required: - - legalName - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - examples: - individualCustomerWithUmaAddress: - summary: Create individual customer with UMA address, including deposit bank account information. - value: - umaAddress: $jane.doe@uma.domain.com - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: Jane Doe - birthDate: '1992-03-25' - address: - line1: 123 Pine Street - line2: Unit 501 - city: Seattle - state: WA - postalCode: '98101' - country: US - individualCustomerWithoutUmaAddress: - summary: Create individual customer without UMA address (will be generated) - value: - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-10' - address: - line1: 456 Oak Avenue - city: Portland - state: OR - postalCode: '97201' - country: US - businessCustomer: - summary: Create business customer example - value: - platformCustomerId: 6e4d2c0b8a9f3 - customerType: BUSINESS - businessInfo: - legalName: Acme Corporation - registrationNumber: BRN-456789123 - taxId: EIN-987123456 - address: - line1: 400 Commerce Way - city: Austin - state: TX - postalCode: '78701' - country: US + $ref: '#/components/schemas/CustomerOneOf' responses: '201': description: Customer created successfully content: application/json: schema: - oneOf: - - title: Individual Customer - $ref: '#/components/schemas/IndividualCustomer' - - title: Business Customer - $ref: '#/components/schemas/BusinessCustomer' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomer' - BUSINESS: '#/components/schemas/BusinessCustomer' + $ref: '#/components/schemas/CustomerOneOf' '400': description: Bad request content: @@ -386,16 +285,7 @@ paths: type: array description: List of customers matching the filter criteria items: - oneOf: - - title: Individual Customer - $ref: '#/components/schemas/IndividualCustomer' - - title: Business Customer - $ref: '#/components/schemas/BusinessCustomer' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomer' - BUSINESS: '#/components/schemas/BusinessCustomer' + $ref: '#/components/schemas/CustomerOneOf' hasMore: type: boolean description: Indicates if more results are available beyond this page @@ -4044,8 +3934,9 @@ components: - code properties: status: - const: 401 type: integer + enum: + - 401 description: HTTP status code code: type: string @@ -4071,8 +3962,9 @@ components: - code properties: status: - const: 500 type: integer + enum: + - 500 description: HTTP status code code: type: string @@ -4098,8 +3990,9 @@ components: - code properties: status: - const: 400 type: integer + enum: + - 400 description: HTTP status code code: type: string @@ -4175,8 +4068,9 @@ components: - code properties: status: - const: 501 type: integer + enum: + - 501 description: HTTP status code code: type: string @@ -4205,7 +4099,13 @@ components: allOf: - $ref: '#/components/schemas/Customer' - type: object + required: + - customerType properties: + customerType: + type: string + enum: + - INDIVIDUAL fullName: type: string description: Individual's full name @@ -4356,7 +4256,13 @@ components: allOf: - $ref: '#/components/schemas/Customer' - type: object + required: + - customerType properties: + customerType: + type: string + enum: + - BUSINESS address: $ref: '#/components/schemas/Address' businessInfo: @@ -4393,72 +4299,17 @@ components: - MANUALLY_REJECTED description: The current KYC status of a customer example: APPROVED - IndividualCustomerUpdate: - type: object - required: - - customerType - properties: - customerType: - type: string - enum: - - INDIVIDUAL - description: Customer type - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' - umaAddress: - type: string - description: | - Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. - If provided during customer update, the UMA address will be updated to the provided value. This is an optional - identifier to route payments to the customer. - example: $john.doe@uma.domain.com - BusinessCustomerUpdate: - type: object - required: - - customerType - properties: - customerType: - type: string - const: BUSINESS - description: Customer type - umaAddress: - type: string - description: Optional UMA address identifier. If not provided, will be generated by the system. - example: $acme@uma.domain.com - businessInfo: - type: object - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - address: - $ref: '#/components/schemas/Address' - beneficialOwners: - type: array - items: - $ref: '#/components/schemas/UltimateBeneficialOwner' + CustomerOneOf: + oneOf: + - title: Individual Customer + $ref: '#/components/schemas/IndividualCustomer' + - title: Business Customer + $ref: '#/components/schemas/BusinessCustomer' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomer' + BUSINESS: '#/components/schemas/BusinessCustomer' Error409: type: object required: @@ -4467,8 +4318,9 @@ components: - code properties: status: - const: 409 type: integer + enum: + - 409 description: HTTP status code code: type: string @@ -4494,8 +4346,9 @@ components: - code properties: status: - const: 404 type: integer + enum: + - 404 description: HTTP status code code: type: string @@ -4537,6 +4390,73 @@ components: details: type: object description: Additional error details + IndividualCustomerUpdate: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + description: Customer type + fullName: + type: string + description: Individual's full name + example: John Michael Doe + birthDate: + type: string + format: date + description: Date of birth in ISO 8601 format (YYYY-MM-DD) + example: '1990-01-15' + nationality: + type: string + description: Country code (ISO 3166-1 alpha-2) + example: US + address: + $ref: '#/components/schemas/Address' + umaAddress: + type: string + description: | + Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. + If provided during customer update, the UMA address will be updated to the provided value. This is an optional + identifier to route payments to the customer. + example: $john.doe@uma.domain.com + BusinessCustomerUpdate: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - BUSINESS + description: Customer type + umaAddress: + type: string + description: Optional UMA address identifier. If not provided, will be generated by the system. + example: $acme@uma.domain.com + businessInfo: + type: object + properties: + legalName: + type: string + description: Legal name of the business + example: Acme Corporation, Inc. + registrationNumber: + type: string + description: Business registration number + example: BRN-123456789 + taxId: + type: string + description: Tax identification number + example: EIN-987654321 + address: + $ref: '#/components/schemas/Address' + beneficialOwners: + type: array + items: + $ref: '#/components/schemas/UltimateBeneficialOwner' Currency: type: object properties: @@ -4570,45 +4490,52 @@ components: example: 12550 currency: $ref: '#/components/schemas/Currency' - ClabeAccountInfo: - type: object - required: - - accountType - - clabeNumber - properties: - accountType: - type: string - const: CLABE - example: CLABE - clabeNumber: - type: string - description: 18-digit CLABE number (Mexican banking standard) - example: '123456789012345678' - minLength: 18 - maxLength: 18 - pattern: ^[0-9]{18}$ PaymentClabeAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/ClabeAccountInfo' + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF + BasePaymentAccountInfo: + type: object required: - - reference + - accountType properties: - reference: - type: string - description: Unique reference code that must be included with the payment to properly credit it - example: UMA-Q12345-REF + accountType: + $ref: '#/components/schemas/PaymentAccountType' + discriminator: + propertyName: accountType + mapping: + CLABE: '#/components/schemas/PaymentClabeAccountInfo' + US_ACCOUNT: '#/components/schemas/PaymentUsAccountInfo' + PIX: '#/components/schemas/PaymentPixAccountInfo' + IBAN: '#/components/schemas/PaymentIbanAccountInfo' + UPI: '#/components/schemas/PaymentUpiAccountInfo' + NGN_ACCOUNT: '#/components/schemas/PaymentNgnAccountInfo' + SPARK_WALLET: '#/components/schemas/PaymentSparkWalletInfo' + LIGHTNING: '#/components/schemas/PaymentLightningInvoiceInfo' + SOLANA_WALLET: '#/components/schemas/PaymentSolanaWalletInfo' + TRON_WALLET: '#/components/schemas/PaymentTronWalletInfo' + POLYGON_WALLET: '#/components/schemas/PaymentPolygonWalletInfo' + BASE_WALLET: '#/components/schemas/PaymentBaseWalletInfo' UsAccountInfo: type: object required: - - accountType - accountNumber - routingNumber - accountCategory + - accountType properties: accountType: type: string - const: US_ACCOUNT - example: US_ACCOUNT + enum: + - US_ACCOUNT accountNumber: type: string description: US bank account number @@ -4633,26 +4560,28 @@ components: example: Chase Bank PaymentUsAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/UsAccountInfo' - required: - - reference - properties: - reference: - type: string - description: Unique reference code that must be included with the payment to properly credit it - example: UMA-Q12345-REF + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF PixAccountInfo: type: object required: - - accountType - pixKey - pixKeyType - taxId + - accountType properties: accountType: type: string - const: PIX - example: PIX + enum: + - PIX pixKey: type: string description: PIX key for Brazilian instant payments @@ -4673,18 +4602,19 @@ components: example: '1234567890' PaymentPixAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/PixAccountInfo' IbanAccountInfo: type: object required: - - accountType - iban - swiftBic + - accountType properties: accountType: type: string - const: IBAN - example: IBAN + enum: + - IBAN iban: type: string description: International Bank Account Number @@ -4700,164 +4630,246 @@ components: pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$ PaymentIbanAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/IbanAccountInfo' - required: - - reference - properties: - reference: - type: string - description: Unique reference code that must be included with the payment to properly credit it - example: UMA-Q12345-REF + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF UpiAccountInfo: type: object required: - - accountType - vpa + - accountType properties: accountType: type: string - const: UPI - example: UPI + enum: + - UPI vpa: type: string description: Virtual Payment Address for UPI payments example: somecustomers@okbank PaymentUpiAccountInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/UpiAccountInfo' - SparkWalletInfo: + NgnAccountInfo: type: object required: + - accountNumber + - bankName - accountType - - address properties: accountType: type: string - const: SPARK_WALLET - example: SPARK_WALLET - address: - type: string - description: Spark wallet address - example: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - PaymentSparkWalletInfo: - allOf: - - $ref: '#/components/schemas/SparkWalletInfo' - required: - - assetType - properties: - assetType: - type: string - description: Type of asset enum: - - BTC - - USDB - invoice: + - NGN_ACCOUNT + accountNumber: type: string - description: Invoice for the payment - example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s - PaymentLightningInvoiceInfo: - type: object - required: - - accountType - - invoice + description: Nigerian bank account number + example: '0123456789' + minLength: 10 + maxLength: 10 + pattern: ^[0-9]{10}$ + bankName: + type: string + description: Name of the bank + example: First Bank of Nigeria + PaymentNgnAccountInfo: + allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' + - $ref: '#/components/schemas/NgnAccountInfo' + - type: object + required: + - reference + properties: + reference: + type: string + description: Unique reference code that must be included with the payment to properly credit it + example: UMA-Q12345-REF + SparkWalletInfo: + type: object + required: + - address + - accountType properties: accountType: - const: LIGHTNING - example: LIGHTNING - invoice: type: string - description: Invoice for the payment - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs + enum: + - SPARK_WALLET + address: + type: string + description: Spark wallet address + example: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu + PaymentSparkWalletInfo: + allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' + - $ref: '#/components/schemas/SparkWalletInfo' + - type: object + required: + - assetType + properties: + assetType: + type: string + description: Type of asset + enum: + - BTC + - USDB + invoice: + type: string + description: Invoice for the payment + example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s + PaymentLightningInvoiceInfo: + allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' + - type: object + required: + - invoice + properties: + invoice: + type: string + description: Invoice for the payment + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs SolanaWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: SOLANA_WALLET - example: SOLANA_WALLET + enum: + - SOLANA_WALLET address: type: string description: Solana wallet address example: 4Nd1m6Qkq7RfKuE5vQ9qP9Tn6H94Ueqb4xXHzsAbd8Wg PaymentSolanaWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/SolanaWalletInfo' - properties: - assetType: - type: string - description: Type of asset - enum: - - USDC - - USDT + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC + - USDT TronWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: TRON_WALLET - example: TRON_WALLET + enum: + - TRON_WALLET address: type: string description: Tron wallet address example: TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL PaymentTronWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/TronWalletInfo' - properties: - assetType: - type: string - description: Type of asset - const: USDT + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDT PolygonWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: POLYGON_WALLET - example: POLYGON_WALLET + enum: + - POLYGON_WALLET address: type: string description: Polygon eth wallet address example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentPolygonWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/PolygonWalletInfo' - properties: - assetType: - type: string - description: Type of asset - const: USDC + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC BaseWalletInfo: type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: BASE_WALLET - example: BASE_WALLET + enum: + - BASE_WALLET address: type: string description: Base eth wallet address example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentBaseWalletInfo: allOf: + - $ref: '#/components/schemas/BasePaymentAccountInfo' - $ref: '#/components/schemas/BaseWalletInfo' + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC + PaymentAccountType: + type: string + enum: + - CLABE + - US_ACCOUNT + - PIX + - IBAN + - UPI + - NGN_ACCOUNT + - SPARK_WALLET + - LIGHTNING + - SOLANA_WALLET + - TRON_WALLET + - POLYGON_WALLET + - BASE_WALLET + description: Type of payment account or wallet + example: US_ACCOUNT + ClabeAccountInfo: + type: object + required: + - clabeNumber + - accountType properties: - assetType: + accountType: type: string - description: Type of asset - const: USDC + enum: + - CLABE + clabeNumber: + type: string + description: 18-digit CLABE number (Mexican banking standard) + example: '123456789012345678' + minLength: 18 + maxLength: 18 + pattern: ^[0-9]{18}$ PaymentInstructions: type: object required: @@ -4951,202 +4963,174 @@ components: - UNDER_REVIEW - INACTIVE description: Status of an external account - IndividualBeneficiary: + UsAccountExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/UsAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + $ref: '#/components/schemas/BeneficiaryOneOf' + BaseExternalAccountInfo: type: object required: - - fullName - - birthDate - - nationality - - beneficiaryType + - accountType properties: - beneficiaryType: - type: string - const: INDIVIDUAL - example: INDIVIDUAL - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' - BusinessBeneficiary: + accountType: + $ref: '#/components/schemas/ExternalAccountType' + discriminator: + propertyName: accountType + mapping: + US_ACCOUNT: '#/components/schemas/UsAccountExternalAccountInfo' + CLABE: '#/components/schemas/ClabeAccountExternalAccountInfo' + PIX: '#/components/schemas/PixAccountExternalAccountInfo' + IBAN: '#/components/schemas/IbanAccountExternalAccountInfo' + UPI: '#/components/schemas/UpiAccountExternalAccountInfo' + NGN_ACCOUNT: '#/components/schemas/NgnAccountExternalAccountInfo' + CAD_ACCOUNT: '#/components/schemas/CadAccountExternalAccountInfo' + GBP_ACCOUNT: '#/components/schemas/GbpAccountExternalAccountInfo' + PHP_ACCOUNT: '#/components/schemas/PhpAccountExternalAccountInfo' + SGD_ACCOUNT: '#/components/schemas/SgdAccountExternalAccountInfo' + SPARK_WALLET: '#/components/schemas/SparkWalletExternalAccountInfo' + LIGHTNING: '#/components/schemas/LightningExternalAccountInfo' + SOLANA_WALLET: '#/components/schemas/SolanaWalletExternalAccountInfo' + TRON_WALLET: '#/components/schemas/TronWalletExternalAccountInfo' + POLYGON_WALLET: '#/components/schemas/PolygonWalletExternalAccountInfo' + BASE_WALLET: '#/components/schemas/BaseWalletExternalAccountInfo' + IndividualBeneficiary: + allOf: + - $ref: '#/components/schemas/BaseBeneficiary' + - type: object + required: + - fullName + - birthDate + - nationality + - beneficiaryType + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: Individual's full name + example: John Michael Doe + birthDate: + type: string + format: date + description: Date of birth in ISO 8601 format (YYYY-MM-DD) + example: '1990-01-15' + nationality: + type: string + description: Country code (ISO 3166-1 alpha-2) + example: US + BaseBeneficiary: type: object required: - - legalName - beneficiaryType properties: beneficiaryType: - type: string - const: BUSINESS - example: BUSINESS - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 + $ref: '#/components/schemas/BeneficiaryType' address: $ref: '#/components/schemas/Address' - UsAccountExternalAccountInfo: + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + BusinessBeneficiary: allOf: - - $ref: '#/components/schemas/UsAccountInfo' + - $ref: '#/components/schemas/BaseBeneficiary' - type: object required: - - accountType - - beneficiary + - legalName + - beneficiaryType properties: - accountType: + beneficiaryType: type: string - const: US_ACCOUNT - example: US_ACCOUNT - beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + enum: + - BUSINESS + legalName: + type: string + description: Legal name of the business + example: Acme Corporation, Inc. + registrationNumber: + type: string + description: Business registration number + example: BRN-123456789 + taxId: + type: string + description: Tax identification number + example: EIN-987654321 + BeneficiaryType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Whether the beneficiary is an individual or a business entity + example: INDIVIDUAL + BeneficiaryOneOf: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/IndividualBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' ClabeAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/ClabeAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: CLABE - example: CLABE beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' PixAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PixAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: PIX - example: PIX beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' IbanAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/IbanAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: IBAN - example: IBAN beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' UpiAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/UpiAccountInfo' - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: UPI - example: UPI beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' - NgnAccountInfo: - type: object - required: - - accountType - - accountNumber - - bankName - properties: - accountType: - type: string - const: NGN_ACCOUNT - example: NGN_ACCOUNT - accountNumber: - type: string - description: Nigerian bank account number - example: '0123456789' - minLength: 10 - maxLength: 10 - pattern: ^[0-9]{10}$ - bankName: - type: string - description: Name of the bank - example: First Bank of Nigeria + $ref: '#/components/schemas/BeneficiaryOneOf' NgnAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/NgnAccountInfo' - type: object required: - - accountType - purposeOfPayment - beneficiary properties: - accountType: - type: string - const: NGN_ACCOUNT - example: NGN_ACCOUNT - beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' purposeOfPayment: type: string enum: @@ -5164,19 +5148,20 @@ components: - OTHER description: Purpose of payment example: GOODS_OR_SERVICES + beneficiary: + $ref: '#/components/schemas/BeneficiaryOneOf' CadAccountInfo: type: object required: - - accountType - bankCode - branchCode - accountNumber + - accountType properties: accountType: type: string enum: - CAD_ACCOUNT - example: CAD_ACCOUNT bankCode: type: string description: Canadian financial institution number (3 digits) @@ -5200,38 +5185,25 @@ components: pattern: ^[0-9]{7,12}$ CadAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/CadAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - CAD_ACCOUNT - example: CAD_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' GbpAccountInfo: type: object required: - - accountType - sortCode - accountNumber + - accountType properties: accountType: type: string enum: - GBP_ACCOUNT - example: GBP_ACCOUNT sortCode: type: string description: UK bank sort code (6 digits, may include hyphens) @@ -5246,38 +5218,25 @@ components: pattern: ^[0-9]{8}$ GbpAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/GbpAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - GBP_ACCOUNT - example: GBP_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' PhpAccountInfo: type: object required: - - accountType - bankName - accountNumber + - accountType properties: accountType: type: string enum: - PHP_ACCOUNT - example: PHP_ACCOUNT bankName: type: string description: Name of the beneficiary's bank @@ -5288,39 +5247,26 @@ components: example: '001234567890' PhpAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PhpAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - PHP_ACCOUNT - example: PHP_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' SgdAccountInfo: type: object required: - - accountType - bankName - swiftCode - accountNumber + - accountType properties: accountType: type: string enum: - SGD_ACCOUNT - example: SGD_ACCOUNT bankName: type: string description: Name of the beneficiary's bank @@ -5338,105 +5284,81 @@ components: example: '0123456789' SgdAccountExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SgdAccountInfo' - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: - - SGD_ACCOUNT - example: SGD_ACCOUNT beneficiary: - oneOf: - - $ref: '#/components/schemas/IndividualBeneficiary' - - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' + $ref: '#/components/schemas/BeneficiaryOneOf' SparkWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SparkWalletInfo' + 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 - const: SPARK_WALLET - example: SPARK_WALLET - LightningExternalAccountInfo: - type: object - required: - - accountType - description: | - Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. - properties: - accountType: - type: string - const: LIGHTNING - example: 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 + 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 SolanaWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SolanaWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: SOLANA_WALLET - example: SOLANA_WALLET TronWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/TronWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: TRON_WALLET - example: TRON_WALLET PolygonWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PolygonWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: POLYGON_WALLET - example: POLYGON_WALLET BaseWalletExternalAccountInfo: allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/BaseWalletInfo' - - type: object - required: - - accountType - properties: - accountType: - type: string - const: BASE_WALLET - example: BASE_WALLET - ExternalAccountInfo: + ExternalAccountType: + type: string + enum: + - US_ACCOUNT + - CLABE + - PIX + - IBAN + - UPI + - NGN_ACCOUNT + - CAD_ACCOUNT + - GBP_ACCOUNT + - PHP_ACCOUNT + - SGD_ACCOUNT + - SPARK_WALLET + - LIGHTNING + - SOLANA_WALLET + - TRON_WALLET + - POLYGON_WALLET + - BASE_WALLET + description: Type of external account or wallet + example: US_ACCOUNT + ExternalAccountInfoOneOf: oneOf: - title: US Account $ref: '#/components/schemas/UsAccountExternalAccountInfo' @@ -5523,7 +5445,7 @@ components: description: Whether this account is the default UMA deposit account for the customer. If true, incoming UMA payments to this customer's UMA address will be automatically deposited into this account instead of the primary internal account. False if not provided. Note that at most, one external account can be set as the default UMA deposit account for a customer. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer. example: false accountInfo: - $ref: '#/components/schemas/ExternalAccountInfo' + $ref: '#/components/schemas/ExternalAccountInfoOneOf' ExternalAccountCreateRequest: allOf: - type: object @@ -5548,7 +5470,7 @@ components: description: Whether to set the external account as the default UMA deposit account. When set to true, incoming payments to this customer's UMA address will be automatically deposited into this external account. False if not provided. Note that only one external account can be set as the default UMA deposit account for a customer, so if there is already a default UMA deposit account, this will override the existing default UMA deposit account. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer. default: false accountInfo: - $ref: '#/components/schemas/ExternalAccountInfo' + $ref: '#/components/schemas/ExternalAccountInfoOneOf' PlaidLinkTokenRequest: type: object required: @@ -5621,35 +5543,7 @@ components: type: $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/TransactionDestinationOneOf' customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) @@ -5690,6 +5584,75 @@ components: mapping: INCOMING: '#/components/schemas/IncomingTransaction' OUTGOING: '#/components/schemas/OutgoingTransaction' + AccountTransactionSource: + allOf: + - $ref: '#/components/schemas/BaseTransactionSource' + - type: object + required: + - accountId + - sourceType + properties: + sourceType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + description: Source account details + BaseTransactionSource: + type: object + required: + - sourceType + properties: + sourceType: + $ref: '#/components/schemas/TransactionSourceType' + currency: + type: string + description: Currency code for the source + example: USD + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionSource' + UmaAddressTransactionSource: + allOf: + - $ref: '#/components/schemas/BaseTransactionSource' + - type: object + required: + - umaAddress + - sourceType + properties: + sourceType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + description: UMA address source details + TransactionSourceType: + type: string + enum: + - ACCOUNT + - UMA_ADDRESS + - REALTIME_FUNDING + description: Type of transaction source + example: ACCOUNT + TransactionSourceOneOf: + oneOf: + - title: Account Source + $ref: '#/components/schemas/AccountTransactionSource' + - title: UMA Address Source + $ref: '#/components/schemas/UmaAddressTransactionSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionSource' ReconciliationInstructions: type: object required: @@ -5752,36 +5715,7 @@ components: - receivedAmount properties: 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 - - 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/TransactionSourceOneOf' receivedAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount received in the recipient's currency @@ -5881,36 +5815,7 @@ components: - source properties: 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 - - 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/TransactionSourceOneOf' sentAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount sent in the sender's currency @@ -5971,6 +5876,74 @@ components: - REFUNDED - EXPIRED description: Status of a payment transaction + AccountTransactionDestination: + allOf: + - $ref: '#/components/schemas/BaseTransactionDestination' + - type: object + required: + - accountId + - destinationType + properties: + destinationType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + description: Destination account details + BaseTransactionDestination: + type: object + required: + - destinationType + properties: + destinationType: + $ref: '#/components/schemas/TransactionDestinationType' + currency: + type: string + description: Currency code for the destination + example: EUR + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' + UmaAddressTransactionDestination: + allOf: + - $ref: '#/components/schemas/BaseTransactionDestination' + - type: object + required: + - umaAddress + - destinationType + properties: + destinationType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + description: UMA address destination details + TransactionDestinationType: + type: string + enum: + - ACCOUNT + - UMA_ADDRESS + description: Type of transaction destination + example: ACCOUNT + TransactionDestinationOneOf: + oneOf: + - title: Account Destination + $ref: '#/components/schemas/AccountTransactionDestination' + - title: UMA Address Destination + $ref: '#/components/schemas/UmaAddressTransactionDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountTransactionDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' CurrencyPreference: type: object required: @@ -6026,8 +5999,9 @@ components: - code properties: status: - const: 412 type: integer + enum: + - 412 description: HTTP status code code: type: string @@ -6035,7 +6009,8 @@ components: | Error Code | Description | |------------|-------------| | UNSUPPORTED_UMA_VERSION | Counterparty doesn't support the Grid UMA version | - const: UNSUPPORTED_UMA_VERSION + enum: + - UNSUPPORTED_UMA_VERSION message: type: string description: Error message @@ -6050,8 +6025,9 @@ components: - code properties: status: - const: 424 type: integer + enum: + - 424 description: HTTP status code code: type: string @@ -6073,28 +6049,51 @@ components: details: type: object description: Additional error details - QuoteSource: - oneOf: - - title: Account - type: object + AccountQuoteSource: + allOf: + - $ref: '#/components/schemas/BaseQuoteSource' + - type: object required: - accountId + - sourceType properties: + sourceType: + type: string + enum: + - ACCOUNT accountId: type: string description: Source account identifier example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: + customerId: 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: Required when funding from an FBO account to identify the customer on whose behalf the transaction is being initiated. Otherwise, will default to the customerId of the account owner. + example: Customer:019542f5-b3e7-1d02-0000-000000000001 description: Source account details - - title: Real-time funding - type: object + BaseQuoteSource: + type: object + required: + - sourceType + properties: + sourceType: + $ref: '#/components/schemas/QuoteSourceType' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountQuoteSource' + REALTIME_FUNDING: '#/components/schemas/RealtimeFundingQuoteSource' + RealtimeFundingQuoteSource: + allOf: + - $ref: '#/components/schemas/BaseQuoteSource' + - type: object required: - currency - - customerId + - sourceType properties: + sourceType: + type: string + enum: + - REALTIME_FUNDING 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. @@ -6104,6 +6103,120 @@ components: 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.). + QuoteSourceType: + type: string + enum: + - ACCOUNT + - REALTIME_FUNDING + description: Type of quote funding source + example: ACCOUNT + QuoteSourceOneOf: + oneOf: + - title: Account + $ref: '#/components/schemas/AccountQuoteSource' + - title: Real-time Funding + $ref: '#/components/schemas/RealtimeFundingQuoteSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountQuoteSource' + REALTIME_FUNDING: '#/components/schemas/RealtimeFundingQuoteSource' + AccountDestination: + allOf: + - $ref: '#/components/schemas/BaseDestination' + - type: object + required: + - accountId + - destinationType + properties: + destinationType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + description: Destination account details + BaseDestination: + type: object + required: + - destinationType + properties: + destinationType: + $ref: '#/components/schemas/DestinationType' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsDestination' + UmaAddressDestination: + allOf: + - $ref: '#/components/schemas/BaseDestination' + - type: object + required: + - umaAddress + - destinationType + properties: + destinationType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + 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 + 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 + ExternalAccountDetailsDestination: + allOf: + - $ref: '#/components/schemas/BaseDestination' + - type: object + required: + - externalAccountDetails + - destinationType + properties: + destinationType: + type: string + enum: + - EXTERNAL_ACCOUNT_DETAILS + 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. + DestinationType: + type: string + enum: + - ACCOUNT + - UMA_ADDRESS + - EXTERNAL_ACCOUNT_DETAILS + description: Type of payment destination + example: ACCOUNT + QuoteDestinationOneOf: + oneOf: + - title: Account + $ref: '#/components/schemas/AccountDestination' + - title: UMA Address + $ref: '#/components/schemas/UmaAddressDestination' + - title: External Account Details + $ref: '#/components/schemas/ExternalAccountDetailsDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsDestination' Quote: type: object required: @@ -6146,45 +6259,9 @@ components: description: When this quote expires (typically 1-5 minutes after creation) example: '2025-10-03T12:05:00Z' source: - $ref: '#/components/schemas/QuoteSource' + $ref: '#/components/schemas/QuoteSourceOneOf' destination: - 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/QuoteDestinationOneOf' sendingCurrency: $ref: '#/components/schemas/Currency' description: Currency for the sending amount @@ -6259,47 +6336,9 @@ components: NOTE: This is required for UMA destinations due to counterparty institution requirements. See `senderCustomerInfo` for more information. example: Lookup:019542f5-b3e7-1d02-0000-000000000009 source: - $ref: '#/components/schemas/QuoteSource' + $ref: '#/components/schemas/QuoteSourceOneOf' 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 - - 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 - - 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/QuoteDestinationOneOf' lockedCurrencySide: $ref: '#/components/schemas/QuoteLockSide' lockedCurrencyAmount: @@ -6475,8 +6514,9 @@ components: - code properties: status: - const: 403 type: integer + enum: + - 403 description: HTTP status code code: type: string @@ -6690,7 +6730,8 @@ components: $ref: '#/components/schemas/UmaInvitation' type: type: string - const: INVITATION_CLAIMED + enum: + - INVITATION_CLAIMED description: Type of webhook event example: INVITATION_CLAIMED KycStatusWebhook: diff --git a/openapi/components/schemas/common/BasePaymentAccountInfo.yaml b/openapi/components/schemas/common/BasePaymentAccountInfo.yaml new file mode 100644 index 0000000..0549480 --- /dev/null +++ b/openapi/components/schemas/common/BasePaymentAccountInfo.yaml @@ -0,0 +1,21 @@ +type: object +required: + - accountType +properties: + accountType: + $ref: ./PaymentAccountType.yaml +discriminator: + propertyName: accountType + mapping: + CLABE: ./PaymentClabeAccountInfo.yaml + US_ACCOUNT: ./PaymentUsAccountInfo.yaml + PIX: ./PaymentPixAccountInfo.yaml + IBAN: ./PaymentIbanAccountInfo.yaml + UPI: ./PaymentUpiAccountInfo.yaml + NGN_ACCOUNT: ./PaymentNgnAccountInfo.yaml + SPARK_WALLET: ./PaymentSparkWalletInfo.yaml + LIGHTNING: ./PaymentLightningInvoiceInfo.yaml + SOLANA_WALLET: ./PaymentSolanaWalletInfo.yaml + TRON_WALLET: ./PaymentTronWalletInfo.yaml + POLYGON_WALLET: ./PaymentPolygonWalletInfo.yaml + BASE_WALLET: ./PaymentBaseWalletInfo.yaml diff --git a/openapi/components/schemas/common/BaseWalletInfo.yaml b/openapi/components/schemas/common/BaseWalletInfo.yaml index fca685c..6a3ef9a 100644 --- a/openapi/components/schemas/common/BaseWalletInfo.yaml +++ b/openapi/components/schemas/common/BaseWalletInfo.yaml @@ -1,12 +1,12 @@ type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: BASE_WALLET - example: BASE_WALLET + enum: + - BASE_WALLET address: type: string description: Base eth wallet address diff --git a/openapi/components/schemas/common/CadAccountInfo.yaml b/openapi/components/schemas/common/CadAccountInfo.yaml index cd98026..5504fe9 100644 --- a/openapi/components/schemas/common/CadAccountInfo.yaml +++ b/openapi/components/schemas/common/CadAccountInfo.yaml @@ -1,14 +1,14 @@ type: object required: - - accountType - bankCode - branchCode - accountNumber + - accountType properties: accountType: type: string - enum: [CAD_ACCOUNT] - example: CAD_ACCOUNT + enum: + - CAD_ACCOUNT bankCode: type: string description: Canadian financial institution number (3 digits) diff --git a/openapi/components/schemas/common/ClabeAccountInfo.yaml b/openapi/components/schemas/common/ClabeAccountInfo.yaml index 4fbde04..6f70a2f 100644 --- a/openapi/components/schemas/common/ClabeAccountInfo.yaml +++ b/openapi/components/schemas/common/ClabeAccountInfo.yaml @@ -1,12 +1,12 @@ type: object required: - - accountType - clabeNumber + - accountType properties: accountType: type: string - const: CLABE - example: CLABE + enum: + - CLABE clabeNumber: type: string description: 18-digit CLABE number (Mexican banking standard) diff --git a/openapi/components/schemas/common/FboAccountInfo.yaml b/openapi/components/schemas/common/FboAccountInfo.yaml deleted file mode 100644 index 3218acd..0000000 --- a/openapi/components/schemas/common/FboAccountInfo.yaml +++ /dev/null @@ -1,14 +0,0 @@ -type: object -required: - - accountType - - currencyCode -properties: - accountType: - type: string - const: FBO - example: FBO - currencyCode: - type: string - description: Three-letter currency code (ISO 4217) - example: USD - diff --git a/openapi/components/schemas/common/GbpAccountInfo.yaml b/openapi/components/schemas/common/GbpAccountInfo.yaml index f4a6d1f..68a9a16 100644 --- a/openapi/components/schemas/common/GbpAccountInfo.yaml +++ b/openapi/components/schemas/common/GbpAccountInfo.yaml @@ -1,13 +1,13 @@ type: object required: - - accountType - sortCode - accountNumber + - accountType properties: accountType: type: string - enum: [GBP_ACCOUNT] - example: GBP_ACCOUNT + enum: + - GBP_ACCOUNT sortCode: type: string description: UK bank sort code (6 digits, may include hyphens) diff --git a/openapi/components/schemas/common/IbanAccountInfo.yaml b/openapi/components/schemas/common/IbanAccountInfo.yaml index 453de4b..51a2c9d 100644 --- a/openapi/components/schemas/common/IbanAccountInfo.yaml +++ b/openapi/components/schemas/common/IbanAccountInfo.yaml @@ -1,13 +1,13 @@ type: object required: - - accountType - iban - swiftBic + - accountType properties: accountType: type: string - const: IBAN - example: IBAN + enum: + - IBAN iban: type: string description: International Bank Account Number diff --git a/openapi/components/schemas/common/NgnAccountInfo.yaml b/openapi/components/schemas/common/NgnAccountInfo.yaml index 9775a38..cd9eb30 100644 --- a/openapi/components/schemas/common/NgnAccountInfo.yaml +++ b/openapi/components/schemas/common/NgnAccountInfo.yaml @@ -1,13 +1,13 @@ type: object required: - - accountType - accountNumber - bankName + - accountType properties: accountType: type: string - const: NGN_ACCOUNT - example: NGN_ACCOUNT + enum: + - NGN_ACCOUNT accountNumber: type: string description: Nigerian bank account number diff --git a/openapi/components/schemas/common/BankAccountOrWalletType.yaml b/openapi/components/schemas/common/PaymentAccountType.yaml similarity index 73% rename from openapi/components/schemas/common/BankAccountOrWalletType.yaml rename to openapi/components/schemas/common/PaymentAccountType.yaml index c6ee5d1..1b5f6af 100644 --- a/openapi/components/schemas/common/BankAccountOrWalletType.yaml +++ b/openapi/components/schemas/common/PaymentAccountType.yaml @@ -4,7 +4,6 @@ enum: - US_ACCOUNT - PIX - IBAN - - FBO - UPI - NGN_ACCOUNT - SPARK_WALLET @@ -13,4 +12,5 @@ enum: - TRON_WALLET - POLYGON_WALLET - BASE_WALLET -description: Type of account or wallet information +description: Type of payment account or wallet +example: US_ACCOUNT diff --git a/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml b/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml index 422cddb..e2d3c2f 100644 --- a/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml @@ -1,7 +1,10 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./BaseWalletInfo.yaml -properties: - assetType: - type: string - description: Type of asset - const: USDC \ No newline at end of file + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC diff --git a/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml b/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml index 0b19558..29f6d4a 100644 --- a/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml @@ -1,11 +1,13 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./ClabeAccountInfo.yaml -required: - - reference -properties: - reference: - type: string - description: >- - Unique reference code that must be included with the payment to properly - credit it - example: UMA-Q12345-REF \ No newline at end of file + - type: object + required: + - reference + properties: + reference: + type: string + description: >- + Unique reference code that must be included with the payment to properly + credit it + example: UMA-Q12345-REF diff --git a/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml b/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml index 76315f5..d5c67fb 100644 --- a/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml @@ -1,11 +1,13 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./IbanAccountInfo.yaml -required: - - reference -properties: - reference: - type: string - description: >- - Unique reference code that must be included with the payment to properly - credit it - example: UMA-Q12345-REF \ No newline at end of file + - type: object + required: + - reference + properties: + reference: + type: string + description: >- + Unique reference code that must be included with the payment to properly + credit it + example: UMA-Q12345-REF diff --git a/openapi/components/schemas/common/PaymentInstructions.yaml b/openapi/components/schemas/common/PaymentInstructions.yaml index 7c0ae2b..313d0cb 100644 --- a/openapi/components/schemas/common/PaymentInstructions.yaml +++ b/openapi/components/schemas/common/PaymentInstructions.yaml @@ -49,4 +49,4 @@ properties: SOLANA_WALLET: ../common/PaymentSolanaWalletInfo.yaml TRON_WALLET: ../common/PaymentTronWalletInfo.yaml POLYGON_WALLET: ../common/PaymentPolygonWalletInfo.yaml - BASE_WALLET: ../common/PaymentBaseWalletInfo.yaml \ No newline at end of file + BASE_WALLET: ../common/PaymentBaseWalletInfo.yaml diff --git a/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml b/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml index 05166c8..2750adf 100644 --- a/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml +++ b/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml @@ -1,13 +1,10 @@ -type: object -required: - - accountType - - invoice -properties: - accountType: - type: string - const: LIGHTNING - example: LIGHTNING - invoice: - type: string - description: Invoice for the payment - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs \ No newline at end of file +allOf: + - $ref: ./BasePaymentAccountInfo.yaml + - type: object + required: + - invoice + properties: + invoice: + type: string + description: Invoice for the payment + example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs diff --git a/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml b/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml index 587f52a..b32b47b 100644 --- a/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml @@ -1,11 +1,13 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./NgnAccountInfo.yaml -required: - - reference -properties: - reference: - type: string - description: >- - Unique reference code that must be included with the payment to properly - credit it - example: UMA-Q12345-REF + - type: object + required: + - reference + properties: + reference: + type: string + description: >- + Unique reference code that must be included with the payment to properly + credit it + example: UMA-Q12345-REF diff --git a/openapi/components/schemas/common/PaymentPixAccountInfo.yaml b/openapi/components/schemas/common/PaymentPixAccountInfo.yaml index a586649..f8e0b0b 100644 --- a/openapi/components/schemas/common/PaymentPixAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentPixAccountInfo.yaml @@ -1,2 +1,3 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./PixAccountInfo.yaml diff --git a/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml b/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml index 1bd4efa..76f3b86 100644 --- a/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml @@ -1,7 +1,11 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./PolygonWalletInfo.yaml -properties: - assetType: - type: string - description: Type of asset - const: USDC \ No newline at end of file + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC + \ No newline at end of file diff --git a/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml b/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml index bc9e7f8..5e674ab 100644 --- a/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml @@ -1,9 +1,11 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./SolanaWalletInfo.yaml -properties: - assetType: - type: string - description: Type of asset - enum: - - USDC - - USDT \ No newline at end of file + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: + - USDC + - USDT diff --git a/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml b/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml index 2b0cbe6..b4a0b24 100644 --- a/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml @@ -1,15 +1,17 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./SparkWalletInfo.yaml -required: - - assetType -properties: - assetType: - type: string - description: Type of asset - enum: - - BTC - - USDB - invoice: - type: string - description: Invoice for the payment - example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s \ No newline at end of file + - type: object + required: + - assetType + properties: + assetType: + type: string + description: Type of asset + enum: + - BTC + - USDB + invoice: + type: string + description: Invoice for the payment + example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s diff --git a/openapi/components/schemas/common/PaymentTronWalletInfo.yaml b/openapi/components/schemas/common/PaymentTronWalletInfo.yaml index 4aa2cc9..1dbebb9 100644 --- a/openapi/components/schemas/common/PaymentTronWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentTronWalletInfo.yaml @@ -1,7 +1,9 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./TronWalletInfo.yaml -properties: - assetType: - type: string - description: Type of asset - const: USDT \ No newline at end of file + - type: object + properties: + assetType: + type: string + description: Type of asset + enum: [USDT] diff --git a/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml b/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml index 0dc0366..af4b990 100644 --- a/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml @@ -1,2 +1,3 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./UpiAccountInfo.yaml diff --git a/openapi/components/schemas/common/PaymentUsAccountInfo.yaml b/openapi/components/schemas/common/PaymentUsAccountInfo.yaml index c03cbce..526d5d0 100644 --- a/openapi/components/schemas/common/PaymentUsAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentUsAccountInfo.yaml @@ -1,11 +1,13 @@ allOf: + - $ref: ./BasePaymentAccountInfo.yaml - $ref: ./UsAccountInfo.yaml -required: - - reference -properties: - reference: - type: string - description: >- - Unique reference code that must be included with the payment to properly - credit it - example: UMA-Q12345-REF + - type: object + required: + - reference + properties: + reference: + type: string + description: >- + Unique reference code that must be included with the payment to properly + credit it + example: UMA-Q12345-REF diff --git a/openapi/components/schemas/common/PhpAccountInfo.yaml b/openapi/components/schemas/common/PhpAccountInfo.yaml index c01091d..9b01eda 100644 --- a/openapi/components/schemas/common/PhpAccountInfo.yaml +++ b/openapi/components/schemas/common/PhpAccountInfo.yaml @@ -1,13 +1,13 @@ type: object required: - - accountType - bankName - accountNumber + - accountType properties: accountType: type: string - enum: [PHP_ACCOUNT] - example: PHP_ACCOUNT + enum: + - PHP_ACCOUNT bankName: type: string description: Name of the beneficiary's bank diff --git a/openapi/components/schemas/common/PixAccountInfo.yaml b/openapi/components/schemas/common/PixAccountInfo.yaml index 48be7f9..fb37639 100644 --- a/openapi/components/schemas/common/PixAccountInfo.yaml +++ b/openapi/components/schemas/common/PixAccountInfo.yaml @@ -1,14 +1,14 @@ type: object required: - - accountType - pixKey - pixKeyType - taxId + - accountType properties: accountType: type: string - const: PIX - example: PIX + enum: + - PIX pixKey: type: string description: PIX key for Brazilian instant payments diff --git a/openapi/components/schemas/common/PolygonWalletInfo.yaml b/openapi/components/schemas/common/PolygonWalletInfo.yaml index 2839130..0b52715 100644 --- a/openapi/components/schemas/common/PolygonWalletInfo.yaml +++ b/openapi/components/schemas/common/PolygonWalletInfo.yaml @@ -1,12 +1,12 @@ type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: POLYGON_WALLET - example: POLYGON_WALLET + enum: + - POLYGON_WALLET address: type: string description: Polygon eth wallet address diff --git a/openapi/components/schemas/common/SgdAccountInfo.yaml b/openapi/components/schemas/common/SgdAccountInfo.yaml index fd262d2..1821b63 100644 --- a/openapi/components/schemas/common/SgdAccountInfo.yaml +++ b/openapi/components/schemas/common/SgdAccountInfo.yaml @@ -1,14 +1,14 @@ type: object required: - - accountType - bankName - swiftCode - accountNumber + - accountType properties: accountType: type: string - enum: [SGD_ACCOUNT] - example: SGD_ACCOUNT + enum: + - SGD_ACCOUNT bankName: type: string description: Name of the beneficiary's bank diff --git a/openapi/components/schemas/common/SolanaWalletInfo.yaml b/openapi/components/schemas/common/SolanaWalletInfo.yaml index 598e38b..a2ff50c 100644 --- a/openapi/components/schemas/common/SolanaWalletInfo.yaml +++ b/openapi/components/schemas/common/SolanaWalletInfo.yaml @@ -1,12 +1,12 @@ type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: SOLANA_WALLET - example: SOLANA_WALLET + enum: + - SOLANA_WALLET address: type: string description: Solana wallet address diff --git a/openapi/components/schemas/common/SparkWalletInfo.yaml b/openapi/components/schemas/common/SparkWalletInfo.yaml index fa51ca5..0706532 100644 --- a/openapi/components/schemas/common/SparkWalletInfo.yaml +++ b/openapi/components/schemas/common/SparkWalletInfo.yaml @@ -1,12 +1,12 @@ type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: SPARK_WALLET - example: SPARK_WALLET + enum: + - SPARK_WALLET address: type: string description: Spark wallet address diff --git a/openapi/components/schemas/common/TronWalletInfo.yaml b/openapi/components/schemas/common/TronWalletInfo.yaml index 5532087..3bffa8c 100644 --- a/openapi/components/schemas/common/TronWalletInfo.yaml +++ b/openapi/components/schemas/common/TronWalletInfo.yaml @@ -1,12 +1,12 @@ type: object required: - - accountType - address + - accountType properties: accountType: type: string - const: TRON_WALLET - example: TRON_WALLET + enum: + - TRON_WALLET address: type: string description: Tron wallet address diff --git a/openapi/components/schemas/common/UpiAccountInfo.yaml b/openapi/components/schemas/common/UpiAccountInfo.yaml index b64f54c..dc579b6 100644 --- a/openapi/components/schemas/common/UpiAccountInfo.yaml +++ b/openapi/components/schemas/common/UpiAccountInfo.yaml @@ -1,12 +1,12 @@ type: object required: - - accountType - vpa + - accountType properties: accountType: type: string - const: UPI - example: UPI + enum: + - UPI vpa: type: string description: Virtual Payment Address for UPI payments diff --git a/openapi/components/schemas/common/UsAccountInfo.yaml b/openapi/components/schemas/common/UsAccountInfo.yaml index d61a5be..e567351 100644 --- a/openapi/components/schemas/common/UsAccountInfo.yaml +++ b/openapi/components/schemas/common/UsAccountInfo.yaml @@ -1,14 +1,14 @@ type: object required: - - accountType - accountNumber - routingNumber - accountCategory + - accountType properties: accountType: type: string - const: US_ACCOUNT - example: US_ACCOUNT + enum: + - US_ACCOUNT accountNumber: type: string description: US bank account number diff --git a/openapi/components/schemas/customers/BusinessCustomer.yaml b/openapi/components/schemas/customers/BusinessCustomer.yaml index 489b6bc..9e7f507 100644 --- a/openapi/components/schemas/customers/BusinessCustomer.yaml +++ b/openapi/components/schemas/customers/BusinessCustomer.yaml @@ -1,7 +1,13 @@ allOf: - $ref: ./Customer.yaml - type: object + required: + - customerType properties: + customerType: + type: string + enum: + - BUSINESS address: $ref: ../common/Address.yaml businessInfo: diff --git a/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml b/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml index 70f8b6d..b146b34 100644 --- a/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml +++ b/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml @@ -4,7 +4,7 @@ required: properties: customerType: type: string - const: BUSINESS + enum: [BUSINESS] description: Customer type umaAddress: type: string diff --git a/openapi/components/schemas/customers/CustomerOneOf.yaml b/openapi/components/schemas/customers/CustomerOneOf.yaml new file mode 100644 index 0000000..c274c9e --- /dev/null +++ b/openapi/components/schemas/customers/CustomerOneOf.yaml @@ -0,0 +1,10 @@ +oneOf: + - title: Individual Customer + $ref: ./IndividualCustomer.yaml + - title: Business Customer + $ref: ./BusinessCustomer.yaml +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomer.yaml + BUSINESS: ./BusinessCustomer.yaml diff --git a/openapi/components/schemas/customers/IndividualCustomer.yaml b/openapi/components/schemas/customers/IndividualCustomer.yaml index b72bea4..6cd8a45 100644 --- a/openapi/components/schemas/customers/IndividualCustomer.yaml +++ b/openapi/components/schemas/customers/IndividualCustomer.yaml @@ -1,7 +1,13 @@ allOf: - $ref: ./Customer.yaml - type: object + required: + - customerType properties: + customerType: + type: string + enum: + - INDIVIDUAL fullName: type: string description: Individual's full name diff --git a/openapi/components/schemas/errors/Error400.yaml b/openapi/components/schemas/errors/Error400.yaml index 7a7e69c..b0e0587 100644 --- a/openapi/components/schemas/errors/Error400.yaml +++ b/openapi/components/schemas/errors/Error400.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 400 type: integer + enum: + - 400 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/errors/Error401.yaml b/openapi/components/schemas/errors/Error401.yaml index dc367d8..df6a733 100644 --- a/openapi/components/schemas/errors/Error401.yaml +++ b/openapi/components/schemas/errors/Error401.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 401 type: integer + enum: + - 401 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/errors/Error403.yaml b/openapi/components/schemas/errors/Error403.yaml index 520dea4..36c474c 100644 --- a/openapi/components/schemas/errors/Error403.yaml +++ b/openapi/components/schemas/errors/Error403.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 403 type: integer + enum: + - 403 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/errors/Error404.yaml b/openapi/components/schemas/errors/Error404.yaml index 055b9ca..19e2bfc 100644 --- a/openapi/components/schemas/errors/Error404.yaml +++ b/openapi/components/schemas/errors/Error404.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 404 type: integer + enum: + - 404 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/errors/Error409.yaml b/openapi/components/schemas/errors/Error409.yaml index a529e0f..0d23fd7 100644 --- a/openapi/components/schemas/errors/Error409.yaml +++ b/openapi/components/schemas/errors/Error409.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 409 type: integer + enum: + - 409 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/errors/Error412.yaml b/openapi/components/schemas/errors/Error412.yaml index 923d19d..4ac0344 100644 --- a/openapi/components/schemas/errors/Error412.yaml +++ b/openapi/components/schemas/errors/Error412.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 412 type: integer + enum: + - 412 description: HTTP status code code: type: string @@ -14,7 +15,7 @@ properties: | Error Code | Description | |------------|-------------| | UNSUPPORTED_UMA_VERSION | Counterparty doesn't support the Grid UMA version | - const: UNSUPPORTED_UMA_VERSION + enum: [UNSUPPORTED_UMA_VERSION] message: type: string description: Error message diff --git a/openapi/components/schemas/errors/Error424.yaml b/openapi/components/schemas/errors/Error424.yaml index 6d60cf3..5cd0b2b 100644 --- a/openapi/components/schemas/errors/Error424.yaml +++ b/openapi/components/schemas/errors/Error424.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 424 type: integer + enum: + - 424 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/errors/Error500.yaml b/openapi/components/schemas/errors/Error500.yaml index d077e25..7aea864 100644 --- a/openapi/components/schemas/errors/Error500.yaml +++ b/openapi/components/schemas/errors/Error500.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 500 type: integer + enum: + - 500 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/errors/Error501.yaml b/openapi/components/schemas/errors/Error501.yaml index 3c46735..55a275f 100644 --- a/openapi/components/schemas/errors/Error501.yaml +++ b/openapi/components/schemas/errors/Error501.yaml @@ -5,8 +5,9 @@ required: - code properties: status: - const: 501 type: integer + enum: + - 501 description: HTTP status code code: type: string diff --git a/openapi/components/schemas/external_accounts/BaseBeneficiary.yaml b/openapi/components/schemas/external_accounts/BaseBeneficiary.yaml new file mode 100644 index 0000000..27bd7e8 --- /dev/null +++ b/openapi/components/schemas/external_accounts/BaseBeneficiary.yaml @@ -0,0 +1,13 @@ +type: object +required: + - beneficiaryType +properties: + beneficiaryType: + $ref: ./BeneficiaryType.yaml + address: + $ref: ../common/Address.yaml +discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ./IndividualBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml new file mode 100644 index 0000000..ea40286 --- /dev/null +++ b/openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml @@ -0,0 +1,25 @@ +type: object +required: + - accountType +properties: + accountType: + $ref: ./ExternalAccountType.yaml +discriminator: + propertyName: accountType + mapping: + US_ACCOUNT: ./UsAccountExternalAccountInfo.yaml + CLABE: ./ClabeAccountExternalAccountInfo.yaml + PIX: ./PixAccountExternalAccountInfo.yaml + IBAN: ./IbanAccountExternalAccountInfo.yaml + UPI: ./UpiAccountExternalAccountInfo.yaml + NGN_ACCOUNT: ./NgnAccountExternalAccountInfo.yaml + CAD_ACCOUNT: ./CadAccountExternalAccountInfo.yaml + GBP_ACCOUNT: ./GbpAccountExternalAccountInfo.yaml + PHP_ACCOUNT: ./PhpAccountExternalAccountInfo.yaml + SGD_ACCOUNT: ./SgdAccountExternalAccountInfo.yaml + SPARK_WALLET: ./SparkWalletExternalAccountInfo.yaml + LIGHTNING: ./LightningExternalAccountInfo.yaml + SOLANA_WALLET: ./SolanaWalletExternalAccountInfo.yaml + TRON_WALLET: ./TronWalletExternalAccountInfo.yaml + POLYGON_WALLET: ./PolygonWalletExternalAccountInfo.yaml + BASE_WALLET: ./BaseWalletExternalAccountInfo.yaml diff --git a/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml index f33d671..32b939d 100644 --- a/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml @@ -1,10 +1,4 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/BaseWalletInfo.yaml - - type: object - required: - - accountType - properties: - accountType: - type: string - const: BASE_WALLET - example: BASE_WALLET + \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/BeneficiaryOneOf.yaml b/openapi/components/schemas/external_accounts/BeneficiaryOneOf.yaml new file mode 100644 index 0000000..f7c7e1e --- /dev/null +++ b/openapi/components/schemas/external_accounts/BeneficiaryOneOf.yaml @@ -0,0 +1,10 @@ +oneOf: + - title: Individual Beneficiary + $ref: ./IndividualBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml +discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ./IndividualBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/BeneficiaryType.yaml b/openapi/components/schemas/external_accounts/BeneficiaryType.yaml new file mode 100644 index 0000000..b83d51a --- /dev/null +++ b/openapi/components/schemas/external_accounts/BeneficiaryType.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - INDIVIDUAL + - BUSINESS +description: Whether the beneficiary is an individual or a business entity +example: INDIVIDUAL diff --git a/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml b/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml index 10ddea3..bb6ae23 100644 --- a/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml +++ b/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml @@ -1,23 +1,23 @@ -type: object -required: - - legalName - - beneficiaryType -properties: - beneficiaryType: - type: string - const: BUSINESS - example: BUSINESS - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - address: - $ref: ../common/Address.yaml +allOf: + - $ref: ./BaseBeneficiary.yaml + - type: object + required: + - legalName + - beneficiaryType + properties: + beneficiaryType: + type: string + enum: + - BUSINESS + legalName: + type: string + description: Legal name of the business + example: Acme Corporation, Inc. + registrationNumber: + type: string + description: Business registration number + example: BRN-123456789 + taxId: + type: string + description: Tax identification number + example: EIN-987654321 diff --git a/openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml index a569985..055b788 100644 --- a/openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml @@ -1,20 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/CadAccountInfo.yaml - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: [CAD_ACCOUNT] - example: CAD_ACCOUNT beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml index 38c7e8d..e422f99 100644 --- a/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml @@ -1,19 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/ClabeAccountInfo.yaml - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: CLABE - example: CLABE beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/ExternalAccount.yaml b/openapi/components/schemas/external_accounts/ExternalAccount.yaml index 0541df2..757d4f7 100644 --- a/openapi/components/schemas/external_accounts/ExternalAccount.yaml +++ b/openapi/components/schemas/external_accounts/ExternalAccount.yaml @@ -35,4 +35,4 @@ allOf: If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer. example: false accountInfo: - $ref: ./ExternalAccountInfo.yaml + $ref: ./ExternalAccountInfoOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/ExternalAccountCreateRequest.yaml b/openapi/components/schemas/external_accounts/ExternalAccountCreateRequest.yaml index 5b8a018..4406cb7 100644 --- a/openapi/components/schemas/external_accounts/ExternalAccountCreateRequest.yaml +++ b/openapi/components/schemas/external_accounts/ExternalAccountCreateRequest.yaml @@ -29,4 +29,4 @@ allOf: incoming UMA payments will be deposited into the primary internal account for the customer. default: false accountInfo: - $ref: ./ExternalAccountInfo.yaml \ No newline at end of file + $ref: ./ExternalAccountInfoOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/ExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml similarity index 100% rename from openapi/components/schemas/external_accounts/ExternalAccountInfo.yaml rename to openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/ExternalAccountType.yaml b/openapi/components/schemas/external_accounts/ExternalAccountType.yaml new file mode 100644 index 0000000..66c8d8b --- /dev/null +++ b/openapi/components/schemas/external_accounts/ExternalAccountType.yaml @@ -0,0 +1,20 @@ +type: string +enum: + - US_ACCOUNT + - CLABE + - PIX + - IBAN + - UPI + - NGN_ACCOUNT + - CAD_ACCOUNT + - GBP_ACCOUNT + - PHP_ACCOUNT + - SGD_ACCOUNT + - SPARK_WALLET + - LIGHTNING + - SOLANA_WALLET + - TRON_WALLET + - POLYGON_WALLET + - BASE_WALLET +description: Type of external account or wallet +example: US_ACCOUNT diff --git a/openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml index 58f0d32..d9d01c9 100644 --- a/openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml @@ -1,20 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/GbpAccountInfo.yaml - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: [GBP_ACCOUNT] - example: GBP_ACCOUNT beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml index 18366cc..085cdbc 100644 --- a/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml @@ -1,19 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/IbanAccountInfo.yaml - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: IBAN - example: IBAN beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml b/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml index 6a86b51..288ef94 100644 --- a/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml +++ b/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml @@ -1,26 +1,26 @@ -type: object -required: - - fullName - - birthDate - - nationality - - beneficiaryType -properties: - beneficiaryType: - type: string - const: INDIVIDUAL - example: INDIVIDUAL - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: ../common/Address.yaml +allOf: + - $ref: ./BaseBeneficiary.yaml + - type: object + required: + - fullName + - birthDate + - nationality + - beneficiaryType + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: Individual's full name + example: John Michael Doe + birthDate: + type: string + format: date + description: Date of birth in ISO 8601 format (YYYY-MM-DD) + example: '1990-01-15' + nationality: + type: string + description: Country code (ISO 3166-1 alpha-2) + example: US diff --git a/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml index fd8b921..754c07c 100644 --- a/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml @@ -1,22 +1,24 @@ -type: object -required: - - accountType -description: > - Lightning payment destination. Exactly one of `invoice`, `bolt12`, or `lightningAddress` must be provided. -properties: - accountType: - type: string - const: LIGHTNING - example: 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 +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 diff --git a/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml index a493565..959e1bf 100644 --- a/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml @@ -1,24 +1,11 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/NgnAccountInfo.yaml - type: object required: - - accountType - purposeOfPayment - beneficiary properties: - accountType: - type: string - const: NGN_ACCOUNT - example: NGN_ACCOUNT - beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml purposeOfPayment: type: string enum: @@ -36,3 +23,5 @@ allOf: - OTHER description: Purpose of payment example: GOODS_OR_SERVICES + beneficiary: + $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml index 977eed5..d69becb 100644 --- a/openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml @@ -1,20 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/PhpAccountInfo.yaml - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: [PHP_ACCOUNT] - example: PHP_ACCOUNT beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml index a6b6d04..f492c45 100644 --- a/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml @@ -1,19 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/PixAccountInfo.yaml - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: PIX - example: PIX beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml index f0ff0e4..d94a758 100644 --- a/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml @@ -1,10 +1,4 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/PolygonWalletInfo.yaml - - type: object - required: - - accountType - properties: - accountType: - type: string - const: POLYGON_WALLET - example: POLYGON_WALLET + \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml index a74a508..7e4cca1 100644 --- a/openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml @@ -1,20 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/SgdAccountInfo.yaml - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - enum: [SGD_ACCOUNT] - example: SGD_ACCOUNT beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml index c1c80d7..60fe22a 100644 --- a/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml @@ -1,10 +1,4 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/SolanaWalletInfo.yaml - - type: object - required: - - accountType - properties: - accountType: - type: string - const: SOLANA_WALLET - example: SOLANA_WALLET + \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml index 9eb34cf..af53008 100644 --- a/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml @@ -1,10 +1,4 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/SparkWalletInfo.yaml - - type: object - required: - - accountType - properties: - accountType: - type: string - const: SPARK_WALLET - example: SPARK_WALLET + \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml index 404243d..6ca2acc 100644 --- a/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml @@ -1,10 +1,4 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/TronWalletInfo.yaml - - type: object - required: - - accountType - properties: - accountType: - type: string - const: TRON_WALLET - example: TRON_WALLET + \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml index f30fe79..e767525 100644 --- a/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml @@ -1,19 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/UpiAccountInfo.yaml - type: object required: - - accountType + - beneficiary properties: - accountType: - type: string - const: UPI - example: UPI beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml index c9b2b54..6fa6a96 100644 --- a/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml @@ -1,20 +1,9 @@ allOf: + - $ref: ./BaseExternalAccountInfo.yaml - $ref: ../common/UsAccountInfo.yaml - type: object required: - - accountType - beneficiary properties: - accountType: - type: string - const: US_ACCOUNT - example: US_ACCOUNT beneficiary: - oneOf: - - $ref: ./IndividualBeneficiary.yaml - - $ref: ./BusinessBeneficiary.yaml - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: ./IndividualBeneficiary.yaml - BUSINESS: ./BusinessBeneficiary.yaml + $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/quotes/AccountDestination.yaml b/openapi/components/schemas/quotes/AccountDestination.yaml new file mode 100644 index 0000000..8b66265 --- /dev/null +++ b/openapi/components/schemas/quotes/AccountDestination.yaml @@ -0,0 +1,16 @@ +allOf: + - $ref: ./BaseDestination.yaml + - type: object + required: + - accountId + - destinationType + properties: + destinationType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + description: Destination account details diff --git a/openapi/components/schemas/quotes/AccountQuoteSource.yaml b/openapi/components/schemas/quotes/AccountQuoteSource.yaml new file mode 100644 index 0000000..6a31def --- /dev/null +++ b/openapi/components/schemas/quotes/AccountQuoteSource.yaml @@ -0,0 +1,20 @@ +allOf: + - $ref: ./BaseQuoteSource.yaml + - type: object + required: + - accountId + - sourceType + properties: + sourceType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Source account identifier + example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + customerId: + type: string + description: Required when funding from an FBO account to identify the customer on whose behalf the transaction is being initiated. Otherwise, will default to the customerId of the account owner. + example: Customer:019542f5-b3e7-1d02-0000-000000000001 + description: Source account details diff --git a/openapi/components/schemas/quotes/BaseDestination.yaml b/openapi/components/schemas/quotes/BaseDestination.yaml new file mode 100644 index 0000000..c4c8164 --- /dev/null +++ b/openapi/components/schemas/quotes/BaseDestination.yaml @@ -0,0 +1,12 @@ +type: object +required: + - destinationType +properties: + destinationType: + $ref: ./DestinationType.yaml +discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./AccountDestination.yaml + UMA_ADDRESS: ./UmaAddressDestination.yaml + EXTERNAL_ACCOUNT_DETAILS: ./ExternalAccountDetailsDestination.yaml diff --git a/openapi/components/schemas/quotes/BaseQuoteSource.yaml b/openapi/components/schemas/quotes/BaseQuoteSource.yaml new file mode 100644 index 0000000..f584b5a --- /dev/null +++ b/openapi/components/schemas/quotes/BaseQuoteSource.yaml @@ -0,0 +1,11 @@ +type: object +required: + - sourceType +properties: + sourceType: + $ref: ./QuoteSourceType.yaml +discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountQuoteSource.yaml + REALTIME_FUNDING: ./RealtimeFundingQuoteSource.yaml diff --git a/openapi/components/schemas/quotes/DestinationType.yaml b/openapi/components/schemas/quotes/DestinationType.yaml new file mode 100644 index 0000000..9ebdbeb --- /dev/null +++ b/openapi/components/schemas/quotes/DestinationType.yaml @@ -0,0 +1,7 @@ +type: string +enum: + - ACCOUNT + - UMA_ADDRESS + - EXTERNAL_ACCOUNT_DETAILS +description: Type of payment destination +example: ACCOUNT diff --git a/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml b/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml new file mode 100644 index 0000000..376083f --- /dev/null +++ b/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml @@ -0,0 +1,18 @@ +allOf: + - $ref: ./BaseDestination.yaml + - type: object + required: + - externalAccountDetails + - destinationType + properties: + destinationType: + type: string + enum: + - EXTERNAL_ACCOUNT_DETAILS + 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/Quote.yaml b/openapi/components/schemas/quotes/Quote.yaml index 92edf2a..8802ab9 100644 --- a/openapi/components/schemas/quotes/Quote.yaml +++ b/openapi/components/schemas/quotes/Quote.yaml @@ -40,47 +40,9 @@ properties: example: '2025-10-03T12:05:00Z' # Transfer details source: - $ref: ./QuoteSource.yaml + $ref: ./QuoteSourceOneOf.yaml destination: - 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: ./QuoteDestinationOneOf.yaml sendingCurrency: $ref: ../common/Currency.yaml description: Currency for the sending amount diff --git a/openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml b/openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml new file mode 100644 index 0000000..3bc5966 --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml @@ -0,0 +1,13 @@ +oneOf: + - title: Account + $ref: ./AccountDestination.yaml + - title: UMA Address + $ref: ./UmaAddressDestination.yaml + - title: External Account Details + $ref: ./ExternalAccountDetailsDestination.yaml +discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./AccountDestination.yaml + UMA_ADDRESS: ./UmaAddressDestination.yaml + EXTERNAL_ACCOUNT_DETAILS: ./ExternalAccountDetailsDestination.yaml diff --git a/openapi/components/schemas/quotes/QuoteRequest.yaml b/openapi/components/schemas/quotes/QuoteRequest.yaml index 5e27a72..aba685e 100644 --- a/openapi/components/schemas/quotes/QuoteRequest.yaml +++ b/openapi/components/schemas/quotes/QuoteRequest.yaml @@ -15,57 +15,9 @@ properties: See `senderCustomerInfo` for more information. example: Lookup:019542f5-b3e7-1d02-0000-000000000009 source: - $ref: ./QuoteSource.yaml + $ref: ./QuoteSourceOneOf.yaml 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 - - 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 - - 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: ./QuoteDestinationOneOf.yaml lockedCurrencySide: $ref: ./QuoteLockSide.yaml lockedCurrencyAmount: diff --git a/openapi/components/schemas/quotes/QuoteSourceOneOf.yaml b/openapi/components/schemas/quotes/QuoteSourceOneOf.yaml new file mode 100644 index 0000000..57a96df --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteSourceOneOf.yaml @@ -0,0 +1,10 @@ +oneOf: + - title: Account + $ref: ./AccountQuoteSource.yaml + - title: Real-time Funding + $ref: ./RealtimeFundingQuoteSource.yaml +discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountQuoteSource.yaml + REALTIME_FUNDING: ./RealtimeFundingQuoteSource.yaml diff --git a/openapi/components/schemas/quotes/QuoteSourceType.yaml b/openapi/components/schemas/quotes/QuoteSourceType.yaml new file mode 100644 index 0000000..dd6f3a9 --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteSourceType.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - ACCOUNT + - REALTIME_FUNDING +description: Type of quote funding source +example: ACCOUNT diff --git a/openapi/components/schemas/quotes/QuoteSource.yaml b/openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml similarity index 63% rename from openapi/components/schemas/quotes/QuoteSource.yaml rename to openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml index d12a92d..a45b294 100644 --- a/openapi/components/schemas/quotes/QuoteSource.yaml +++ b/openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml @@ -1,27 +1,14 @@ -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 +allOf: + - $ref: ./BaseQuoteSource.yaml + - type: object required: - currency - - customerId + - sourceType properties: + sourceType: + type: string + enum: + - REALTIME_FUNDING customerId: type: string description: >- diff --git a/openapi/components/schemas/quotes/UmaAddressDestination.yaml b/openapi/components/schemas/quotes/UmaAddressDestination.yaml new file mode 100644 index 0000000..b60dbe3 --- /dev/null +++ b/openapi/components/schemas/quotes/UmaAddressDestination.yaml @@ -0,0 +1,33 @@ +allOf: + - $ref: ./BaseDestination.yaml + - type: object + required: + - umaAddress + - destinationType + properties: + destinationType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + 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 + 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/transactions/AccountTransactionDestination.yaml b/openapi/components/schemas/transactions/AccountTransactionDestination.yaml new file mode 100644 index 0000000..cc04118 --- /dev/null +++ b/openapi/components/schemas/transactions/AccountTransactionDestination.yaml @@ -0,0 +1,16 @@ +allOf: + - $ref: ./BaseTransactionDestination.yaml + - type: object + required: + - accountId + - destinationType + properties: + destinationType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + description: Destination account details diff --git a/openapi/components/schemas/transactions/AccountTransactionSource.yaml b/openapi/components/schemas/transactions/AccountTransactionSource.yaml new file mode 100644 index 0000000..a086235 --- /dev/null +++ b/openapi/components/schemas/transactions/AccountTransactionSource.yaml @@ -0,0 +1,16 @@ +allOf: + - $ref: ./BaseTransactionSource.yaml + - type: object + required: + - accountId + - sourceType + properties: + sourceType: + type: string + enum: + - ACCOUNT + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + description: Source account details diff --git a/openapi/components/schemas/transactions/BaseTransactionDestination.yaml b/openapi/components/schemas/transactions/BaseTransactionDestination.yaml new file mode 100644 index 0000000..fab727b --- /dev/null +++ b/openapi/components/schemas/transactions/BaseTransactionDestination.yaml @@ -0,0 +1,15 @@ +type: object +required: + - destinationType +properties: + destinationType: + $ref: ./TransactionDestinationType.yaml + currency: + type: string + description: Currency code for the destination + example: EUR +discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./AccountTransactionDestination.yaml + UMA_ADDRESS: ./UmaAddressTransactionDestination.yaml diff --git a/openapi/components/schemas/transactions/BaseTransactionSource.yaml b/openapi/components/schemas/transactions/BaseTransactionSource.yaml new file mode 100644 index 0000000..de82afa --- /dev/null +++ b/openapi/components/schemas/transactions/BaseTransactionSource.yaml @@ -0,0 +1,15 @@ +type: object +required: + - sourceType +properties: + sourceType: + $ref: ./TransactionSourceType.yaml + currency: + type: string + description: Currency code for the source + example: USD +discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountTransactionSource.yaml + UMA_ADDRESS: ./UmaAddressTransactionSource.yaml diff --git a/openapi/components/schemas/transactions/IncomingTransaction.yaml b/openapi/components/schemas/transactions/IncomingTransaction.yaml index ebd4fe0..36e6db7 100644 --- a/openapi/components/schemas/transactions/IncomingTransaction.yaml +++ b/openapi/components/schemas/transactions/IncomingTransaction.yaml @@ -5,36 +5,7 @@ allOf: - receivedAmount properties: 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 - - 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: ./TransactionSourceOneOf.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..6eae9b8 100644 --- a/openapi/components/schemas/transactions/OutgoingTransaction.yaml +++ b/openapi/components/schemas/transactions/OutgoingTransaction.yaml @@ -7,36 +7,7 @@ allOf: - source properties: 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 - - 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: ./TransactionSourceOneOf.yaml sentAmount: $ref: ../common/CurrencyAmount.yaml description: Amount sent in the sender's currency diff --git a/openapi/components/schemas/transactions/Transaction.yaml b/openapi/components/schemas/transactions/Transaction.yaml index 83f5c80..fe0aa29 100644 --- a/openapi/components/schemas/transactions/Transaction.yaml +++ b/openapi/components/schemas/transactions/Transaction.yaml @@ -16,35 +16,7 @@ properties: type: $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: ./TransactionDestinationOneOf.yaml customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) diff --git a/openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml b/openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml new file mode 100644 index 0000000..eca20ef --- /dev/null +++ b/openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml @@ -0,0 +1,10 @@ +oneOf: + - title: Account Destination + $ref: ./AccountTransactionDestination.yaml + - title: UMA Address Destination + $ref: ./UmaAddressTransactionDestination.yaml +discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./AccountTransactionDestination.yaml + UMA_ADDRESS: ./UmaAddressTransactionDestination.yaml diff --git a/openapi/components/schemas/transactions/TransactionDestinationType.yaml b/openapi/components/schemas/transactions/TransactionDestinationType.yaml new file mode 100644 index 0000000..f2b9006 --- /dev/null +++ b/openapi/components/schemas/transactions/TransactionDestinationType.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - ACCOUNT + - UMA_ADDRESS +description: Type of transaction destination +example: ACCOUNT diff --git a/openapi/components/schemas/transactions/TransactionSourceOneOf.yaml b/openapi/components/schemas/transactions/TransactionSourceOneOf.yaml new file mode 100644 index 0000000..06c8e03 --- /dev/null +++ b/openapi/components/schemas/transactions/TransactionSourceOneOf.yaml @@ -0,0 +1,10 @@ +oneOf: + - title: Account Source + $ref: ./AccountTransactionSource.yaml + - title: UMA Address Source + $ref: ./UmaAddressTransactionSource.yaml +discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountTransactionSource.yaml + UMA_ADDRESS: ./UmaAddressTransactionSource.yaml diff --git a/openapi/components/schemas/transactions/TransactionSourceType.yaml b/openapi/components/schemas/transactions/TransactionSourceType.yaml new file mode 100644 index 0000000..469546c --- /dev/null +++ b/openapi/components/schemas/transactions/TransactionSourceType.yaml @@ -0,0 +1,7 @@ +type: string +enum: + - ACCOUNT + - UMA_ADDRESS + - REALTIME_FUNDING +description: Type of transaction source +example: ACCOUNT diff --git a/openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml b/openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml new file mode 100644 index 0000000..8d1b5dc --- /dev/null +++ b/openapi/components/schemas/transactions/UmaAddressTransactionDestination.yaml @@ -0,0 +1,16 @@ +allOf: + - $ref: ./BaseTransactionDestination.yaml + - type: object + required: + - umaAddress + - destinationType + properties: + destinationType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + description: UMA address destination details diff --git a/openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml b/openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml new file mode 100644 index 0000000..6bf3678 --- /dev/null +++ b/openapi/components/schemas/transactions/UmaAddressTransactionSource.yaml @@ -0,0 +1,16 @@ +allOf: + - $ref: ./BaseTransactionSource.yaml + - type: object + required: + - umaAddress + - sourceType + properties: + sourceType: + type: string + enum: + - UMA_ADDRESS + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + description: UMA address source details diff --git a/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml b/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml index a57b766..a9087f3 100644 --- a/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml +++ b/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml @@ -8,6 +8,6 @@ allOf: $ref: ../invitations/UmaInvitation.yaml type: type: string - const: INVITATION_CLAIMED + enum: [INVITATION_CLAIMED] description: Type of webhook event example: INVITATION_CLAIMED diff --git a/openapi/paths/customers/customers.yaml b/openapi/paths/customers/customers.yaml index 9bced55..49a3113 100644 --- a/openapi/paths/customers/customers.yaml +++ b/openapi/paths/customers/customers.yaml @@ -13,115 +13,14 @@ post: content: application/json: schema: - oneOf: - - title: New Individual Customer - allOf: - - $ref: ../../components/schemas/customers/IndividualCustomerUpdate.yaml - - type: object - required: - - platformCustomerId - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your individual customer if KYC needs to be completed - example: "https://example.com/kyc" - - title: New Business Customer - allOf: - - $ref: ../../components/schemas/customers/BusinessCustomerUpdate.yaml - - type: object - required: - - platformCustomerId - - businessInfo - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your business customer if KYC needs to be completed - example: "https://example.com/kyc" - businessInfo: - type: object - required: - - legalName - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - examples: - individualCustomerWithUmaAddress: - summary: Create individual customer with UMA address, including deposit bank account information. - value: - umaAddress: $jane.doe@uma.domain.com - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: Jane Doe - birthDate: '1992-03-25' - address: - line1: 123 Pine Street - line2: Unit 501 - city: Seattle - state: WA - postalCode: '98101' - country: US - individualCustomerWithoutUmaAddress: - summary: Create individual customer without UMA address (will be generated) - value: - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-10' - address: - line1: 456 Oak Avenue - city: Portland - state: OR - postalCode: '97201' - country: US - businessCustomer: - summary: Create business customer example - value: - platformCustomerId: 6e4d2c0b8a9f3 - customerType: BUSINESS - businessInfo: - legalName: Acme Corporation - registrationNumber: BRN-456789123 - taxId: EIN-987123456 - address: - line1: 400 Commerce Way - city: Austin - state: TX - postalCode: '78701' - country: US + $ref: ../../components/schemas/customers/CustomerOneOf.yaml responses: '201': description: Customer created successfully content: application/json: schema: - oneOf: - - title: Individual Customer - $ref: ../../components/schemas/customers/IndividualCustomer.yaml - - title: Business Customer - $ref: ../../components/schemas/customers/BusinessCustomer.yaml - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: ../../components/schemas/customers/IndividualCustomer.yaml - BUSINESS: ../../components/schemas/customers/BusinessCustomer.yaml + $ref: ../../components/schemas/customers/CustomerOneOf.yaml '400': description: Bad request content: @@ -248,16 +147,7 @@ get: type: array description: List of customers matching the filter criteria items: - oneOf: - - title: Individual Customer - $ref: ../../components/schemas/customers/IndividualCustomer.yaml - - title: Business Customer - $ref: ../../components/schemas/customers/BusinessCustomer.yaml - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: ../../components/schemas/customers/IndividualCustomer.yaml - BUSINESS: ../../components/schemas/customers/BusinessCustomer.yaml + $ref: ../../components/schemas/customers/CustomerOneOf.yaml hasMore: type: boolean description: Indicates if more results are available beyond this page