diff --git a/.redocly.lint-ignore.yaml b/.redocly.lint-ignore.yaml index 0329536..5a21589 100644 --- a/.redocly.lint-ignore.yaml +++ b/.redocly.lint-ignore.yaml @@ -1,6 +1,11 @@ # This file instructs Redocly's linter to ignore the rules contained for specific parts of your API. # See https://redocly.com/docs/cli/ for more information. openapi.yaml: + no-unused-components: + - '#/components/schemas/AllErrors' + no-required-schema-properties-undefined: + - '#/components/schemas/QuoteSource/required/0' + - '#/components/schemas/Quote/properties/destination/required/0' no-invalid-media-type-examples: - >- #/paths/~1customers~1external-accounts/post/requestBody/content/application~1json/schema diff --git a/.stainless/stainless.yml b/.stainless/stainless.yml new file mode 100644 index 0000000..8f4aa1e --- /dev/null +++ b/.stainless/stainless.yml @@ -0,0 +1,329 @@ +# yaml-language-server: $schema=https://app.stainless.com/config.schema.json + +# The main edition for the config, see the [docs] for more information. +# +# [docs]: https://www.stainless.com/docs/reference/editions +edition: 2025-10-10 + +organization: + # Name of your organization or company, used to determine the name of the client + # and headings. + name: grid + # Link to your API documentation. + docs: '' + # Contact email for bug reports, questions, and support requests. + contact: support@lightspark.com + +# `targets` define the output targets and their customization options, such as +# whether to emit the Node SDK and what its package name should be. +targets: + typescript: + # The edition for this target, see the [docs] for more information. + # + # [docs]: https://www.stainless.com/docs/reference/editions + edition: typescript.2025-10-10 + package_name: grid + production_repo: null + publish: + npm: false + kotlin: + edition: kotlin.2025-10-08 + reverse_domain: com.grid.api + production_repo: null + publish: + maven: false + +# `environments` are a map of the name of the environment (e.g. "sandbox", +# "production") to the corresponding url to use. +environments: + production: https://api.lightspark.com/grid/2025-10-13 + +# `resources` define the structure and organization for your API, such as how +# methods and models are grouped together and accessed. See the [configuration +# guide] for more information. +# +# [configuration guide]: https://www.stainless.com/docs/guides/configure#resources +resources: + config: + # Configure the methods defined in this resource. Each key in the object is the + # name of the method and the value is either an endpoint (for example, `get /foo`) + # or an object with more detail. + # + # [reference]: https://www.stainless.com/docs/reference/config#method + # Configure the models--named types--defined in the resource. Each key in the + # object is the name of the model and the value is either the name of a schema in + # `#/components/schemas` or an object with more detail. + # + # [reference]: https://www.stainless.com/docs/reference/config#model + models: + customer_info_field_name: '#/components/schemas/CustomerInfoFieldName' + platform_currency_config: '#/components/schemas/PlatformCurrencyConfig' + platform_config: '#/components/schemas/PlatformConfig' + methods: + retrieve: get /config + update: patch /config + + customers: + models: + customer_type: '#/components/schemas/CustomerType' + individual_customer: '#/components/schemas/IndividualCustomer' + customer: '#/components/schemas/Customer' + address: '#/components/schemas/Address' + ultimate_beneficial_owner: '#/components/schemas/UltimateBeneficialOwner' + business_customer: '#/components/schemas/BusinessCustomer' + individual_customer_update: '#/components/schemas/IndividualCustomerUpdate' + business_customer_update: '#/components/schemas/BusinessCustomerUpdate' + methods: + create: + endpoint: post /customers + body_param_name: CreateCustomerRequest + list: get /customers + retrieve: get /customers/{customerId} + update: + endpoint: patch /customers/{customerId} + body_param_name: UpdateCustomerRequest + delete: delete /customers/{customerId} + get_kyc_link: get /customers/kyc-link + list_internal_accounts: get /customers/internal-accounts + # Subresources define resources that are nested within another for more powerful + # logical groupings, e.g. `cards.payments`. + subresources: + external_accounts: + models: + us_account_info: '#/components/schemas/UsAccountInfo' + pix_account_info: '#/components/schemas/PixAccountInfo' + iban_account_info: '#/components/schemas/IbanAccountInfo' + upi_account_info: '#/components/schemas/UpiAccountInfo' + spark_wallet_info: '#/components/schemas/SparkWalletInfo' + solana_wallet_info: '#/components/schemas/SolanaWalletInfo' + tron_wallet_info: '#/components/schemas/TronWalletInfo' + polygon_wallet_info: '#/components/schemas/PolygonWalletInfo' + clabe_account_info: '#/components/schemas/ClabeAccountInfo' + base_wallet_info: '#/components/schemas/BaseWalletInfo' + individual_beneficiary: '#/components/schemas/IndividualBeneficiary' + business_beneficiary: '#/components/schemas/BusinessBeneficiary' + external_account_info: '#/components/schemas/ExternalAccountInfo' + external_account: '#/components/schemas/ExternalAccount' + external_account_create: '#/components/schemas/ExternalAccountCreateRequest' + lightning_external_account_info: "#/components/schemas/LightningExternalAccountInfo" + ngn_account_external_account_info: "#/components/schemas/NgnAccountExternalAccountInfo" + methods: + list: get /customers/external-accounts + create: post /customers/external-accounts + bulk: + methods: + upload_csv: post /customers/bulk/csv + get_job_status: get /customers/bulk/jobs/{jobId} + + platform: + methods: + list_internal_accounts: + endpoint: get /platform/internal-accounts + paginated: false + subresources: + external_accounts: + methods: + list: + endpoint: get /platform/external-accounts + paginated: false + create: post /platform/external-accounts + + plaid: + methods: + create_link_token: post /plaid/link-tokens + submit_public_token: post /plaid/callback/{plaid_link_token} + + transfer_in: + models: + transaction: '#/components/schemas/Transaction' + methods: + create: post /transfer-in + + transfer_out: + methods: + create: post /transfer-out + + receiver: + models: + counterparty_field_definition: '#/components/schemas/CounterpartyFieldDefinition' + lookup_response: '#/components/schemas/ReceiverLookupResponse' + methods: + lookup_uma: get /receiver/uma/{receiverUmaAddress} + lookup_external_account: get /receiver/external-account/{accountId} + + quotes: + models: + currency: '#/components/schemas/Currency' + payment_instructions: '#/components/schemas/PaymentInstructions' + outgoing_rate_details: '#/components/schemas/OutgoingRateDetails' + quote_source: '#/components/schemas/QuoteSource' + quote: '#/components/schemas/Quote' + methods: + retrieve: get /quotes/{quoteId} + create: post /quotes + list: get /quotes + execute: post /quotes/{quoteId}/execute + + transactions: + models: + transaction_type: '#/components/schemas/TransactionType' + incoming_transaction: '#/components/schemas/IncomingTransaction' + transaction_status: '#/components/schemas/TransactionStatus' + account_source: "#/components/schemas/AccountSource" + uma_address_source: "#/components/schemas/UmaAddressSource" + methods: + list: get /transactions + retrieve: get /transactions/{transactionId} + approve: post /transactions/{transactionId}/approve + reject: post /transactions/{transactionId}/reject + + webhooks: + methods: + send_test: post /webhooks/test + + invitations: + models: + currency_amount: '#/components/schemas/CurrencyAmount' + uma_invitation: '#/components/schemas/UmaInvitation' + methods: + create: post /invitations + retrieve: get /invitations/{invitationCode} + claim: post /invitations/{invitationCode}/claim + cancel: post /invitations/{invitationCode}/cancel + + sandbox: + methods: + send_funds: post /sandbox/send + subresources: + uma: + methods: + receive_payment: post /sandbox/uma/receive + internal_accounts: + models: + internal_account: '#/components/schemas/InternalAccount' + methods: + fund: post /sandbox/internal-accounts/{accountId}/fund + + uma_providers: + methods: + list: get /uma-providers + + tokens: + models: + permission: '#/components/schemas/Permission' + api_token: '#/components/schemas/ApiToken' + methods: + create: post /tokens + list: get /tokens + retrieve: get /tokens/{tokenId} + delete: delete /tokens/{tokenId} + +settings: + # All generated integration tests that hit the prism mock http server are marked + # as skipped. Removing this setting or setting it to false enables tests, but + # doing so may result in test failures due to bugs in the test server. + # + # [prism mock http server]: https://stoplight.io/open-source/prism + disable_mock_tests: true + license: Apache-2.0 + +# `client_settings` define settings for the API client, such as extra constructor +# arguments (used for authentication), retry behavior, idempotency, etc. +client_settings: + opts: + username: + type: string + nullable: false + auth: + security_scheme: BasicAuth + role: username + description: API token authentication using format `:` + read_env: GRID_USERNAME + password: + type: string + nullable: false + auth: + security_scheme: BasicAuth + role: password + description: API token authentication using format `:` + read_env: GRID_PASSWORD + webhook_signature: + type: string + nullable: true + auth: + security_scheme: WebhookSignature + description: | + Secp256r1 (P-256) asymmetric signature of the webhook payload, which can be used to verify that the webhook was sent by Grid. + + To verify the signature: + 1. Get the Grid public key provided to you during integration + 2. Decode the base64 signature from the header + 3. Create a SHA-256 hash of the request body + 4. Verify the signature using the public key and the hash + + If the signature verification succeeds, the webhook is authentic. If not, it should be rejected. + read_env: GRID_WEBHOOK_SIGNATURE + +# `readme` is used to configure the code snippets that will be rendered in the +# README.md of various SDKs. In particular, you can change the `headline` +# snippet's endpoint and the arguments to call it with. +readme: + example_requests: + default: + type: request + endpoint: get /config + params: {} + headline: + type: request + endpoint: get /config + params: {} + pagination: + type: request + endpoint: get /customers + params: {} + +pagination: + - name: default_pagination + type: cursor + request: + cursor: + type: string + x-stainless-pagination-property: + purpose: next_cursor_param + response: + data: + type: array + items: + type: object + nextCursor: + type: string + x-stainless-pagination-property: + purpose: next_cursor_field + hasMore: + type: boolean + x-stainless-pagination-property: + purpose: has_next_page + totalCount: + type: integer + +openapi: + code_samples: mintlify + transformations: + - command: splitSchemasByEnumProperty + reason: Split error schemas with multiple enum values into distinct ones + args: + unionPath: AllErrors + enumProperty: code + +errors: + union: + source: AllErrors + discriminator: code + status_property: status + +codeflow: + detect_breaking_changes: true +diagnostics: + ignored: + Schema/ObjectHasNoProperties: + - pagination.0.response.data.items diff --git a/.stainless/workspace.json b/.stainless/workspace.json new file mode 100644 index 0000000..1af9854 --- /dev/null +++ b/.stainless/workspace.json @@ -0,0 +1,10 @@ +{ + "project": "grid", + "openapi_spec": "../mintlify/openapi.yaml", + "stainless_config": "stainless.yml", + "targets": { + "typescript": { + "output_path": "../sdks/grid-typescript" + } + } +} diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index c8ef1d7..fd90680 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -154,99 +154,7 @@ 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/CreateCustomerRequest' responses: '201': description: Customer created successfully @@ -486,43 +394,7 @@ paths: content: application/json: schema: - oneOf: - - title: Update Individual Customer - $ref: '#/components/schemas/IndividualCustomerUpdate' - - title: Update Business Customer - $ref: '#/components/schemas/BusinessCustomerUpdate' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' - BUSINESS: '#/components/schemas/BusinessCustomerUpdate' - examples: - individualUpdate: - summary: Update individual customer example - value: - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-15' - address: - line1: 456 Market St - city: San Francisco - state: CA - postalCode: '94103' - country: US - businessUpdate: - summary: Update business customer example - value: - customerType: BUSINESS - businessInfo: - legalName: New Tech Solutions LLC - registrationNumber: BRN-987654321 - taxId: EIN-123456789 - address: - line1: 100 Technology Parkway - city: Palo Alto - state: CA - postalCode: '94304' - country: US + $ref: '#/components/schemas/UpdateCustomerRequest' responses: '200': description: Customer updated successfully @@ -604,7 +476,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/GridError' '500': description: Internal service error content: @@ -999,9 +871,9 @@ paths: schema: type: object required: - - accounts + - data properties: - accounts: + data: type: array description: List of external accounts matching the filter criteria items: @@ -1649,47 +1521,6 @@ paths: application/json: schema: $ref: '#/components/schemas/QuoteRequest' - examples: - accountToAccount: - summary: Account to Account Transfer - value: - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 10000 - description: Transfer between accounts, either internal or external. - accountToUma: - summary: Account to UMA Address Transfer - value: - lookupId: LookupRequest:019542f5-b3e7-1d02-0000-000000000009 - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - umaAddress: $receiver@uma.domain.com - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 1000 - description: 'Payment for invoice #1234' - realTimeFundingToSparkWallet: - summary: Real-time funding to Spark Wallet as an on-ramp flow. Immediate execution. - value: - source: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: USD - destination: - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - lockedCurrencySide: RECEIVING - lockedCurrencyAmount: 10000 - immediatelyExecute: true - description: Bitcoin reward payout! responses: '201': description: | @@ -3887,6 +3718,17 @@ components: If the signature verification succeeds, the webhook is authentic. If not, it should be rejected. schemas: + AllErrors: + anyOf: + - $ref: '#/components/schemas/Error400' + - $ref: '#/components/schemas/Error401' + - $ref: '#/components/schemas/Error403' + - $ref: '#/components/schemas/Error404' + - $ref: '#/components/schemas/Error409' + - $ref: '#/components/schemas/Error412' + - $ref: '#/components/schemas/Error424' + - $ref: '#/components/schemas/Error500' + - $ref: '#/components/schemas/Error501' CustomerInfoFieldName: type: string enum: @@ -4044,8 +3886,7 @@ components: - code properties: status: - enum: - - 401 + const: 401 type: integer description: HTTP status code code: @@ -4064,6 +3905,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error500: type: object required: @@ -4072,8 +3914,7 @@ components: - code properties: status: - enum: - - 500 + const: 500 type: integer description: HTTP status code code: @@ -4092,6 +3933,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error400: type: object required: @@ -4100,8 +3942,7 @@ components: - code properties: status: - enum: - - 400 + const: 400 type: integer description: HTTP status code code: @@ -4170,6 +4011,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error501: type: object required: @@ -4178,8 +4020,7 @@ components: - code properties: status: - enum: - - 501 + const: 501 type: integer description: HTTP status code code: @@ -4198,6 +4039,7 @@ components: details: type: object description: Additional error details + additionalProperties: true CustomerType: type: string enum: @@ -4320,7 +4162,7 @@ components: phoneNumber: type: string description: Phone number of the individual in E.164 format - example: 5555555555 + example: '+5555555555' pattern: ^\+[1-9]\d{1,14}$ taxId: type: string @@ -4404,8 +4246,7 @@ components: properties: customerType: type: string - enum: - - INDIVIDUAL + const: INDIVIDUAL description: Customer type fullName: type: string @@ -4422,6 +4263,10 @@ components: example: US address: $ref: '#/components/schemas/Address' + platformCustomerId: + type: string + description: Platform-specific customer identifier + example: 9f84e0c2a72c4fa umaAddress: type: string description: | @@ -4436,8 +4281,7 @@ components: properties: customerType: type: string - enum: - - BUSINESS + const: BUSINESS description: Customer type umaAddress: type: string @@ -4464,6 +4308,25 @@ components: type: array items: $ref: '#/components/schemas/UltimateBeneficialOwner' + CreateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Error409: type: object required: @@ -4472,8 +4335,7 @@ components: - code properties: status: - enum: - - 409 + const: 409 type: integer description: HTTP status code code: @@ -4492,6 +4354,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error404: type: object required: @@ -4500,8 +4363,7 @@ components: - code properties: status: - enum: - - 404 + const: 404 type: integer description: HTTP status code code: @@ -4532,8 +4394,10 @@ components: details: type: object description: Additional error details - Error: + additionalProperties: true + GridError: type: object + title: GridError properties: code: type: string @@ -4544,6 +4408,26 @@ components: details: type: object description: Additional error details + additionalProperties: true + UpdateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Currency: type: object properties: @@ -4577,9 +4461,24 @@ components: example: 12550 currency: $ref: '#/components/schemas/Currency' + ClabeAccountInfo: + type: object + required: + - accountType + - clabeNumber + properties: + accountType: + 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/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/ClabeAccountInfo' required: - reference @@ -4588,28 +4487,6 @@ components: type: string description: Unique reference code that must be included with the payment to properly credit it example: UMA-Q12345-REF - PaymentAccountOrWalletInfo: - type: object - required: - - accountType - properties: - accountType: - $ref: '#/components/schemas/BankAccountOrWalletType' - discriminator: - propertyName: accountType - mapping: - CLABE: '#/components/schemas/PaymentClabeAccountInfo' - US_ACCOUNT: '#/components/schemas/PaymentUsAccountInfo' - PIX: '#/components/schemas/PaymentPixAccountInfo' - IBAN: '#/components/schemas/PaymentIbanAccountInfo' - FBO: '#/components/schemas/PaymentFboAccountInfo' - 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' UsAccountInfo: type: object required: @@ -4619,9 +4496,7 @@ components: - accountCategory properties: accountType: - type: string - enum: - - US_ACCOUNT + const: US_ACCOUNT example: US_ACCOUNT accountNumber: type: string @@ -4647,7 +4522,6 @@ components: example: Chase Bank PaymentUsAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/UsAccountInfo' required: - reference @@ -4665,9 +4539,7 @@ components: - taxId properties: accountType: - type: string - enum: - - PIX + const: PIX example: PIX pixKey: type: string @@ -4689,7 +4561,6 @@ components: example: '1234567890' PaymentPixAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/PixAccountInfo' IbanAccountInfo: type: object @@ -4699,9 +4570,7 @@ components: - swiftBic properties: accountType: - type: string - enum: - - IBAN + const: IBAN example: IBAN iban: type: string @@ -4717,7 +4586,6 @@ components: maxLength: 11 PaymentIbanAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/IbanAccountInfo' required: - reference @@ -4728,12 +4596,15 @@ components: example: UMA-Q12345-REF PaymentFboAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - type: object required: + - accountType - paymentUrl - paymentMethod properties: + accountType: + const: FBO + example: FBO paymentUrl: type: string format: uri @@ -4753,9 +4624,7 @@ components: - vpa properties: accountType: - type: string - enum: - - UPI + const: UPI example: UPI vpa: type: string @@ -4763,42 +4632,7 @@ components: example: somecustomers@okbank PaymentUpiAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/UpiAccountInfo' - NgnAccountInfo: - type: object - required: - - accountType - - accountNumber - - bankName - properties: - accountType: - type: string - enum: - - 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 - PaymentNgnAccountInfo: - allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - - $ref: '#/components/schemas/NgnAccountInfo' - 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: @@ -4806,9 +4640,7 @@ components: - address properties: accountType: - type: string - enum: - - SPARK_WALLET + const: SPARK_WALLET example: SPARK_WALLET address: type: string @@ -4816,7 +4648,6 @@ components: example: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu PaymentSparkWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/SparkWalletInfo' required: - assetType @@ -4832,16 +4663,13 @@ components: description: Invoice for the payment example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s PaymentLightningInvoiceInfo: - allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' + type: object required: - accountType - invoice properties: accountType: - type: string - enum: - - LIGHTNING + const: LIGHTNING example: LIGHTNING invoice: type: string @@ -4854,9 +4682,7 @@ components: - address properties: accountType: - type: string - enum: - - SOLANA_WALLET + const: SOLANA_WALLET example: SOLANA_WALLET address: type: string @@ -4864,7 +4690,6 @@ components: example: 4Nd1m6Qkq7RfKuE5vQ9qP9Tn6H94Ueqb4xXHzsAbd8Wg PaymentSolanaWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/SolanaWalletInfo' properties: assetType: @@ -4880,9 +4705,7 @@ components: - address properties: accountType: - type: string - enum: - - TRON_WALLET + const: TRON_WALLET example: TRON_WALLET address: type: string @@ -4890,14 +4713,12 @@ components: example: TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL PaymentTronWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/TronWalletInfo' properties: assetType: type: string description: Type of asset - enum: - - USDT + const: USDT PolygonWalletInfo: type: object required: @@ -4905,9 +4726,7 @@ components: - address properties: accountType: - type: string - enum: - - POLYGON_WALLET + const: POLYGON_WALLET example: POLYGON_WALLET address: type: string @@ -4915,49 +4734,12 @@ components: example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentPolygonWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/PolygonWalletInfo' properties: assetType: type: string description: Type of asset - enum: - - USDC - BankAccountOrWalletType: - type: string - enum: - - CLABE - - US_ACCOUNT - - PIX - - IBAN - - FBO - - UPI - - NGN_ACCOUNT - - SPARK_WALLET - - LIGHTNING - - SOLANA_WALLET - - TRON_WALLET - - POLYGON_WALLET - - BASE_WALLET - description: Type of account or wallet information - ClabeAccountInfo: - type: object - required: - - accountType - - clabeNumber - properties: - accountType: - type: string - enum: - - CLABE - example: CLABE - clabeNumber: - type: string - description: 18-digit CLABE number (Mexican banking standard) - example: '123456789012345678' - minLength: 18 - maxLength: 18 - pattern: ^[0-9]{18}$ + const: USDC BaseWalletInfo: type: object required: @@ -4965,9 +4747,7 @@ components: - address properties: accountType: - type: string - enum: - - BASE_WALLET + const: BASE_WALLET example: BASE_WALLET address: type: string @@ -4975,14 +4755,12 @@ components: example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentBaseWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/BaseWalletInfo' properties: assetType: type: string description: Type of asset - enum: - - USDC + const: USDC PaymentInstructions: type: object required: @@ -4992,6 +4770,10 @@ components: type: string description: Additional human-readable instructions for making the payment example: Please ensure the reference code is included in the payment memo/description field + isPlatformAccount: + type: boolean + description: Indicates whether the account is a platform account or a customer account. + example: true accountOrWalletInfo: oneOf: - title: CLABE Account @@ -5085,8 +4867,7 @@ components: properties: beneficiaryType: type: string - enum: - - INDIVIDUAL + const: INDIVIDUAL example: INDIVIDUAL fullName: type: string @@ -5111,8 +4892,7 @@ components: properties: beneficiaryType: type: string - enum: - - BUSINESS + const: BUSINESS example: BUSINESS legalName: type: string @@ -5137,9 +4917,7 @@ components: - beneficiary properties: accountType: - type: string - enum: - - US_ACCOUNT + const: US_ACCOUNT example: US_ACCOUNT beneficiary: oneOf: @@ -5158,9 +4936,7 @@ components: - accountType properties: accountType: - type: string - enum: - - CLABE + const: CLABE example: CLABE beneficiary: oneOf: @@ -5179,9 +4955,7 @@ components: - accountType properties: accountType: - type: string - enum: - - PIX + const: PIX example: PIX beneficiary: oneOf: @@ -5200,9 +4974,7 @@ components: - accountType properties: accountType: - type: string - enum: - - IBAN + const: IBAN example: IBAN beneficiary: oneOf: @@ -5221,9 +4993,7 @@ components: - accountType properties: accountType: - type: string - enum: - - UPI + const: UPI example: UPI beneficiary: oneOf: @@ -5234,6 +5004,27 @@ components: mapping: INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' BUSINESS: '#/components/schemas/BusinessBeneficiary' + NgnAccountInfo: + type: object + required: + - accountType + - accountNumber + - bankName + properties: + accountType: + 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 NgnAccountExternalAccountInfo: allOf: - $ref: '#/components/schemas/NgnAccountInfo' @@ -5244,9 +5035,7 @@ components: - beneficiary properties: accountType: - type: string - enum: - - NGN_ACCOUNT + const: NGN_ACCOUNT example: NGN_ACCOUNT beneficiary: oneOf: @@ -5282,49 +5071,28 @@ components: - accountType properties: accountType: - type: string - enum: - - SPARK_WALLET + const: SPARK_WALLET example: SPARK_WALLET LightningExternalAccountInfo: - allOf: - - type: object - required: - - accountType - properties: - accountType: - type: string - enum: - - LIGHTNING - example: LIGHTNING - - oneOf: - - title: Lightning Invoice - type: object - required: - - invoice - properties: - invoice: - type: string - description: 1-time use lightning bolt11 invoice payout destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - - title: Lightning - Bolt12 Offer - type: object - required: - - bolt12 - properties: - bolt12: - type: string - description: A bolt12 offer which can be reused as a payment destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - - title: Lightning Address - type: object - required: - - lightningAddress - properties: - 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 + type: object + required: + - accountType + properties: + accountType: + 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 SolanaWalletExternalAccountInfo: allOf: - $ref: '#/components/schemas/SolanaWalletInfo' @@ -5333,9 +5101,7 @@ components: - accountType properties: accountType: - type: string - enum: - - SOLANA_WALLET + const: SOLANA_WALLET example: SOLANA_WALLET TronWalletExternalAccountInfo: allOf: @@ -5345,9 +5111,7 @@ components: - accountType properties: accountType: - type: string - enum: - - TRON_WALLET + const: TRON_WALLET example: TRON_WALLET PolygonWalletExternalAccountInfo: allOf: @@ -5357,9 +5121,7 @@ components: - accountType properties: accountType: - type: string - enum: - - POLYGON_WALLET + const: POLYGON_WALLET example: POLYGON_WALLET BaseWalletExternalAccountInfo: allOf: @@ -5369,9 +5131,7 @@ components: - accountType properties: accountType: - type: string - enum: - - BASE_WALLET + const: BASE_WALLET example: BASE_WALLET ExternalAccountInfo: oneOf: @@ -5547,34 +5307,13 @@ components: $ref: '#/components/schemas/TransactionType' destination: oneOf: - - title: Account Destination - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR + - $ref: '#/components/schemas/AccountDestination' + - $ref: '#/components/schemas/UmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) @@ -5615,6 +5354,45 @@ components: mapping: INCOMING: '#/components/schemas/IncomingTransaction' OUTGOING: '#/components/schemas/OutgoingTransaction' + AccountSource: + type: object + required: + - sourceType + - accountId + - currency + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + currency: + type: string + description: Currency code for the source account + example: USD + description: Source account details + UmaAddressSource: + type: object + required: + - sourceType + - umaAddress + properties: + sourceType: + type: string + const: UMA_ADDRESS + description: Source type identifier + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + currency: + type: string + description: Currency code for the source + example: USD + description: UMA address source details ReconciliationInstructions: type: object required: @@ -5679,34 +5457,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' receivedAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount received in the recipient's currency @@ -5808,34 +5566,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' sentAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount sent in the sender's currency @@ -5866,15 +5604,6 @@ components: description: Payment instructions for executing the payment. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs refund: $ref: '#/components/schemas/Refund' description: The refund if transaction was refunded. @@ -5896,6 +5625,45 @@ components: - REFUNDED - EXPIRED description: Status of a payment transaction + AccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + UmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + description: UMA address destination details CurrencyPreference: type: object required: @@ -5951,8 +5719,7 @@ components: - code properties: status: - enum: - - 412 + const: 412 type: integer description: HTTP status code code: @@ -5961,14 +5728,14 @@ components: | Error Code | Description | |------------|-------------| | UNSUPPORTED_UMA_VERSION | Counterparty doesn't support the Grid UMA version | - enum: - - UNSUPPORTED_UMA_VERSION + const: UNSUPPORTED_UMA_VERSION message: type: string description: Error message details: type: object description: Additional error details + additionalProperties: true Error424: type: object required: @@ -5977,8 +5744,7 @@ components: - code properties: status: - enum: - - 424 + const: 424 type: integer description: HTTP status code code: @@ -6001,37 +5767,98 @@ components: details: type: object description: Additional error details + additionalProperties: true + QuoteAccountSource: + type: object + required: + - sourceType + - accountId + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + description: Source account details + QuoteRealtimeFundingSource: + type: object + required: + - sourceType + - currency + properties: + sourceType: + type: string + const: REALTIME_FUNDING + description: Source type identifier + customerId: + type: string + description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. + example: Customer:019542f5-b3e7-1d02-0000-000000000009 + currency: + type: string + description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: USD + description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). QuoteSource: + required: + - sourceType oneOf: - - title: Account - type: object - required: - - accountId - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Source account details - - title: Real-time funding + - $ref: '#/components/schemas/QuoteAccountSource' + - $ref: '#/components/schemas/QuoteRealtimeFundingSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountSource' + REALTIME_FUNDING: '#/components/schemas/QuoteRealtimeFundingSource' + QuoteAccountDestination: + type: object + required: + - destinationType + - accountId + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + QuoteUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + counterpartyInformation: type: object - required: - - currency - - customerId - properties: - customerId: - type: string - description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. - example: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). + description: Information about the recipient, as required by the platform in their configuration. + additionalProperties: true + example: + FULL_NAME: Jane Receiver + BIRTH_DATE: '1990-01-01' + NATIONALITY: FR + description: UMA address destination details Quote: type: object required: @@ -6076,43 +5903,16 @@ components: source: $ref: '#/components/schemas/QuoteSource' destination: + required: + - destinationType oneOf: - - title: Account Destination - type: object - required: - - accountId - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR - counterpartyInformation: - type: object - description: Information about the recipient, as required by the platform in their configuration. - additionalProperties: true - example: - FULL_NAME: Jane Receiver - BIRTH_DATE: '1990-01-01' - NATIONALITY: FR - description: UMA address destination details + - $ref: '#/components/schemas/QuoteAccountDestination' + - $ref: '#/components/schemas/QuoteUmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteUmaAddressDestination' sendingCurrency: $ref: '#/components/schemas/Currency' description: Currency for the sending amount @@ -6146,15 +5946,6 @@ components: description: Payment instructions for executing the payment. This is not required when using an internal account source. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs transactionId: type: string description: The ID of the transaction created from this quote. @@ -6166,6 +5957,59 @@ components: rateDetails: $ref: '#/components/schemas/OutgoingRateDetails' description: Details about the rate and fees for the transaction. + QuoteRequestAccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: Destination account details + QuoteRequestUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + - currency + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: UMA address destination details + QuoteRequestExternalAccountDetailsDestination: + type: object + required: + - destinationType + - externalAccountDetails + properties: + destinationType: + type: string + const: EXTERNAL_ACCOUNT_DETAILS + description: Destination type identifier + externalAccountDetails: + $ref: '#/components/schemas/ExternalAccountCreateRequest' + description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. QuoteLockSide: type: string enum: @@ -6191,43 +6035,17 @@ components: destination: oneOf: - title: Account - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: Destination account details + $ref: '#/components/schemas/QuoteRequestAccountDestination' - title: UMA Address - type: object - required: - - umaAddress - - currency - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: UMA address destination details + $ref: '#/components/schemas/QuoteRequestUmaAddressDestination' - title: External Account Details - type: object - required: - - externalAccountDetails - properties: - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. + $ref: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteRequestAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteRequestUmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' lockedCurrencySide: $ref: '#/components/schemas/QuoteLockSide' lockedCurrencyAmount: @@ -6273,6 +6091,18 @@ components: response_body: type: string description: The raw body content returned by the webhook endpoint in response to the request + BulkCustomerImportErrorEntry: + allOf: + - $ref: '#/components/schemas/GridError' + - type: object + description: Error information for a failed bulk import entry + required: + - correlationId + properties: + correlationId: + type: string + description: Platform customer ID or row number for the failed entry + example: biz456 BulkCustomerImportJob: type: object required: @@ -6321,17 +6151,7 @@ components: type: array description: Detailed error information for failed entries items: - type: object - required: - - correlationId - - error - properties: - correlationId: - type: string - description: Platform customer ID or row number for the failed entry - example: biz456 - error: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/BulkCustomerImportErrorEntry' completedAt: type: string format: date-time @@ -6403,8 +6223,7 @@ components: - code properties: status: - enum: - - 403 + const: 403 type: integer description: HTTP status code code: @@ -6427,6 +6246,7 @@ components: details: type: object description: Additional error details + additionalProperties: true UmaProvider: type: object properties: @@ -6619,8 +6439,7 @@ components: $ref: '#/components/schemas/UmaInvitation' type: type: string - enum: - - INVITATION_CLAIMED + const: INVITATION_CLAIMED description: Type of webhook event example: INVITATION_CLAIMED KycStatusWebhook: @@ -6646,7 +6465,7 @@ components: description: Information about the recipient, provided by the platform if requested in the webhook via `requestedReceiverCustomerInfoFields` and the payment is approved. IncomingPaymentWebhookForbiddenResponse: allOf: - - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/GridError' - type: object properties: reason: @@ -6655,7 +6474,7 @@ components: example: RESTRICTED_JURISDICTION IncomingPaymentWebhookUnprocessableResponse: allOf: - - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/GridError' - type: object properties: requiredFields: diff --git a/openapi.yaml b/openapi.yaml index c8ef1d7..fd90680 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -154,99 +154,7 @@ 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/CreateCustomerRequest' responses: '201': description: Customer created successfully @@ -486,43 +394,7 @@ paths: content: application/json: schema: - oneOf: - - title: Update Individual Customer - $ref: '#/components/schemas/IndividualCustomerUpdate' - - title: Update Business Customer - $ref: '#/components/schemas/BusinessCustomerUpdate' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' - BUSINESS: '#/components/schemas/BusinessCustomerUpdate' - examples: - individualUpdate: - summary: Update individual customer example - value: - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-15' - address: - line1: 456 Market St - city: San Francisco - state: CA - postalCode: '94103' - country: US - businessUpdate: - summary: Update business customer example - value: - customerType: BUSINESS - businessInfo: - legalName: New Tech Solutions LLC - registrationNumber: BRN-987654321 - taxId: EIN-123456789 - address: - line1: 100 Technology Parkway - city: Palo Alto - state: CA - postalCode: '94304' - country: US + $ref: '#/components/schemas/UpdateCustomerRequest' responses: '200': description: Customer updated successfully @@ -604,7 +476,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/GridError' '500': description: Internal service error content: @@ -999,9 +871,9 @@ paths: schema: type: object required: - - accounts + - data properties: - accounts: + data: type: array description: List of external accounts matching the filter criteria items: @@ -1649,47 +1521,6 @@ paths: application/json: schema: $ref: '#/components/schemas/QuoteRequest' - examples: - accountToAccount: - summary: Account to Account Transfer - value: - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 10000 - description: Transfer between accounts, either internal or external. - accountToUma: - summary: Account to UMA Address Transfer - value: - lookupId: LookupRequest:019542f5-b3e7-1d02-0000-000000000009 - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - umaAddress: $receiver@uma.domain.com - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 1000 - description: 'Payment for invoice #1234' - realTimeFundingToSparkWallet: - summary: Real-time funding to Spark Wallet as an on-ramp flow. Immediate execution. - value: - source: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: USD - destination: - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - lockedCurrencySide: RECEIVING - lockedCurrencyAmount: 10000 - immediatelyExecute: true - description: Bitcoin reward payout! responses: '201': description: | @@ -3887,6 +3718,17 @@ components: If the signature verification succeeds, the webhook is authentic. If not, it should be rejected. schemas: + AllErrors: + anyOf: + - $ref: '#/components/schemas/Error400' + - $ref: '#/components/schemas/Error401' + - $ref: '#/components/schemas/Error403' + - $ref: '#/components/schemas/Error404' + - $ref: '#/components/schemas/Error409' + - $ref: '#/components/schemas/Error412' + - $ref: '#/components/schemas/Error424' + - $ref: '#/components/schemas/Error500' + - $ref: '#/components/schemas/Error501' CustomerInfoFieldName: type: string enum: @@ -4044,8 +3886,7 @@ components: - code properties: status: - enum: - - 401 + const: 401 type: integer description: HTTP status code code: @@ -4064,6 +3905,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error500: type: object required: @@ -4072,8 +3914,7 @@ components: - code properties: status: - enum: - - 500 + const: 500 type: integer description: HTTP status code code: @@ -4092,6 +3933,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error400: type: object required: @@ -4100,8 +3942,7 @@ components: - code properties: status: - enum: - - 400 + const: 400 type: integer description: HTTP status code code: @@ -4170,6 +4011,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error501: type: object required: @@ -4178,8 +4020,7 @@ components: - code properties: status: - enum: - - 501 + const: 501 type: integer description: HTTP status code code: @@ -4198,6 +4039,7 @@ components: details: type: object description: Additional error details + additionalProperties: true CustomerType: type: string enum: @@ -4320,7 +4162,7 @@ components: phoneNumber: type: string description: Phone number of the individual in E.164 format - example: 5555555555 + example: '+5555555555' pattern: ^\+[1-9]\d{1,14}$ taxId: type: string @@ -4404,8 +4246,7 @@ components: properties: customerType: type: string - enum: - - INDIVIDUAL + const: INDIVIDUAL description: Customer type fullName: type: string @@ -4422,6 +4263,10 @@ components: example: US address: $ref: '#/components/schemas/Address' + platformCustomerId: + type: string + description: Platform-specific customer identifier + example: 9f84e0c2a72c4fa umaAddress: type: string description: | @@ -4436,8 +4281,7 @@ components: properties: customerType: type: string - enum: - - BUSINESS + const: BUSINESS description: Customer type umaAddress: type: string @@ -4464,6 +4308,25 @@ components: type: array items: $ref: '#/components/schemas/UltimateBeneficialOwner' + CreateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Error409: type: object required: @@ -4472,8 +4335,7 @@ components: - code properties: status: - enum: - - 409 + const: 409 type: integer description: HTTP status code code: @@ -4492,6 +4354,7 @@ components: details: type: object description: Additional error details + additionalProperties: true Error404: type: object required: @@ -4500,8 +4363,7 @@ components: - code properties: status: - enum: - - 404 + const: 404 type: integer description: HTTP status code code: @@ -4532,8 +4394,10 @@ components: details: type: object description: Additional error details - Error: + additionalProperties: true + GridError: type: object + title: GridError properties: code: type: string @@ -4544,6 +4408,26 @@ components: details: type: object description: Additional error details + additionalProperties: true + UpdateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Currency: type: object properties: @@ -4577,9 +4461,24 @@ components: example: 12550 currency: $ref: '#/components/schemas/Currency' + ClabeAccountInfo: + type: object + required: + - accountType + - clabeNumber + properties: + accountType: + 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/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/ClabeAccountInfo' required: - reference @@ -4588,28 +4487,6 @@ components: type: string description: Unique reference code that must be included with the payment to properly credit it example: UMA-Q12345-REF - PaymentAccountOrWalletInfo: - type: object - required: - - accountType - properties: - accountType: - $ref: '#/components/schemas/BankAccountOrWalletType' - discriminator: - propertyName: accountType - mapping: - CLABE: '#/components/schemas/PaymentClabeAccountInfo' - US_ACCOUNT: '#/components/schemas/PaymentUsAccountInfo' - PIX: '#/components/schemas/PaymentPixAccountInfo' - IBAN: '#/components/schemas/PaymentIbanAccountInfo' - FBO: '#/components/schemas/PaymentFboAccountInfo' - 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' UsAccountInfo: type: object required: @@ -4619,9 +4496,7 @@ components: - accountCategory properties: accountType: - type: string - enum: - - US_ACCOUNT + const: US_ACCOUNT example: US_ACCOUNT accountNumber: type: string @@ -4647,7 +4522,6 @@ components: example: Chase Bank PaymentUsAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/UsAccountInfo' required: - reference @@ -4665,9 +4539,7 @@ components: - taxId properties: accountType: - type: string - enum: - - PIX + const: PIX example: PIX pixKey: type: string @@ -4689,7 +4561,6 @@ components: example: '1234567890' PaymentPixAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/PixAccountInfo' IbanAccountInfo: type: object @@ -4699,9 +4570,7 @@ components: - swiftBic properties: accountType: - type: string - enum: - - IBAN + const: IBAN example: IBAN iban: type: string @@ -4717,7 +4586,6 @@ components: maxLength: 11 PaymentIbanAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/IbanAccountInfo' required: - reference @@ -4728,12 +4596,15 @@ components: example: UMA-Q12345-REF PaymentFboAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - type: object required: + - accountType - paymentUrl - paymentMethod properties: + accountType: + const: FBO + example: FBO paymentUrl: type: string format: uri @@ -4753,9 +4624,7 @@ components: - vpa properties: accountType: - type: string - enum: - - UPI + const: UPI example: UPI vpa: type: string @@ -4763,42 +4632,7 @@ components: example: somecustomers@okbank PaymentUpiAccountInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/UpiAccountInfo' - NgnAccountInfo: - type: object - required: - - accountType - - accountNumber - - bankName - properties: - accountType: - type: string - enum: - - 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 - PaymentNgnAccountInfo: - allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - - $ref: '#/components/schemas/NgnAccountInfo' - 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: @@ -4806,9 +4640,7 @@ components: - address properties: accountType: - type: string - enum: - - SPARK_WALLET + const: SPARK_WALLET example: SPARK_WALLET address: type: string @@ -4816,7 +4648,6 @@ components: example: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu PaymentSparkWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/SparkWalletInfo' required: - assetType @@ -4832,16 +4663,13 @@ components: description: Invoice for the payment example: sparkrt1pgss8ter0fhc4c220f3zftmpz49h8wqte8eg3m5zkrraplgc048jucgszg3ssqgjzqqekv73mmh842yj7drsjwh7t7tz5zt8wf5kghm5v4ehggszppjp5s80cg3qjdzc55g2567tn3lj705hdsr577tg8ah795mlnt6807y657qhkmgfkf9w75p4wz3l8vhua85zdn6ryj32zuj0p00pv2l5z4u47mw6h4s PaymentLightningInvoiceInfo: - allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' + type: object required: - accountType - invoice properties: accountType: - type: string - enum: - - LIGHTNING + const: LIGHTNING example: LIGHTNING invoice: type: string @@ -4854,9 +4682,7 @@ components: - address properties: accountType: - type: string - enum: - - SOLANA_WALLET + const: SOLANA_WALLET example: SOLANA_WALLET address: type: string @@ -4864,7 +4690,6 @@ components: example: 4Nd1m6Qkq7RfKuE5vQ9qP9Tn6H94Ueqb4xXHzsAbd8Wg PaymentSolanaWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/SolanaWalletInfo' properties: assetType: @@ -4880,9 +4705,7 @@ components: - address properties: accountType: - type: string - enum: - - TRON_WALLET + const: TRON_WALLET example: TRON_WALLET address: type: string @@ -4890,14 +4713,12 @@ components: example: TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL PaymentTronWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/TronWalletInfo' properties: assetType: type: string description: Type of asset - enum: - - USDT + const: USDT PolygonWalletInfo: type: object required: @@ -4905,9 +4726,7 @@ components: - address properties: accountType: - type: string - enum: - - POLYGON_WALLET + const: POLYGON_WALLET example: POLYGON_WALLET address: type: string @@ -4915,49 +4734,12 @@ components: example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentPolygonWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/PolygonWalletInfo' properties: assetType: type: string description: Type of asset - enum: - - USDC - BankAccountOrWalletType: - type: string - enum: - - CLABE - - US_ACCOUNT - - PIX - - IBAN - - FBO - - UPI - - NGN_ACCOUNT - - SPARK_WALLET - - LIGHTNING - - SOLANA_WALLET - - TRON_WALLET - - POLYGON_WALLET - - BASE_WALLET - description: Type of account or wallet information - ClabeAccountInfo: - type: object - required: - - accountType - - clabeNumber - properties: - accountType: - type: string - enum: - - CLABE - example: CLABE - clabeNumber: - type: string - description: 18-digit CLABE number (Mexican banking standard) - example: '123456789012345678' - minLength: 18 - maxLength: 18 - pattern: ^[0-9]{18}$ + const: USDC BaseWalletInfo: type: object required: @@ -4965,9 +4747,7 @@ components: - address properties: accountType: - type: string - enum: - - BASE_WALLET + const: BASE_WALLET example: BASE_WALLET address: type: string @@ -4975,14 +4755,12 @@ components: example: '0xAbCDEF1234567890aBCdEf1234567890ABcDef12' PaymentBaseWalletInfo: allOf: - - $ref: '#/components/schemas/PaymentAccountOrWalletInfo' - $ref: '#/components/schemas/BaseWalletInfo' properties: assetType: type: string description: Type of asset - enum: - - USDC + const: USDC PaymentInstructions: type: object required: @@ -4992,6 +4770,10 @@ components: type: string description: Additional human-readable instructions for making the payment example: Please ensure the reference code is included in the payment memo/description field + isPlatformAccount: + type: boolean + description: Indicates whether the account is a platform account or a customer account. + example: true accountOrWalletInfo: oneOf: - title: CLABE Account @@ -5085,8 +4867,7 @@ components: properties: beneficiaryType: type: string - enum: - - INDIVIDUAL + const: INDIVIDUAL example: INDIVIDUAL fullName: type: string @@ -5111,8 +4892,7 @@ components: properties: beneficiaryType: type: string - enum: - - BUSINESS + const: BUSINESS example: BUSINESS legalName: type: string @@ -5137,9 +4917,7 @@ components: - beneficiary properties: accountType: - type: string - enum: - - US_ACCOUNT + const: US_ACCOUNT example: US_ACCOUNT beneficiary: oneOf: @@ -5158,9 +4936,7 @@ components: - accountType properties: accountType: - type: string - enum: - - CLABE + const: CLABE example: CLABE beneficiary: oneOf: @@ -5179,9 +4955,7 @@ components: - accountType properties: accountType: - type: string - enum: - - PIX + const: PIX example: PIX beneficiary: oneOf: @@ -5200,9 +4974,7 @@ components: - accountType properties: accountType: - type: string - enum: - - IBAN + const: IBAN example: IBAN beneficiary: oneOf: @@ -5221,9 +4993,7 @@ components: - accountType properties: accountType: - type: string - enum: - - UPI + const: UPI example: UPI beneficiary: oneOf: @@ -5234,6 +5004,27 @@ components: mapping: INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' BUSINESS: '#/components/schemas/BusinessBeneficiary' + NgnAccountInfo: + type: object + required: + - accountType + - accountNumber + - bankName + properties: + accountType: + 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 NgnAccountExternalAccountInfo: allOf: - $ref: '#/components/schemas/NgnAccountInfo' @@ -5244,9 +5035,7 @@ components: - beneficiary properties: accountType: - type: string - enum: - - NGN_ACCOUNT + const: NGN_ACCOUNT example: NGN_ACCOUNT beneficiary: oneOf: @@ -5282,49 +5071,28 @@ components: - accountType properties: accountType: - type: string - enum: - - SPARK_WALLET + const: SPARK_WALLET example: SPARK_WALLET LightningExternalAccountInfo: - allOf: - - type: object - required: - - accountType - properties: - accountType: - type: string - enum: - - LIGHTNING - example: LIGHTNING - - oneOf: - - title: Lightning Invoice - type: object - required: - - invoice - properties: - invoice: - type: string - description: 1-time use lightning bolt11 invoice payout destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - - title: Lightning - Bolt12 Offer - type: object - required: - - bolt12 - properties: - bolt12: - type: string - description: A bolt12 offer which can be reused as a payment destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - - title: Lightning Address - type: object - required: - - lightningAddress - properties: - 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 + type: object + required: + - accountType + properties: + accountType: + 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 SolanaWalletExternalAccountInfo: allOf: - $ref: '#/components/schemas/SolanaWalletInfo' @@ -5333,9 +5101,7 @@ components: - accountType properties: accountType: - type: string - enum: - - SOLANA_WALLET + const: SOLANA_WALLET example: SOLANA_WALLET TronWalletExternalAccountInfo: allOf: @@ -5345,9 +5111,7 @@ components: - accountType properties: accountType: - type: string - enum: - - TRON_WALLET + const: TRON_WALLET example: TRON_WALLET PolygonWalletExternalAccountInfo: allOf: @@ -5357,9 +5121,7 @@ components: - accountType properties: accountType: - type: string - enum: - - POLYGON_WALLET + const: POLYGON_WALLET example: POLYGON_WALLET BaseWalletExternalAccountInfo: allOf: @@ -5369,9 +5131,7 @@ components: - accountType properties: accountType: - type: string - enum: - - BASE_WALLET + const: BASE_WALLET example: BASE_WALLET ExternalAccountInfo: oneOf: @@ -5547,34 +5307,13 @@ components: $ref: '#/components/schemas/TransactionType' destination: oneOf: - - title: Account Destination - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR + - $ref: '#/components/schemas/AccountDestination' + - $ref: '#/components/schemas/UmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/AccountDestination' + UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) @@ -5615,6 +5354,45 @@ components: mapping: INCOMING: '#/components/schemas/IncomingTransaction' OUTGOING: '#/components/schemas/OutgoingTransaction' + AccountSource: + type: object + required: + - sourceType + - accountId + - currency + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + currency: + type: string + description: Currency code for the source account + example: USD + description: Source account details + UmaAddressSource: + type: object + required: + - sourceType + - umaAddress + properties: + sourceType: + type: string + const: UMA_ADDRESS + description: Source type identifier + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + currency: + type: string + description: Currency code for the source + example: USD + description: UMA address source details ReconciliationInstructions: type: object required: @@ -5679,34 +5457,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' receivedAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount received in the recipient's currency @@ -5808,34 +5566,14 @@ components: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: '#/components/schemas/AccountSource' - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: '#/components/schemas/UmaAddressSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/AccountSource' + UMA_ADDRESS: '#/components/schemas/UmaAddressSource' sentAmount: $ref: '#/components/schemas/CurrencyAmount' description: Amount sent in the sender's currency @@ -5866,15 +5604,6 @@ components: description: Payment instructions for executing the payment. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs refund: $ref: '#/components/schemas/Refund' description: The refund if transaction was refunded. @@ -5896,6 +5625,45 @@ components: - REFUNDED - EXPIRED description: Status of a payment transaction + AccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + UmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + description: UMA address destination details CurrencyPreference: type: object required: @@ -5951,8 +5719,7 @@ components: - code properties: status: - enum: - - 412 + const: 412 type: integer description: HTTP status code code: @@ -5961,14 +5728,14 @@ components: | Error Code | Description | |------------|-------------| | UNSUPPORTED_UMA_VERSION | Counterparty doesn't support the Grid UMA version | - enum: - - UNSUPPORTED_UMA_VERSION + const: UNSUPPORTED_UMA_VERSION message: type: string description: Error message details: type: object description: Additional error details + additionalProperties: true Error424: type: object required: @@ -5977,8 +5744,7 @@ components: - code properties: status: - enum: - - 424 + const: 424 type: integer description: HTTP status code code: @@ -6001,37 +5767,98 @@ components: details: type: object description: Additional error details + additionalProperties: true + QuoteAccountSource: + type: object + required: + - sourceType + - accountId + properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + description: Source account details + QuoteRealtimeFundingSource: + type: object + required: + - sourceType + - currency + properties: + sourceType: + type: string + const: REALTIME_FUNDING + description: Source type identifier + customerId: + type: string + description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. + example: Customer:019542f5-b3e7-1d02-0000-000000000009 + currency: + type: string + description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: USD + description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). QuoteSource: + required: + - sourceType oneOf: - - title: Account - type: object - required: - - accountId - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Source account details - - title: Real-time funding + - $ref: '#/components/schemas/QuoteAccountSource' + - $ref: '#/components/schemas/QuoteRealtimeFundingSource' + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountSource' + REALTIME_FUNDING: '#/components/schemas/QuoteRealtimeFundingSource' + QuoteAccountDestination: + type: object + required: + - destinationType + - accountId + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR + description: Destination account details + QuoteUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + counterpartyInformation: type: object - required: - - currency - - customerId - properties: - customerId: - type: string - description: Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. If customerId is not provided, the quote will be created on behalf of the platform itself. - example: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: - type: string - description: Currency code for the funding source. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: USD - description: Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). This will require manual just-in-time funding using `paymentInstructions` in the response. Because quotes expire quickly, this option is only valid for instant payment methods. Do not try to fund a quote with a non-instant payment method (ACH, etc.). + description: Information about the recipient, as required by the platform in their configuration. + additionalProperties: true + example: + FULL_NAME: Jane Receiver + BIRTH_DATE: '1990-01-01' + NATIONALITY: FR + description: UMA address destination details Quote: type: object required: @@ -6076,43 +5903,16 @@ components: source: $ref: '#/components/schemas/QuoteSource' destination: + required: + - destinationType oneOf: - - title: Account Destination - type: object - required: - - accountId - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR - counterpartyInformation: - type: object - description: Information about the recipient, as required by the platform in their configuration. - additionalProperties: true - example: - FULL_NAME: Jane Receiver - BIRTH_DATE: '1990-01-01' - NATIONALITY: FR - description: UMA address destination details + - $ref: '#/components/schemas/QuoteAccountDestination' + - $ref: '#/components/schemas/QuoteUmaAddressDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteUmaAddressDestination' sendingCurrency: $ref: '#/components/schemas/Currency' description: Currency for the sending amount @@ -6146,15 +5946,6 @@ components: description: Payment instructions for executing the payment. This is not required when using an internal account source. items: $ref: '#/components/schemas/PaymentInstructions' - example: - - accountType: US_ACCOUNT - accountNumber: '1234567890' - routingNumber: '021000021' - bankName: Chase Bank - referenceCode: REF123456 - - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - invoice: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs transactionId: type: string description: The ID of the transaction created from this quote. @@ -6166,6 +5957,59 @@ components: rateDetails: $ref: '#/components/schemas/OutgoingRateDetails' description: Details about the rate and fees for the transaction. + QuoteRequestAccountDestination: + type: object + required: + - destinationType + - accountId + - currency + properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: Destination account details + QuoteRequestUmaAddressDestination: + type: object + required: + - destinationType + - umaAddress + - currency + properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. + example: EUR + description: UMA address destination details + QuoteRequestExternalAccountDetailsDestination: + type: object + required: + - destinationType + - externalAccountDetails + properties: + destinationType: + type: string + const: EXTERNAL_ACCOUNT_DETAILS + description: Destination type identifier + externalAccountDetails: + $ref: '#/components/schemas/ExternalAccountCreateRequest' + description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. QuoteLockSide: type: string enum: @@ -6191,43 +6035,17 @@ components: destination: oneOf: - title: Account - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: Destination account details + $ref: '#/components/schemas/QuoteRequestAccountDestination' - title: UMA Address - type: object - required: - - umaAddress - - currency - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. - example: EUR - description: UMA address destination details + $ref: '#/components/schemas/QuoteRequestUmaAddressDestination' - title: External Account Details - type: object - required: - - externalAccountDetails - properties: - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the external accounts endpoints for test values in sandbox mode. + $ref: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: '#/components/schemas/QuoteRequestAccountDestination' + UMA_ADDRESS: '#/components/schemas/QuoteRequestUmaAddressDestination' + EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/QuoteRequestExternalAccountDetailsDestination' lockedCurrencySide: $ref: '#/components/schemas/QuoteLockSide' lockedCurrencyAmount: @@ -6273,6 +6091,18 @@ components: response_body: type: string description: The raw body content returned by the webhook endpoint in response to the request + BulkCustomerImportErrorEntry: + allOf: + - $ref: '#/components/schemas/GridError' + - type: object + description: Error information for a failed bulk import entry + required: + - correlationId + properties: + correlationId: + type: string + description: Platform customer ID or row number for the failed entry + example: biz456 BulkCustomerImportJob: type: object required: @@ -6321,17 +6151,7 @@ components: type: array description: Detailed error information for failed entries items: - type: object - required: - - correlationId - - error - properties: - correlationId: - type: string - description: Platform customer ID or row number for the failed entry - example: biz456 - error: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/BulkCustomerImportErrorEntry' completedAt: type: string format: date-time @@ -6403,8 +6223,7 @@ components: - code properties: status: - enum: - - 403 + const: 403 type: integer description: HTTP status code code: @@ -6427,6 +6246,7 @@ components: details: type: object description: Additional error details + additionalProperties: true UmaProvider: type: object properties: @@ -6619,8 +6439,7 @@ components: $ref: '#/components/schemas/UmaInvitation' type: type: string - enum: - - INVITATION_CLAIMED + const: INVITATION_CLAIMED description: Type of webhook event example: INVITATION_CLAIMED KycStatusWebhook: @@ -6646,7 +6465,7 @@ components: description: Information about the recipient, provided by the platform if requested in the webhook via `requestedReceiverCustomerInfoFields` and the payment is approved. IncomingPaymentWebhookForbiddenResponse: allOf: - - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/GridError' - type: object properties: reason: @@ -6655,7 +6474,7 @@ components: example: RESTRICTED_JURISDICTION IncomingPaymentWebhookUnprocessableResponse: allOf: - - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/GridError' - type: object properties: requiredFields: diff --git a/openapi/components/schemas/common/BaseWalletInfo.yaml b/openapi/components/schemas/common/BaseWalletInfo.yaml index 8b0b2ec..e1935ea 100644 --- a/openapi/components/schemas/common/BaseWalletInfo.yaml +++ b/openapi/components/schemas/common/BaseWalletInfo.yaml @@ -4,8 +4,7 @@ required: - address properties: accountType: - type: string - enum: [BASE_WALLET] + const: BASE_WALLET example: BASE_WALLET address: type: string diff --git a/openapi/components/schemas/common/ClabeAccountInfo.yaml b/openapi/components/schemas/common/ClabeAccountInfo.yaml index 614eb48..42d31a2 100644 --- a/openapi/components/schemas/common/ClabeAccountInfo.yaml +++ b/openapi/components/schemas/common/ClabeAccountInfo.yaml @@ -4,8 +4,7 @@ required: - clabeNumber properties: accountType: - type: string - enum: [CLABE] + const: CLABE example: CLABE clabeNumber: type: string diff --git a/openapi/components/schemas/common/FboAccountInfo.yaml b/openapi/components/schemas/common/FboAccountInfo.yaml index 7152d82..6f5925f 100644 --- a/openapi/components/schemas/common/FboAccountInfo.yaml +++ b/openapi/components/schemas/common/FboAccountInfo.yaml @@ -4,8 +4,7 @@ required: - currencyCode properties: accountType: - type: string - enum: [FBO] + const: FBO example: FBO currencyCode: type: string diff --git a/openapi/components/schemas/common/Error.yaml b/openapi/components/schemas/common/GridError.yaml similarity index 81% rename from openapi/components/schemas/common/Error.yaml rename to openapi/components/schemas/common/GridError.yaml index b0eb270..4f956b6 100644 --- a/openapi/components/schemas/common/Error.yaml +++ b/openapi/components/schemas/common/GridError.yaml @@ -1,4 +1,5 @@ type: object +title: GridError properties: code: type: string @@ -9,3 +10,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/common/IbanAccountInfo.yaml b/openapi/components/schemas/common/IbanAccountInfo.yaml index ed03513..a4eaab0 100644 --- a/openapi/components/schemas/common/IbanAccountInfo.yaml +++ b/openapi/components/schemas/common/IbanAccountInfo.yaml @@ -5,8 +5,7 @@ required: - swiftBic properties: accountType: - type: string - enum: [IBAN] + const: IBAN example: IBAN iban: type: string diff --git a/openapi/components/schemas/common/NgnAccountInfo.yaml b/openapi/components/schemas/common/NgnAccountInfo.yaml index 3c69767..de6f39d 100644 --- a/openapi/components/schemas/common/NgnAccountInfo.yaml +++ b/openapi/components/schemas/common/NgnAccountInfo.yaml @@ -5,8 +5,7 @@ required: - bankName properties: accountType: - type: string - enum: [NGN_ACCOUNT] + const: NGN_ACCOUNT example: NGN_ACCOUNT accountNumber: type: string diff --git a/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml b/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml index e422dbb..422cddb 100644 --- a/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentBaseWalletInfo.yaml @@ -1,9 +1,7 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./BaseWalletInfo.yaml properties: assetType: type: string description: Type of asset - enum: - - USDC \ No newline at end of file + const: USDC \ No newline at end of file diff --git a/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml b/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml index f43faba..0b19558 100644 --- a/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentClabeAccountInfo.yaml @@ -1,5 +1,4 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./ClabeAccountInfo.yaml required: - reference diff --git a/openapi/components/schemas/common/PaymentFboAccountInfo.yaml b/openapi/components/schemas/common/PaymentFboAccountInfo.yaml index 4aa9a2a..5597556 100644 --- a/openapi/components/schemas/common/PaymentFboAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentFboAccountInfo.yaml @@ -1,10 +1,13 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - type: object required: + - accountType - paymentUrl - paymentMethod properties: + accountType: + const: FBO + example: FBO paymentUrl: type: string format: uri diff --git a/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml b/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml index 81c8fe7..76315f5 100644 --- a/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentIbanAccountInfo.yaml @@ -1,5 +1,4 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./IbanAccountInfo.yaml required: - reference diff --git a/openapi/components/schemas/common/PaymentInstructions.yaml b/openapi/components/schemas/common/PaymentInstructions.yaml index 33d2181..791174d 100644 --- a/openapi/components/schemas/common/PaymentInstructions.yaml +++ b/openapi/components/schemas/common/PaymentInstructions.yaml @@ -8,6 +8,10 @@ properties: example: >- Please ensure the reference code is included in the payment memo/description field + isPlatformAccount: + type: boolean + description: Indicates whether the account is a platform account or a customer account. + example: true accountOrWalletInfo: oneOf: - title: CLABE Account diff --git a/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml b/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml index f3998ec..a18bb24 100644 --- a/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml +++ b/openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml @@ -1,12 +1,10 @@ -allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml +type: object required: - accountType - invoice properties: accountType: - type: string - enum: [LIGHTNING] + const: LIGHTNING example: LIGHTNING invoice: type: string diff --git a/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml b/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml index 5cbe02b..587f52a 100644 --- a/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentNgnAccountInfo.yaml @@ -1,5 +1,4 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./NgnAccountInfo.yaml required: - reference diff --git a/openapi/components/schemas/common/PaymentPixAccountInfo.yaml b/openapi/components/schemas/common/PaymentPixAccountInfo.yaml index 24c3262..a586649 100644 --- a/openapi/components/schemas/common/PaymentPixAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentPixAccountInfo.yaml @@ -1,3 +1,2 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./PixAccountInfo.yaml diff --git a/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml b/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml index 059424e..1bd4efa 100644 --- a/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml @@ -1,9 +1,7 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./PolygonWalletInfo.yaml properties: assetType: type: string description: Type of asset - enum: - - USDC \ No newline at end of file + const: USDC \ No newline at end of file diff --git a/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml b/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml index a344b2a..bc9e7f8 100644 --- a/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentSolanaWalletInfo.yaml @@ -1,5 +1,4 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./SolanaWalletInfo.yaml properties: assetType: diff --git a/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml b/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml index 7933ff4..2b0cbe6 100644 --- a/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentSparkWalletInfo.yaml @@ -1,5 +1,4 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./SparkWalletInfo.yaml required: - assetType diff --git a/openapi/components/schemas/common/PaymentTronWalletInfo.yaml b/openapi/components/schemas/common/PaymentTronWalletInfo.yaml index 60ede12..4aa2cc9 100644 --- a/openapi/components/schemas/common/PaymentTronWalletInfo.yaml +++ b/openapi/components/schemas/common/PaymentTronWalletInfo.yaml @@ -1,9 +1,7 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./TronWalletInfo.yaml properties: assetType: type: string description: Type of asset - enum: - - USDT \ No newline at end of file + const: USDT \ No newline at end of file diff --git a/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml b/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml index 6f03983..0dc0366 100644 --- a/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentUpiAccountInfo.yaml @@ -1,3 +1,2 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./UpiAccountInfo.yaml diff --git a/openapi/components/schemas/common/PaymentUsAccountInfo.yaml b/openapi/components/schemas/common/PaymentUsAccountInfo.yaml index 738d09b..c03cbce 100644 --- a/openapi/components/schemas/common/PaymentUsAccountInfo.yaml +++ b/openapi/components/schemas/common/PaymentUsAccountInfo.yaml @@ -1,5 +1,4 @@ allOf: - - $ref: ./PaymentAccountOrWalletInfo.yaml - $ref: ./UsAccountInfo.yaml required: - reference diff --git a/openapi/components/schemas/common/PixAccountInfo.yaml b/openapi/components/schemas/common/PixAccountInfo.yaml index 2bc15d0..7225c75 100644 --- a/openapi/components/schemas/common/PixAccountInfo.yaml +++ b/openapi/components/schemas/common/PixAccountInfo.yaml @@ -6,8 +6,7 @@ required: - taxId properties: accountType: - type: string - enum: [PIX] + const: PIX example: PIX pixKey: type: string diff --git a/openapi/components/schemas/common/PolygonWalletInfo.yaml b/openapi/components/schemas/common/PolygonWalletInfo.yaml index 5542aa4..050c876 100644 --- a/openapi/components/schemas/common/PolygonWalletInfo.yaml +++ b/openapi/components/schemas/common/PolygonWalletInfo.yaml @@ -4,8 +4,7 @@ required: - address properties: accountType: - type: string - enum: [POLYGON_WALLET] + const: POLYGON_WALLET example: POLYGON_WALLET address: type: string diff --git a/openapi/components/schemas/common/SolanaWalletInfo.yaml b/openapi/components/schemas/common/SolanaWalletInfo.yaml index 352b350..727c36b 100644 --- a/openapi/components/schemas/common/SolanaWalletInfo.yaml +++ b/openapi/components/schemas/common/SolanaWalletInfo.yaml @@ -4,8 +4,7 @@ required: - address properties: accountType: - type: string - enum: [SOLANA_WALLET] + const: SOLANA_WALLET example: SOLANA_WALLET address: type: string diff --git a/openapi/components/schemas/common/SparkWalletInfo.yaml b/openapi/components/schemas/common/SparkWalletInfo.yaml index f1a33d6..713c453 100644 --- a/openapi/components/schemas/common/SparkWalletInfo.yaml +++ b/openapi/components/schemas/common/SparkWalletInfo.yaml @@ -4,8 +4,7 @@ required: - address properties: accountType: - type: string - enum: [SPARK_WALLET] + const: SPARK_WALLET example: SPARK_WALLET address: type: string diff --git a/openapi/components/schemas/common/TronWalletInfo.yaml b/openapi/components/schemas/common/TronWalletInfo.yaml index e2965b8..05fe9ce 100644 --- a/openapi/components/schemas/common/TronWalletInfo.yaml +++ b/openapi/components/schemas/common/TronWalletInfo.yaml @@ -4,8 +4,7 @@ required: - address properties: accountType: - type: string - enum: [TRON_WALLET] + const: TRON_WALLET example: TRON_WALLET address: type: string diff --git a/openapi/components/schemas/common/UpiAccountInfo.yaml b/openapi/components/schemas/common/UpiAccountInfo.yaml index 6c5136c..7a074cb 100644 --- a/openapi/components/schemas/common/UpiAccountInfo.yaml +++ b/openapi/components/schemas/common/UpiAccountInfo.yaml @@ -4,8 +4,7 @@ required: - vpa properties: accountType: - type: string - enum: [UPI] + const: UPI example: UPI vpa: type: string diff --git a/openapi/components/schemas/common/UsAccountInfo.yaml b/openapi/components/schemas/common/UsAccountInfo.yaml index ecc1e50..3fb9704 100644 --- a/openapi/components/schemas/common/UsAccountInfo.yaml +++ b/openapi/components/schemas/common/UsAccountInfo.yaml @@ -6,8 +6,7 @@ required: - accountCategory properties: accountType: - type: string - enum: [US_ACCOUNT] + const: US_ACCOUNT example: US_ACCOUNT accountNumber: type: string diff --git a/openapi/components/schemas/customers/BulkCustomerImportErrorEntry.yaml b/openapi/components/schemas/customers/BulkCustomerImportErrorEntry.yaml new file mode 100644 index 0000000..79bfb0b --- /dev/null +++ b/openapi/components/schemas/customers/BulkCustomerImportErrorEntry.yaml @@ -0,0 +1,11 @@ +allOf: + - $ref: ../common/GridError.yaml + - type: object + description: Error information for a failed bulk import entry + required: + - correlationId + properties: + correlationId: + type: string + description: Platform customer ID or row number for the failed entry + example: biz456 diff --git a/openapi/components/schemas/customers/BulkCustomerImportJob.yaml b/openapi/components/schemas/customers/BulkCustomerImportJob.yaml index a550d9c..1c74dc1 100644 --- a/openapi/components/schemas/customers/BulkCustomerImportJob.yaml +++ b/openapi/components/schemas/customers/BulkCustomerImportJob.yaml @@ -45,17 +45,7 @@ properties: type: array description: Detailed error information for failed entries items: - type: object - required: - - correlationId - - error - properties: - correlationId: - type: string - description: Platform customer ID or row number for the failed entry - example: biz456 - error: - $ref: ../common/Error.yaml + $ref: BulkCustomerImportErrorEntry.yaml completedAt: type: string format: date-time diff --git a/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml b/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml index b146b34..70f8b6d 100644 --- a/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml +++ b/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml @@ -4,7 +4,7 @@ required: properties: customerType: type: string - enum: [BUSINESS] + const: BUSINESS description: Customer type umaAddress: type: string diff --git a/openapi/components/schemas/customers/CreateCustomerRequest.yaml b/openapi/components/schemas/customers/CreateCustomerRequest.yaml new file mode 100644 index 0000000..3b996ef --- /dev/null +++ b/openapi/components/schemas/customers/CreateCustomerRequest.yaml @@ -0,0 +1,18 @@ +type: object +required: + - customerType +properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator +oneOf: + - $ref: ./IndividualCustomerUpdate.yaml + - $ref: ./BusinessCustomerUpdate.yaml +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerUpdate.yaml + BUSINESS: ./BusinessCustomerUpdate.yaml diff --git a/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml b/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml index 2a095cb..bfbce7e 100644 --- a/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml +++ b/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml @@ -4,7 +4,7 @@ required: properties: customerType: type: string - enum: [INDIVIDUAL] + const: INDIVIDUAL description: Customer type fullName: type: string @@ -21,6 +21,10 @@ properties: example: US address: $ref: ../common/Address.yaml + platformCustomerId: + type: string + description: Platform-specific customer identifier + example: 9f84e0c2a72c4fa umaAddress: type: string description: | diff --git a/openapi/components/schemas/customers/UltimateBeneficialOwner.yaml b/openapi/components/schemas/customers/UltimateBeneficialOwner.yaml index 388a3c3..4cee1fe 100644 --- a/openapi/components/schemas/customers/UltimateBeneficialOwner.yaml +++ b/openapi/components/schemas/customers/UltimateBeneficialOwner.yaml @@ -15,7 +15,7 @@ properties: phoneNumber: type: string description: Phone number of the individual in E.164 format - example: +5555555555 + example: '+5555555555' pattern: '^\+[1-9]\d{1,14}$' taxId: type: string diff --git a/openapi/components/schemas/customers/UpdateCustomerRequest.yaml b/openapi/components/schemas/customers/UpdateCustomerRequest.yaml new file mode 100644 index 0000000..3b996ef --- /dev/null +++ b/openapi/components/schemas/customers/UpdateCustomerRequest.yaml @@ -0,0 +1,18 @@ +type: object +required: + - customerType +properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator +oneOf: + - $ref: ./IndividualCustomerUpdate.yaml + - $ref: ./BusinessCustomerUpdate.yaml +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerUpdate.yaml + BUSINESS: ./BusinessCustomerUpdate.yaml diff --git a/openapi/components/schemas/errors/Error400.yaml b/openapi/components/schemas/errors/Error400.yaml index 960e8ce..25ea279 100644 --- a/openapi/components/schemas/errors/Error400.yaml +++ b/openapi/components/schemas/errors/Error400.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 400 + const: 400 type: integer description: HTTP status code code: @@ -75,3 +74,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error401.yaml b/openapi/components/schemas/errors/Error401.yaml index a7499ae..04d653a 100644 --- a/openapi/components/schemas/errors/Error401.yaml +++ b/openapi/components/schemas/errors/Error401.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 401 + const: 401 type: integer description: HTTP status code code: @@ -25,3 +24,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error403.yaml b/openapi/components/schemas/errors/Error403.yaml index b9e6524..e93a32b 100644 --- a/openapi/components/schemas/errors/Error403.yaml +++ b/openapi/components/schemas/errors/Error403.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 403 + const: 403 type: integer description: HTTP status code code: @@ -29,3 +28,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error404.yaml b/openapi/components/schemas/errors/Error404.yaml index 4b3f19a..4c53ac3 100644 --- a/openapi/components/schemas/errors/Error404.yaml +++ b/openapi/components/schemas/errors/Error404.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 404 + const: 404 type: integer description: HTTP status code code: @@ -37,3 +36,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error409.yaml b/openapi/components/schemas/errors/Error409.yaml index 5624f0b..4bcefbc 100644 --- a/openapi/components/schemas/errors/Error409.yaml +++ b/openapi/components/schemas/errors/Error409.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 409 + const: 409 type: integer description: HTTP status code code: @@ -25,3 +24,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error412.yaml b/openapi/components/schemas/errors/Error412.yaml index 9d199db..4dd24c3 100644 --- a/openapi/components/schemas/errors/Error412.yaml +++ b/openapi/components/schemas/errors/Error412.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 412 + const: 412 type: integer description: HTTP status code code: @@ -15,11 +14,11 @@ properties: | Error Code | Description | |------------|-------------| | UNSUPPORTED_UMA_VERSION | Counterparty doesn't support the Grid UMA version | - enum: - - UNSUPPORTED_UMA_VERSION + const: UNSUPPORTED_UMA_VERSION message: type: string description: Error message details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error424.yaml b/openapi/components/schemas/errors/Error424.yaml index d95d3b3..e546848 100644 --- a/openapi/components/schemas/errors/Error424.yaml +++ b/openapi/components/schemas/errors/Error424.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 424 + const: 424 type: integer description: HTTP status code code: @@ -29,3 +28,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error500.yaml b/openapi/components/schemas/errors/Error500.yaml index 2546020..0fd1023 100644 --- a/openapi/components/schemas/errors/Error500.yaml +++ b/openapi/components/schemas/errors/Error500.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 500 + const: 500 type: integer description: HTTP status code code: @@ -25,3 +24,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/errors/Error501.yaml b/openapi/components/schemas/errors/Error501.yaml index 4db1fbb..c467f08 100644 --- a/openapi/components/schemas/errors/Error501.yaml +++ b/openapi/components/schemas/errors/Error501.yaml @@ -5,8 +5,7 @@ required: - code properties: status: - enum: - - 501 + const: 501 type: integer description: HTTP status code code: @@ -25,3 +24,4 @@ properties: details: type: object description: Additional error details + additionalProperties: true diff --git a/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml index bc44159..ceb26ba 100644 --- a/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/BaseWalletExternalAccountInfo.yaml @@ -5,6 +5,5 @@ allOf: - accountType properties: accountType: - type: string - enum: [BASE_WALLET] + const: BASE_WALLET example: BASE_WALLET diff --git a/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml b/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml index 7890d72..10ddea3 100644 --- a/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml +++ b/openapi/components/schemas/external_accounts/BusinessBeneficiary.yaml @@ -5,7 +5,7 @@ required: properties: beneficiaryType: type: string - enum: [BUSINESS] + const: BUSINESS example: BUSINESS legalName: type: string diff --git a/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml index 44ac20e..85f7c2e 100644 --- a/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml @@ -5,8 +5,7 @@ allOf: - accountType properties: accountType: - type: string - enum: [CLABE] + const: CLABE example: CLABE beneficiary: oneOf: diff --git a/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml index 4a6af4a..2626895 100644 --- a/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml @@ -5,8 +5,7 @@ allOf: - accountType properties: accountType: - type: string - enum: [IBAN] + const: IBAN example: IBAN beneficiary: oneOf: diff --git a/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml b/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml index a5c2e09..6a86b51 100644 --- a/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml +++ b/openapi/components/schemas/external_accounts/IndividualBeneficiary.yaml @@ -7,7 +7,7 @@ required: properties: beneficiaryType: type: string - enum: [INDIVIDUAL] + const: INDIVIDUAL example: INDIVIDUAL fullName: type: string diff --git a/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml index f52bacf..a77cb28 100644 --- a/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml @@ -1,37 +1,19 @@ -allOf: - - type: object - required: - - accountType - properties: - accountType: - type: string - enum: [LIGHTNING] - example: LIGHTNING - - oneOf: - - title: Lightning Invoice - type: object - required: - - invoice - properties: - invoice: - type: string - description: 1-time use lightning bolt11 invoice payout destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - - title: Lightning - Bolt12 Offer - type: object - required: - - bolt12 - properties: - bolt12: - type: string - description: A bolt12 offer which can be reused as a payment destination - example: lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs - - title: Lightning Address - type: object - required: - - lightningAddress - properties: - 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 +type: object +required: + - accountType +properties: + accountType: + 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 diff --git a/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml index 4f4c32e..1fc8848 100644 --- a/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml @@ -7,8 +7,7 @@ allOf: - beneficiary properties: accountType: - type: string - enum: [NGN_ACCOUNT] + const: NGN_ACCOUNT example: NGN_ACCOUNT beneficiary: oneOf: diff --git a/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml index e8a8ea3..6c014b2 100644 --- a/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml @@ -5,8 +5,7 @@ allOf: - accountType properties: accountType: - type: string - enum: [PIX] + const: PIX example: PIX beneficiary: oneOf: diff --git a/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml index d652383..c864ab9 100644 --- a/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/PolygonWalletExternalAccountInfo.yaml @@ -5,6 +5,5 @@ allOf: - accountType properties: accountType: - type: string - enum: [POLYGON_WALLET] + const: POLYGON_WALLET example: POLYGON_WALLET diff --git a/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml index 15dd852..5de4d3e 100644 --- a/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/SolanaWalletExternalAccountInfo.yaml @@ -5,6 +5,5 @@ allOf: - accountType properties: accountType: - type: string - enum: [SOLANA_WALLET] + const: SOLANA_WALLET example: SOLANA_WALLET diff --git a/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml index 26b81c1..aa9c65f 100644 --- a/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/SparkWalletExternalAccountInfo.yaml @@ -5,6 +5,5 @@ allOf: - accountType properties: accountType: - type: string - enum: [SPARK_WALLET] + const: SPARK_WALLET example: SPARK_WALLET diff --git a/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml index 22bad0e..a58b842 100644 --- a/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/TronWalletExternalAccountInfo.yaml @@ -5,6 +5,5 @@ allOf: - accountType properties: accountType: - type: string - enum: [TRON_WALLET] + const: TRON_WALLET example: TRON_WALLET diff --git a/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml index 41f1edf..674bc42 100644 --- a/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml @@ -5,8 +5,7 @@ allOf: - accountType properties: accountType: - type: string - enum: [UPI] + const: UPI example: UPI beneficiary: oneOf: diff --git a/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml index 62c80a1..a5ffadd 100644 --- a/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml @@ -6,8 +6,7 @@ allOf: - beneficiary properties: accountType: - type: string - enum: [US_ACCOUNT] + const: US_ACCOUNT example: US_ACCOUNT beneficiary: oneOf: diff --git a/openapi/components/schemas/quotes/Quote.yaml b/openapi/components/schemas/quotes/Quote.yaml index 92edf2a..e3fdd08 100644 --- a/openapi/components/schemas/quotes/Quote.yaml +++ b/openapi/components/schemas/quotes/Quote.yaml @@ -42,45 +42,16 @@ properties: source: $ref: ./QuoteSource.yaml destination: + required: + - destinationType oneOf: - - title: Account Destination - type: object - required: - - accountId - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR - counterpartyInformation: - type: object - description: >- - Information about the recipient, as required by the platform in their - configuration. - additionalProperties: true - example: - FULL_NAME: Jane Receiver - BIRTH_DATE: '1990-01-01' - NATIONALITY: FR - description: UMA address destination details + - $ref: ./QuoteAccountDestination.yaml + - $ref: ./QuoteUmaAddressDestination.yaml + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./QuoteAccountDestination.yaml + UMA_ADDRESS: ./QuoteUmaAddressDestination.yaml sendingCurrency: $ref: ../common/Currency.yaml description: Currency for the sending amount @@ -120,15 +91,6 @@ properties: description: Payment instructions for executing the payment. This is not required when using an internal account source. items: $ref: ../common/PaymentInstructions.yaml - example: - - accountType: US_ACCOUNT - accountNumber: "1234567890" - routingNumber: "021000021" - bankName: "Chase Bank" - referenceCode: "REF123456" - - accountType: SPARK_WALLET - address: "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - invoice: "lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs" transactionId: type: string description: The ID of the transaction created from this quote. diff --git a/openapi/components/schemas/quotes/QuoteAccountDestination.yaml b/openapi/components/schemas/quotes/QuoteAccountDestination.yaml new file mode 100644 index 0000000..3a553df --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteAccountDestination.yaml @@ -0,0 +1,18 @@ +type: object +required: + - destinationType + - accountId +properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR +description: Destination account details diff --git a/openapi/components/schemas/quotes/QuoteAccountSource.yaml b/openapi/components/schemas/quotes/QuoteAccountSource.yaml new file mode 100644 index 0000000..bc6582a --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteAccountSource.yaml @@ -0,0 +1,14 @@ +type: object +required: + - sourceType + - accountId +properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 +description: Source account details diff --git a/openapi/components/schemas/quotes/QuoteRealtimeFundingSource.yaml b/openapi/components/schemas/quotes/QuoteRealtimeFundingSource.yaml new file mode 100644 index 0000000..8f033e8 --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRealtimeFundingSource.yaml @@ -0,0 +1,27 @@ +type: object +required: + - sourceType + - currency +properties: + sourceType: + type: string + const: REALTIME_FUNDING + description: Source type identifier + customerId: + type: string + description: >- + Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. + If customerId is not provided, the quote will be created on behalf of the platform itself. + example: Customer:019542f5-b3e7-1d02-0000-000000000009 + currency: + type: string + description: >- + Currency code for the funding source. See + [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) + for the full list of supported fiat and crypto currencies. + example: USD +description: >- + Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). + This will require manual just-in-time funding using `paymentInstructions` in the response. + Because quotes expire quickly, this option is only valid for instant payment methods. Do not try + to fund a quote with a non-instant payment method (ACH, etc.). diff --git a/openapi/components/schemas/quotes/QuoteRequest.yaml b/openapi/components/schemas/quotes/QuoteRequest.yaml index 5e27a72..842cc4d 100644 --- a/openapi/components/schemas/quotes/QuoteRequest.yaml +++ b/openapi/components/schemas/quotes/QuoteRequest.yaml @@ -19,53 +19,17 @@ properties: destination: oneOf: - title: Account - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: >- - Currency code for the destination account. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: EUR - description: Destination account details + $ref: ./QuoteRequestAccountDestination.yaml - title: UMA Address - type: object - required: - - umaAddress - - currency - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: >- - Currency code for the destination. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: EUR - description: UMA address destination details + $ref: ./QuoteRequestUmaAddressDestination.yaml - title: External Account Details - type: object - required: - - externalAccountDetails - properties: - externalAccountDetails: - $ref: ../external_accounts/ExternalAccountCreateRequest.yaml - description: >- - A convenient destination option which adds the external account and creates - the quote in one step rather than first needing to call /external-accounts - to add the account. Useful for one-off payments to some destination. - See the external accounts endpoints for test values in sandbox mode. + $ref: ./QuoteRequestExternalAccountDetailsDestination.yaml + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./QuoteRequestAccountDestination.yaml + UMA_ADDRESS: ./QuoteRequestUmaAddressDestination.yaml + EXTERNAL_ACCOUNT_DETAILS: ./QuoteRequestExternalAccountDetailsDestination.yaml lockedCurrencySide: $ref: ./QuoteLockSide.yaml lockedCurrencyAmount: diff --git a/openapi/components/schemas/quotes/QuoteRequestAccountDestination.yaml b/openapi/components/schemas/quotes/QuoteRequestAccountDestination.yaml new file mode 100644 index 0000000..4e38c1a --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRequestAccountDestination.yaml @@ -0,0 +1,22 @@ +type: object +required: + - destinationType + - accountId + - currency +properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: >- + Currency code for the destination account. See + [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) + for the full list of supported fiat and crypto currencies. + example: EUR +description: Destination account details diff --git a/openapi/components/schemas/quotes/QuoteRequestExternalAccountDetailsDestination.yaml b/openapi/components/schemas/quotes/QuoteRequestExternalAccountDetailsDestination.yaml new file mode 100644 index 0000000..18e66ee --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRequestExternalAccountDetailsDestination.yaml @@ -0,0 +1,16 @@ +type: object +required: + - destinationType + - externalAccountDetails +properties: + destinationType: + type: string + const: EXTERNAL_ACCOUNT_DETAILS + description: Destination type identifier + externalAccountDetails: + $ref: ../external_accounts/ExternalAccountCreateRequest.yaml +description: >- + A convenient destination option which adds the external account and creates + the quote in one step rather than first needing to call /external-accounts + to add the account. Useful for one-off payments to some destination. + See the external accounts endpoints for test values in sandbox mode. diff --git a/openapi/components/schemas/quotes/QuoteRequestUmaAddressDestination.yaml b/openapi/components/schemas/quotes/QuoteRequestUmaAddressDestination.yaml new file mode 100644 index 0000000..aa9177d --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteRequestUmaAddressDestination.yaml @@ -0,0 +1,22 @@ +type: object +required: + - destinationType + - umaAddress + - currency +properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: >- + Currency code for the destination. See + [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) + for the full list of supported fiat and crypto currencies. + example: EUR +description: UMA address destination details diff --git a/openapi/components/schemas/quotes/QuoteSource.yaml b/openapi/components/schemas/quotes/QuoteSource.yaml index d12a92d..2a225b8 100644 --- a/openapi/components/schemas/quotes/QuoteSource.yaml +++ b/openapi/components/schemas/quotes/QuoteSource.yaml @@ -1,42 +1,10 @@ +required: + - sourceType oneOf: - - title: Account - type: object - required: - - accountId - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: >- - Currency code for the funding source. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: USD - description: Source account details - - title: Real-time funding - type: object - required: - - currency - - customerId - properties: - customerId: - type: string - description: >- - Source customer ID. If this transaction is being initiated on behalf of a customer, this is required. - If customerId is not provided, the quote will be created on behalf of the platform itself. - example: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: - type: string - description: >- - Currency code for the funding source. See - [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) - for the full list of supported fiat and crypto currencies. - example: USD - description: >- - Fund the quote using a real-time funding source (RTP, SEPA Instant, Spark, Stables, etc.). - This will require manual just-in-time funding using `paymentInstructions` in the response. - Because quotes expire quickly, this option is only valid for instant payment methods. Do not try - to fund a quote with a non-instant payment method (ACH, etc.). + - $ref: ./QuoteAccountSource.yaml + - $ref: ./QuoteRealtimeFundingSource.yaml +discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./QuoteAccountSource.yaml + REALTIME_FUNDING: ./QuoteRealtimeFundingSource.yaml diff --git a/openapi/components/schemas/quotes/QuoteUmaAddressDestination.yaml b/openapi/components/schemas/quotes/QuoteUmaAddressDestination.yaml new file mode 100644 index 0000000..14bf5ab --- /dev/null +++ b/openapi/components/schemas/quotes/QuoteUmaAddressDestination.yaml @@ -0,0 +1,28 @@ +type: object +required: + - destinationType + - umaAddress +properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR + counterpartyInformation: + type: object + description: >- + Information about the recipient, as required by the platform in their + configuration. + additionalProperties: true + example: + FULL_NAME: Jane Receiver + BIRTH_DATE: '1990-01-01' + NATIONALITY: FR +description: UMA address destination details diff --git a/openapi/components/schemas/transactions/AccountDestination.yaml b/openapi/components/schemas/transactions/AccountDestination.yaml new file mode 100644 index 0000000..847b568 --- /dev/null +++ b/openapi/components/schemas/transactions/AccountDestination.yaml @@ -0,0 +1,19 @@ +type: object +required: + - destinationType + - accountId + - currency +properties: + destinationType: + type: string + const: ACCOUNT + description: Destination type identifier + accountId: + type: string + description: Destination account identifier + example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 + currency: + type: string + description: Currency code for the destination account + example: EUR +description: Destination account details diff --git a/openapi/components/schemas/transactions/AccountSource.yaml b/openapi/components/schemas/transactions/AccountSource.yaml new file mode 100644 index 0000000..4e049a7 --- /dev/null +++ b/openapi/components/schemas/transactions/AccountSource.yaml @@ -0,0 +1,19 @@ +type: object +required: + - sourceType + - accountId + - currency +properties: + sourceType: + type: string + const: ACCOUNT + description: Source type identifier + accountId: + type: string + description: Source account identifier + example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 + currency: + type: string + description: Currency code for the source account + example: USD +description: Source account details diff --git a/openapi/components/schemas/transactions/IncomingTransaction.yaml b/openapi/components/schemas/transactions/IncomingTransaction.yaml index ebd4fe0..e2dc458 100644 --- a/openapi/components/schemas/transactions/IncomingTransaction.yaml +++ b/openapi/components/schemas/transactions/IncomingTransaction.yaml @@ -7,34 +7,14 @@ allOf: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: ./AccountSource.yaml - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: ./UmaAddressSource.yaml + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountSource.yaml + UMA_ADDRESS: ./UmaAddressSource.yaml receivedAmount: $ref: ../common/CurrencyAmount.yaml description: Amount received in the recipient's currency diff --git a/openapi/components/schemas/transactions/OutgoingTransaction.yaml b/openapi/components/schemas/transactions/OutgoingTransaction.yaml index 56700ff..88ad323 100644 --- a/openapi/components/schemas/transactions/OutgoingTransaction.yaml +++ b/openapi/components/schemas/transactions/OutgoingTransaction.yaml @@ -9,34 +9,14 @@ allOf: source: oneOf: - title: Account Source - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Source account identifier - example: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - currency: - type: string - description: Currency code for the source account - example: USD - description: Source account details + $ref: ./AccountSource.yaml - title: UMA Address Source - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the sender - example: $sender@uma.domain.com - currency: - type: string - description: Currency code for the source - example: USD - description: UMA address source details + $ref: ./UmaAddressSource.yaml + discriminator: + propertyName: sourceType + mapping: + ACCOUNT: ./AccountSource.yaml + UMA_ADDRESS: ./UmaAddressSource.yaml sentAmount: $ref: ../common/CurrencyAmount.yaml description: Amount sent in the sender's currency @@ -70,15 +50,6 @@ allOf: description: Payment instructions for executing the payment. items: $ref: ../common/PaymentInstructions.yaml - example: - - accountType: US_ACCOUNT - accountNumber: "1234567890" - routingNumber: "021000021" - bankName: "Chase Bank" - referenceCode: "REF123456" - - accountType: SPARK_WALLET - address: "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - invoice: "lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs" refund: $ref: ../common/Refund.yaml description: The refund if transaction was refunded. diff --git a/openapi/components/schemas/transactions/Transaction.yaml b/openapi/components/schemas/transactions/Transaction.yaml index 83f5c80..05cfb01 100644 --- a/openapi/components/schemas/transactions/Transaction.yaml +++ b/openapi/components/schemas/transactions/Transaction.yaml @@ -17,34 +17,13 @@ properties: $ref: ./TransactionType.yaml destination: oneOf: - - title: Account Destination - type: object - required: - - accountId - - currency - properties: - accountId: - type: string - description: Destination account identifier - example: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: - type: string - description: Currency code for the destination account - example: EUR - description: Destination account details - - title: UMA Address Destination - type: object - required: - - umaAddress - properties: - umaAddress: - type: string - description: UMA address of the recipient - example: $receiver@uma.domain.com - currency: - type: string - description: Currency code for the destination - example: EUR + - $ref: ./AccountDestination.yaml + - $ref: ./UmaAddressDestination.yaml + discriminator: + propertyName: destinationType + mapping: + ACCOUNT: ./AccountDestination.yaml + UMA_ADDRESS: ./UmaAddressDestination.yaml customerId: type: string description: System ID of the customer (sender for outgoing, recipient for incoming) diff --git a/openapi/components/schemas/transactions/UmaAddressDestination.yaml b/openapi/components/schemas/transactions/UmaAddressDestination.yaml new file mode 100644 index 0000000..5b7e6a7 --- /dev/null +++ b/openapi/components/schemas/transactions/UmaAddressDestination.yaml @@ -0,0 +1,18 @@ +type: object +required: + - destinationType + - umaAddress +properties: + destinationType: + type: string + const: UMA_ADDRESS + description: Destination type identifier + umaAddress: + type: string + description: UMA address of the recipient + example: $receiver@uma.domain.com + currency: + type: string + description: Currency code for the destination + example: EUR +description: UMA address destination details diff --git a/openapi/components/schemas/transactions/UmaAddressSource.yaml b/openapi/components/schemas/transactions/UmaAddressSource.yaml new file mode 100644 index 0000000..5b5fc11 --- /dev/null +++ b/openapi/components/schemas/transactions/UmaAddressSource.yaml @@ -0,0 +1,18 @@ +type: object +required: + - sourceType + - umaAddress +properties: + sourceType: + type: string + const: UMA_ADDRESS + description: Source type identifier + umaAddress: + type: string + description: UMA address of the sender + example: $sender@uma.domain.com + currency: + type: string + description: Currency code for the source + example: USD +description: UMA address source details diff --git a/openapi/components/schemas/webhooks/IncomingPaymentWebhookForbiddenResponse.yaml b/openapi/components/schemas/webhooks/IncomingPaymentWebhookForbiddenResponse.yaml index 12c0b08..4d8b6c0 100644 --- a/openapi/components/schemas/webhooks/IncomingPaymentWebhookForbiddenResponse.yaml +++ b/openapi/components/schemas/webhooks/IncomingPaymentWebhookForbiddenResponse.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: ../common/Error.yaml + - $ref: ../common/GridError.yaml - type: object properties: reason: diff --git a/openapi/components/schemas/webhooks/IncomingPaymentWebhookUnprocessableResponse.yaml b/openapi/components/schemas/webhooks/IncomingPaymentWebhookUnprocessableResponse.yaml index 83e0026..543ecce 100644 --- a/openapi/components/schemas/webhooks/IncomingPaymentWebhookUnprocessableResponse.yaml +++ b/openapi/components/schemas/webhooks/IncomingPaymentWebhookUnprocessableResponse.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: ../common/Error.yaml + - $ref: ../common/GridError.yaml - type: object properties: requiredFields: diff --git a/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml b/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml index ba9236e..a57b766 100644 --- a/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml +++ b/openapi/components/schemas/webhooks/InvitationClaimedWebhook.yaml @@ -8,7 +8,6 @@ allOf: $ref: ../invitations/UmaInvitation.yaml type: type: string - enum: - - INVITATION_CLAIMED + const: INVITATION_CLAIMED description: Type of webhook event example: INVITATION_CLAIMED diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index d69dfb1..26731ce 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -68,7 +68,18 @@ components: If the signature verification succeeds, the webhook is authentic. If not, it should be rejected. - + schemas: + AllErrors: + anyOf: + - $ref: components/schemas/errors/Error400.yaml + - $ref: components/schemas/errors/Error401.yaml + - $ref: components/schemas/errors/Error403.yaml + - $ref: components/schemas/errors/Error404.yaml + - $ref: components/schemas/errors/Error409.yaml + - $ref: components/schemas/errors/Error412.yaml + - $ref: components/schemas/errors/Error424.yaml + - $ref: components/schemas/errors/Error500.yaml + - $ref: components/schemas/errors/Error501.yaml paths: /config: $ref: paths/platform/config.yaml diff --git a/openapi/paths/customers/customers.yaml b/openapi/paths/customers/customers.yaml index 9bced55..66b5188 100644 --- a/openapi/paths/customers/customers.yaml +++ b/openapi/paths/customers/customers.yaml @@ -13,99 +13,7 @@ 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/CreateCustomerRequest.yaml responses: '201': description: Customer created successfully diff --git a/openapi/paths/customers/customers_{customerId}.yaml b/openapi/paths/customers/customers_{customerId}.yaml index d3ed33c..de62fda 100644 --- a/openapi/paths/customers/customers_{customerId}.yaml +++ b/openapi/paths/customers/customers_{customerId}.yaml @@ -60,43 +60,7 @@ patch: content: application/json: schema: - oneOf: - - title: Update Individual Customer - $ref: ../../components/schemas/customers/IndividualCustomerUpdate.yaml - - title: Update Business Customer - $ref: ../../components/schemas/customers/BusinessCustomerUpdate.yaml - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: ../../components/schemas/customers/IndividualCustomerUpdate.yaml - BUSINESS: ../../components/schemas/customers/BusinessCustomerUpdate.yaml - examples: - individualUpdate: - summary: Update individual customer example - value: - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-15' - address: - line1: 456 Market St - city: San Francisco - state: CA - postalCode: '94103' - country: US - businessUpdate: - summary: Update business customer example - value: - customerType: BUSINESS - businessInfo: - legalName: New Tech Solutions LLC - registrationNumber: BRN-987654321 - taxId: EIN-123456789 - address: - line1: 100 Technology Parkway - city: Palo Alto - state: CA - postalCode: '94304' - country: US + $ref: ../../components/schemas/customers/UpdateCustomerRequest.yaml responses: '200': description: Customer updated successfully @@ -178,7 +142,7 @@ delete: content: application/json: schema: - $ref: ../../components/schemas/common/Error.yaml + $ref: ../../components/schemas/common/GridError.yaml '500': description: Internal service error content: diff --git a/openapi/paths/internal-accounts/internal_accounts.yaml b/openapi/paths/internal-accounts/internal_accounts.yaml index 2e47010..94b3334 100644 --- a/openapi/paths/internal-accounts/internal_accounts.yaml +++ b/openapi/paths/internal-accounts/internal_accounts.yaml @@ -54,7 +54,7 @@ get: type: array description: List of internal accounts matching the filter criteria items: - $ref: ../../components/schemas/users/InternalAccount.yaml + $ref: ../../components/schemas/customers/InternalAccount.yaml hasMore: type: boolean description: Indicates if more results are available beyond this page diff --git a/openapi/paths/platform/platform_external_accounts.yaml b/openapi/paths/platform/platform_external_accounts.yaml index 15bc5fd..9a6920d 100644 --- a/openapi/paths/platform/platform_external_accounts.yaml +++ b/openapi/paths/platform/platform_external_accounts.yaml @@ -24,9 +24,9 @@ get: schema: type: object required: - - accounts + - data properties: - accounts: + data: type: array description: List of external accounts matching the filter criteria items: diff --git a/openapi/paths/quotes/quotes.yaml b/openapi/paths/quotes/quotes.yaml index 30c5e75..05b660a 100644 --- a/openapi/paths/quotes/quotes.yaml +++ b/openapi/paths/quotes/quotes.yaml @@ -37,47 +37,6 @@ post: application/json: schema: $ref: ../../components/schemas/quotes/QuoteRequest.yaml - examples: - accountToAccount: - summary: Account to Account Transfer - value: - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123 - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 10000 - description: 'Transfer between accounts, either internal or external.' - accountToUma: - summary: Account to UMA Address Transfer - value: - lookupId: LookupRequest:019542f5-b3e7-1d02-0000-000000000009 - source: - accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965 - destination: - umaAddress: $receiver@uma.domain.com - currency: EUR - lockedCurrencySide: SENDING - lockedCurrencyAmount: 1000 - description: 'Payment for invoice #1234' - realTimeFundingToSparkWallet: - summary: Real-time funding to Spark Wallet as an on-ramp flow. Immediate execution. - value: - source: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 - currency: USD - destination: - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu - lockedCurrencySide: RECEIVING - lockedCurrencyAmount: 10000 - immediatelyExecute: true - description: 'Bitcoin reward payout!' responses: '201': description: |