From 2032fbc33edf6b4a8f2589db4abcfdec10aef9bd Mon Sep 17 00:00:00 2001 From: Aaryaman Bhute Date: Tue, 17 Feb 2026 10:23:45 -0800 Subject: [PATCH 1/8] updates Co-authored-by: Cursor --- mintlify/openapi.yaml | 1170 +++++++++++++---- openapi.yaml | 1170 +++++++++++++---- .../schemas/common/BrlAccountInfo.yaml | 20 + .../schemas/common/BrlBeneficiary.yaml | 32 + .../schemas/common/DkkAccountInfo.yaml | 15 + .../schemas/common/DkkBeneficiary.yaml | 32 + .../schemas/common/GbpAccountInfo.yaml | 8 +- .../schemas/common/GbpBeneficiary.yaml | 32 + .../schemas/common/HkdAccountInfo.yaml | 16 + .../schemas/common/HkdBeneficiary.yaml | 32 + .../schemas/common/IdrAccountInfo.yaml | 16 + .../schemas/common/IdrBeneficiary.yaml | 32 + .../schemas/common/InrAccountInfo.yaml | 12 + .../schemas/common/InrBeneficiary.yaml | 32 + .../schemas/common/MxnAccountInfo.yaml | 16 + .../schemas/common/MxnBeneficiary.yaml | 32 + .../schemas/common/MyrAccountInfo.yaml | 16 + .../schemas/common/MyrBeneficiary.yaml | 32 + .../schemas/common/PhpAccountInfo.yaml | 8 +- .../schemas/common/PhpBeneficiary.yaml | 32 + .../schemas/common/SgdAccountInfo.yaml | 10 +- .../schemas/common/SgdBeneficiary.yaml | 32 + .../schemas/common/ThbAccountInfo.yaml | 16 + .../schemas/common/ThbBeneficiary.yaml | 32 + .../schemas/common/UsdAccountInfo.yaml | 16 + .../schemas/common/UsdBeneficiary.yaml | 34 + .../schemas/common/VndAccountInfo.yaml | 16 + .../schemas/common/VndBeneficiary.yaml | 32 + .../BaseExternalAccountInfo.yaml | 23 +- .../BrlExternalAccountInfo.yaml | 18 + .../CadAccountExternalAccountInfo.yaml | 9 - .../ClabeAccountExternalAccountInfo.yaml | 9 - .../DkkExternalAccountInfo.yaml | 18 + .../ExternalAccountInfoOneOf.yaml | 93 +- .../ExternalAccountType.yaml | 19 +- .../GbpAccountExternalAccountInfo.yaml | 9 - .../GbpExternalAccountInfo.yaml | 18 + .../HkdExternalAccountInfo.yaml | 18 + .../IbanAccountExternalAccountInfo.yaml | 9 - .../IdrExternalAccountInfo.yaml | 18 + .../InrExternalAccountInfo.yaml | 18 + .../MxnExternalAccountInfo.yaml | 18 + .../MyrExternalAccountInfo.yaml | 18 + .../NgnAccountExternalAccountInfo.yaml | 27 - .../PhpAccountExternalAccountInfo.yaml | 9 - .../PhpExternalAccountInfo.yaml | 18 + .../PixAccountExternalAccountInfo.yaml | 9 - .../SgdAccountExternalAccountInfo.yaml | 9 - .../SgdExternalAccountInfo.yaml | 18 + .../ThbExternalAccountInfo.yaml | 18 + .../UpiAccountExternalAccountInfo.yaml | 9 - .../UsAccountExternalAccountInfo.yaml | 9 - .../UsdExternalAccountInfo.yaml | 18 + .../VndExternalAccountInfo.yaml | 18 + 54 files changed, 2769 insertions(+), 651 deletions(-) create mode 100644 openapi/components/schemas/common/BrlAccountInfo.yaml create mode 100644 openapi/components/schemas/common/BrlBeneficiary.yaml create mode 100644 openapi/components/schemas/common/DkkAccountInfo.yaml create mode 100644 openapi/components/schemas/common/DkkBeneficiary.yaml create mode 100644 openapi/components/schemas/common/GbpBeneficiary.yaml create mode 100644 openapi/components/schemas/common/HkdAccountInfo.yaml create mode 100644 openapi/components/schemas/common/HkdBeneficiary.yaml create mode 100644 openapi/components/schemas/common/IdrAccountInfo.yaml create mode 100644 openapi/components/schemas/common/IdrBeneficiary.yaml create mode 100644 openapi/components/schemas/common/InrAccountInfo.yaml create mode 100644 openapi/components/schemas/common/InrBeneficiary.yaml create mode 100644 openapi/components/schemas/common/MxnAccountInfo.yaml create mode 100644 openapi/components/schemas/common/MxnBeneficiary.yaml create mode 100644 openapi/components/schemas/common/MyrAccountInfo.yaml create mode 100644 openapi/components/schemas/common/MyrBeneficiary.yaml create mode 100644 openapi/components/schemas/common/PhpBeneficiary.yaml create mode 100644 openapi/components/schemas/common/SgdBeneficiary.yaml create mode 100644 openapi/components/schemas/common/ThbAccountInfo.yaml create mode 100644 openapi/components/schemas/common/ThbBeneficiary.yaml create mode 100644 openapi/components/schemas/common/UsdAccountInfo.yaml create mode 100644 openapi/components/schemas/common/UsdBeneficiary.yaml create mode 100644 openapi/components/schemas/common/VndAccountInfo.yaml create mode 100644 openapi/components/schemas/common/VndBeneficiary.yaml create mode 100644 openapi/components/schemas/external_accounts/BrlExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/DkkExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/GbpExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/HkdExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/IdrExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/InrExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/MxnExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/MyrExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/PhpExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/SgdExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/ThbExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml delete mode 100644 openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/UsdExternalAccountInfo.yaml create mode 100644 openapi/components/schemas/external_accounts/VndExternalAccountInfo.yaml diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index 9182b56f..af4f0f20 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -5242,16 +5242,6 @@ components: - UNDER_REVIEW - INACTIVE description: Status of an external account - UsAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/UsAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' BaseExternalAccountInfo: type: object required: @@ -5262,22 +5252,95 @@ components: discriminator: propertyName: accountType mapping: - US_ACCOUNT: '#/components/schemas/UsAccountExternalAccountInfo' - CLABE: '#/components/schemas/ClabeAccountExternalAccountInfo' - PIX: '#/components/schemas/PixAccountExternalAccountInfo' - IBAN: '#/components/schemas/IbanAccountExternalAccountInfo' - UPI: '#/components/schemas/UpiAccountExternalAccountInfo' - NGN_ACCOUNT: '#/components/schemas/NgnAccountExternalAccountInfo' - CAD_ACCOUNT: '#/components/schemas/CadAccountExternalAccountInfo' - GBP_ACCOUNT: '#/components/schemas/GbpAccountExternalAccountInfo' - PHP_ACCOUNT: '#/components/schemas/PhpAccountExternalAccountInfo' - SGD_ACCOUNT: '#/components/schemas/SgdAccountExternalAccountInfo' + GBP_ACCOUNT: '#/components/schemas/GbpExternalAccountInfo' + PHP_ACCOUNT: '#/components/schemas/PhpExternalAccountInfo' + SGD_ACCOUNT: '#/components/schemas/SgdExternalAccountInfo' SPARK_WALLET: '#/components/schemas/SparkWalletExternalAccountInfo' LIGHTNING: '#/components/schemas/LightningExternalAccountInfo' SOLANA_WALLET: '#/components/schemas/SolanaWalletExternalAccountInfo' TRON_WALLET: '#/components/schemas/TronWalletExternalAccountInfo' POLYGON_WALLET: '#/components/schemas/PolygonWalletExternalAccountInfo' BASE_WALLET: '#/components/schemas/BaseWalletExternalAccountInfo' + BRL_ACCOUNT: '#/components/schemas/BrlExternalAccountInfo' + DKK_ACCOUNT: '#/components/schemas/DkkExternalAccountInfo' + HKD_ACCOUNT: '#/components/schemas/HkdExternalAccountInfo' + IDR_ACCOUNT: '#/components/schemas/IdrExternalAccountInfo' + INR_ACCOUNT: '#/components/schemas/InrExternalAccountInfo' + MXN_ACCOUNT: '#/components/schemas/MxnExternalAccountInfo' + MYR_ACCOUNT: '#/components/schemas/MyrExternalAccountInfo' + THB_ACCOUNT: '#/components/schemas/ThbExternalAccountInfo' + USD_ACCOUNT: '#/components/schemas/UsdExternalAccountInfo' + VND_ACCOUNT: '#/components/schemas/VndExternalAccountInfo' + GbpAccountInfo: + type: object + required: + - accountType + - sortCode + - accountNumber + properties: + accountType: + type: string + enum: + - GBP_ACCOUNT + sortCode: + type: string + description: UK bank sort code (6 digits, may include hyphens) + example: 20-00-00 + pattern: ^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$ + accountNumber: + type: string + description: UK bank account number (8 digits) + example: '12345678' + minLength: 8 + maxLength: 8 + pattern: ^[0-9]{8}$ + GbpBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + BaseBeneficiary: + type: object + required: + - beneficiaryType + properties: + beneficiaryType: + $ref: '#/components/schemas/BeneficiaryType' + address: + $ref: '#/components/schemas/Address' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' IndividualBeneficiary: allOf: - $ref: '#/components/schemas/BaseBeneficiary' @@ -5305,20 +5368,6 @@ components: type: string description: Country code (ISO 3166-1 alpha-2) example: US - BaseBeneficiary: - type: object - required: - - beneficiaryType - properties: - beneficiaryType: - $ref: '#/components/schemas/BeneficiaryType' - address: - $ref: '#/components/schemas/Address' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' BusinessBeneficiary: allOf: - $ref: '#/components/schemas/BaseBeneficiary' @@ -5350,152 +5399,7 @@ components: - BUSINESS description: Whether the beneficiary is an individual or a business entity example: INDIVIDUAL - BeneficiaryOneOf: - oneOf: - - title: Individual Beneficiary - $ref: '#/components/schemas/IndividualBeneficiary' - - title: Business Beneficiary - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' - ClabeAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/ClabeAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - PixAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/PixAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - IbanAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/IbanAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - UpiAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/UpiAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - NgnAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/NgnAccountInfo' - - type: object - required: - - purposeOfPayment - - beneficiary - properties: - purposeOfPayment: - type: string - enum: - - GIFT - - SELF - - GOODS_OR_SERVICES - - EDUCATION - - HEALTH_OR_MEDICAL - - REAL_ESTATE_PURCHASE - - LOAN_PAYMENT - - TAX_PAYMENT - - UTILITY_BILL - - DONATION - - TRAVEL - - OTHER - description: Purpose of payment - example: GOODS_OR_SERVICES - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - CadAccountInfo: - type: object - required: - - bankCode - - branchCode - - accountNumber - - accountType - properties: - accountType: - type: string - enum: - - CAD_ACCOUNT - bankCode: - type: string - description: Canadian financial institution number (3 digits) - example: '001' - minLength: 3 - maxLength: 3 - pattern: ^[0-9]{3}$ - branchCode: - type: string - description: Transit number identifying the branch (5 digits) - example: '00012' - minLength: 5 - maxLength: 5 - pattern: ^[0-9]{5}$ - accountNumber: - type: string - description: Bank account number (7-12 digits) - example: '1234567' - minLength: 7 - maxLength: 12 - pattern: ^[0-9]{7,12}$ - CadAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/CadAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - GbpAccountInfo: - type: object - required: - - sortCode - - accountNumber - - accountType - properties: - accountType: - type: string - enum: - - GBP_ACCOUNT - sortCode: - type: string - description: UK bank sort code (6 digits, may include hyphens) - example: 20-00-00 - pattern: ^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$ - accountNumber: - type: string - description: UK bank account number (8 digits) - example: '12345678' - minLength: 8 - maxLength: 8 - pattern: ^[0-9]{8}$ - GbpAccountExternalAccountInfo: + GbpExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/GbpAccountInfo' @@ -5504,13 +5408,22 @@ components: - beneficiary properties: beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/GbpBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/GbpBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' PhpAccountInfo: type: object required: + - accountType - bankName - accountNumber - - accountType properties: accountType: type: string @@ -5524,7 +5437,40 @@ components: type: string description: Bank account number example: '001234567890' - PhpAccountExternalAccountInfo: + PhpBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + PhpExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PhpAccountInfo' @@ -5533,14 +5479,23 @@ components: - beneficiary properties: beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/PhpBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/PhpBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' SgdAccountInfo: type: object required: + - accountType - bankName - swiftCode - accountNumber - - accountType properties: accountType: type: string @@ -5561,7 +5516,40 @@ components: type: string description: Bank account number example: '0123456789' - SgdAccountExternalAccountInfo: + SgdBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + SgdExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SgdAccountInfo' @@ -5570,7 +5558,16 @@ components: - beneficiary properties: beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/SgdBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/SgdBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' SparkWalletExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' @@ -5618,49 +5615,749 @@ components: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/BaseWalletInfo' - ExternalAccountType: - type: string - enum: - - US_ACCOUNT - - CLABE - - PIX - - IBAN - - UPI - - NGN_ACCOUNT - - CAD_ACCOUNT - - GBP_ACCOUNT - - PHP_ACCOUNT - - SGD_ACCOUNT - - SPARK_WALLET - - LIGHTNING - - SOLANA_WALLET - - TRON_WALLET - - POLYGON_WALLET - - BASE_WALLET - description: Type of external account or wallet - example: US_ACCOUNT + BrlExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/BrlAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/BrlBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/BrlBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + DkkAccountInfo: + type: object + required: + - accountType + - iban + properties: + accountType: + type: string + enum: + - DKK_ACCOUNT + iban: + type: string + description: The IBAN of the bank + swiftBic: + type: string + description: The SWIFT BIC of the bank + DkkBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + DkkExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/DkkAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/DkkBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/DkkBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + HkdAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - HKD_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + HkdBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + HkdExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/HkdAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/HkdBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/HkdBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + IdrAccountInfo: + type: object + required: + - accountType + - sortCode + - accountNumber + properties: + accountType: + type: string + enum: + - IDR_ACCOUNT + sortCode: + type: string + description: The sort code of the bank + accountNumber: + type: string + description: The account number of the bank + IdrBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + IdrExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/IdrAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/IdrBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IdrBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + InrAccountInfo: + type: object + required: + - accountType + - vpa + properties: + accountType: + type: string + enum: + - INR_ACCOUNT + vpa: + type: string + description: The VPA of the bank + InrBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + InrExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/InrAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/InrBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/InrBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + MxnAccountInfo: + type: object + required: + - accountType + - clabeNumber + properties: + accountType: + type: string + enum: + - MXN_ACCOUNT + clabeNumber: + type: string + description: The CLABE number of the bank + example: '123456789012345678' + minLength: 18 + maxLength: 18 + pattern: ^[0-9]{18}$ + MxnBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + MxnExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/MxnAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/MxnBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/MxnBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + MyrAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - MYR_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + MyrBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + MyrExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/MyrAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/MyrBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/MyrBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + ThbAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - THB_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + ThbBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + ThbExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/ThbAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/ThbBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/ThbBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + UsdAccountInfo: + type: object + required: + - accountType + - accountNumber + - routingNumber + properties: + accountType: + type: string + enum: + - USD_ACCOUNT + accountNumber: + type: string + description: The account number of the bank + routingNumber: + type: string + description: The routing number of the bank + UsdBeneficiary: + type: object + required: + - beneficiaryType + - birthDate + - fullName + - nationality + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + UsdExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/UsdAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/UsdBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/UsdBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + VndAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - VND_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + VndBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + VndExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/VndAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/VndBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/VndBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + ExternalAccountType: + type: string + enum: + - GBP_ACCOUNT + - PHP_ACCOUNT + - SGD_ACCOUNT + - SPARK_WALLET + - LIGHTNING + - SOLANA_WALLET + - TRON_WALLET + - POLYGON_WALLET + - BASE_WALLET + - BRL_ACCOUNT + - DKK_ACCOUNT + - HKD_ACCOUNT + - IDR_ACCOUNT + - INR_ACCOUNT + - MXN_ACCOUNT + - MYR_ACCOUNT + - THB_ACCOUNT + - USD_ACCOUNT + - VND_ACCOUNT + description: Type of external account or wallet + example: GBP_ACCOUNT + BrlAccountInfo: + type: object + required: + - accountType + - pixKey + - pixKeyType + - taxId + properties: + accountType: + type: string + enum: + - BRL_ACCOUNT + pixKey: + type: string + description: The PIX key of the bank + pixKeyType: + type: string + description: The type of PIX key of the bank + taxId: + type: string + description: The tax ID of the bank account + BrlBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' ExternalAccountInfoOneOf: oneOf: - - title: US Account - $ref: '#/components/schemas/UsAccountExternalAccountInfo' - - title: CLABE Account - $ref: '#/components/schemas/ClabeAccountExternalAccountInfo' - - title: PIX Account - $ref: '#/components/schemas/PixAccountExternalAccountInfo' - - title: IBAN Account - $ref: '#/components/schemas/IbanAccountExternalAccountInfo' - - title: UPI Account - $ref: '#/components/schemas/UpiAccountExternalAccountInfo' - - title: NGN Account - $ref: '#/components/schemas/NgnAccountExternalAccountInfo' - - title: CAD Account - $ref: '#/components/schemas/CadAccountExternalAccountInfo' + - title: BRL Account + $ref: '#/components/schemas/BrlExternalAccountInfo' + - title: DKK Account + $ref: '#/components/schemas/DkkExternalAccountInfo' - title: GBP Account - $ref: '#/components/schemas/GbpAccountExternalAccountInfo' + $ref: '#/components/schemas/GbpExternalAccountInfo' + - title: HKD Account + $ref: '#/components/schemas/HkdExternalAccountInfo' + - title: IDR Account + $ref: '#/components/schemas/IdrExternalAccountInfo' + - title: INR Account + $ref: '#/components/schemas/InrExternalAccountInfo' + - title: MXN Account + $ref: '#/components/schemas/MxnExternalAccountInfo' + - title: MYR Account + $ref: '#/components/schemas/MyrExternalAccountInfo' - title: PHP Account - $ref: '#/components/schemas/PhpAccountExternalAccountInfo' + $ref: '#/components/schemas/PhpExternalAccountInfo' - title: SGD Account - $ref: '#/components/schemas/SgdAccountExternalAccountInfo' + $ref: '#/components/schemas/SgdExternalAccountInfo' + - title: THB Account + $ref: '#/components/schemas/ThbExternalAccountInfo' + - title: USD Account + $ref: '#/components/schemas/UsdExternalAccountInfo' + - title: VND Account + $ref: '#/components/schemas/VndExternalAccountInfo' - title: Spark Wallet $ref: '#/components/schemas/SparkWalletExternalAccountInfo' - title: Lightning @@ -5676,16 +6373,19 @@ components: discriminator: propertyName: accountType mapping: - US_ACCOUNT: '#/components/schemas/UsAccountExternalAccountInfo' - CLABE: '#/components/schemas/ClabeAccountExternalAccountInfo' - PIX: '#/components/schemas/PixAccountExternalAccountInfo' - IBAN: '#/components/schemas/IbanAccountExternalAccountInfo' - UPI: '#/components/schemas/UpiAccountExternalAccountInfo' - NGN_ACCOUNT: '#/components/schemas/NgnAccountExternalAccountInfo' - CAD_ACCOUNT: '#/components/schemas/CadAccountExternalAccountInfo' - GBP_ACCOUNT: '#/components/schemas/GbpAccountExternalAccountInfo' - PHP_ACCOUNT: '#/components/schemas/PhpAccountExternalAccountInfo' - SGD_ACCOUNT: '#/components/schemas/SgdAccountExternalAccountInfo' + BRL_ACCOUNT: '#/components/schemas/BrlExternalAccountInfo' + DKK_ACCOUNT: '#/components/schemas/DkkExternalAccountInfo' + GBP_ACCOUNT: '#/components/schemas/GbpExternalAccountInfo' + HKD_ACCOUNT: '#/components/schemas/HkdExternalAccountInfo' + IDR_ACCOUNT: '#/components/schemas/IdrExternalAccountInfo' + INR_ACCOUNT: '#/components/schemas/InrExternalAccountInfo' + MXN_ACCOUNT: '#/components/schemas/MxnExternalAccountInfo' + MYR_ACCOUNT: '#/components/schemas/MyrExternalAccountInfo' + PHP_ACCOUNT: '#/components/schemas/PhpExternalAccountInfo' + SGD_ACCOUNT: '#/components/schemas/SgdExternalAccountInfo' + THB_ACCOUNT: '#/components/schemas/ThbExternalAccountInfo' + USD_ACCOUNT: '#/components/schemas/UsdExternalAccountInfo' + VND_ACCOUNT: '#/components/schemas/VndExternalAccountInfo' SPARK_WALLET: '#/components/schemas/SparkWalletExternalAccountInfo' LIGHTNING: '#/components/schemas/LightningExternalAccountInfo' SOLANA_WALLET: '#/components/schemas/SolanaWalletExternalAccountInfo' diff --git a/openapi.yaml b/openapi.yaml index 9182b56f..af4f0f20 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5242,16 +5242,6 @@ components: - UNDER_REVIEW - INACTIVE description: Status of an external account - UsAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/UsAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' BaseExternalAccountInfo: type: object required: @@ -5262,22 +5252,95 @@ components: discriminator: propertyName: accountType mapping: - US_ACCOUNT: '#/components/schemas/UsAccountExternalAccountInfo' - CLABE: '#/components/schemas/ClabeAccountExternalAccountInfo' - PIX: '#/components/schemas/PixAccountExternalAccountInfo' - IBAN: '#/components/schemas/IbanAccountExternalAccountInfo' - UPI: '#/components/schemas/UpiAccountExternalAccountInfo' - NGN_ACCOUNT: '#/components/schemas/NgnAccountExternalAccountInfo' - CAD_ACCOUNT: '#/components/schemas/CadAccountExternalAccountInfo' - GBP_ACCOUNT: '#/components/schemas/GbpAccountExternalAccountInfo' - PHP_ACCOUNT: '#/components/schemas/PhpAccountExternalAccountInfo' - SGD_ACCOUNT: '#/components/schemas/SgdAccountExternalAccountInfo' + GBP_ACCOUNT: '#/components/schemas/GbpExternalAccountInfo' + PHP_ACCOUNT: '#/components/schemas/PhpExternalAccountInfo' + SGD_ACCOUNT: '#/components/schemas/SgdExternalAccountInfo' SPARK_WALLET: '#/components/schemas/SparkWalletExternalAccountInfo' LIGHTNING: '#/components/schemas/LightningExternalAccountInfo' SOLANA_WALLET: '#/components/schemas/SolanaWalletExternalAccountInfo' TRON_WALLET: '#/components/schemas/TronWalletExternalAccountInfo' POLYGON_WALLET: '#/components/schemas/PolygonWalletExternalAccountInfo' BASE_WALLET: '#/components/schemas/BaseWalletExternalAccountInfo' + BRL_ACCOUNT: '#/components/schemas/BrlExternalAccountInfo' + DKK_ACCOUNT: '#/components/schemas/DkkExternalAccountInfo' + HKD_ACCOUNT: '#/components/schemas/HkdExternalAccountInfo' + IDR_ACCOUNT: '#/components/schemas/IdrExternalAccountInfo' + INR_ACCOUNT: '#/components/schemas/InrExternalAccountInfo' + MXN_ACCOUNT: '#/components/schemas/MxnExternalAccountInfo' + MYR_ACCOUNT: '#/components/schemas/MyrExternalAccountInfo' + THB_ACCOUNT: '#/components/schemas/ThbExternalAccountInfo' + USD_ACCOUNT: '#/components/schemas/UsdExternalAccountInfo' + VND_ACCOUNT: '#/components/schemas/VndExternalAccountInfo' + GbpAccountInfo: + type: object + required: + - accountType + - sortCode + - accountNumber + properties: + accountType: + type: string + enum: + - GBP_ACCOUNT + sortCode: + type: string + description: UK bank sort code (6 digits, may include hyphens) + example: 20-00-00 + pattern: ^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$ + accountNumber: + type: string + description: UK bank account number (8 digits) + example: '12345678' + minLength: 8 + maxLength: 8 + pattern: ^[0-9]{8}$ + GbpBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + BaseBeneficiary: + type: object + required: + - beneficiaryType + properties: + beneficiaryType: + $ref: '#/components/schemas/BeneficiaryType' + address: + $ref: '#/components/schemas/Address' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' IndividualBeneficiary: allOf: - $ref: '#/components/schemas/BaseBeneficiary' @@ -5305,20 +5368,6 @@ components: type: string description: Country code (ISO 3166-1 alpha-2) example: US - BaseBeneficiary: - type: object - required: - - beneficiaryType - properties: - beneficiaryType: - $ref: '#/components/schemas/BeneficiaryType' - address: - $ref: '#/components/schemas/Address' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' BusinessBeneficiary: allOf: - $ref: '#/components/schemas/BaseBeneficiary' @@ -5350,152 +5399,7 @@ components: - BUSINESS description: Whether the beneficiary is an individual or a business entity example: INDIVIDUAL - BeneficiaryOneOf: - oneOf: - - title: Individual Beneficiary - $ref: '#/components/schemas/IndividualBeneficiary' - - title: Business Beneficiary - $ref: '#/components/schemas/BusinessBeneficiary' - discriminator: - propertyName: beneficiaryType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualBeneficiary' - BUSINESS: '#/components/schemas/BusinessBeneficiary' - ClabeAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/ClabeAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - PixAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/PixAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - IbanAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/IbanAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - UpiAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/UpiAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - NgnAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/NgnAccountInfo' - - type: object - required: - - purposeOfPayment - - beneficiary - properties: - purposeOfPayment: - type: string - enum: - - GIFT - - SELF - - GOODS_OR_SERVICES - - EDUCATION - - HEALTH_OR_MEDICAL - - REAL_ESTATE_PURCHASE - - LOAN_PAYMENT - - TAX_PAYMENT - - UTILITY_BILL - - DONATION - - TRAVEL - - OTHER - description: Purpose of payment - example: GOODS_OR_SERVICES - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - CadAccountInfo: - type: object - required: - - bankCode - - branchCode - - accountNumber - - accountType - properties: - accountType: - type: string - enum: - - CAD_ACCOUNT - bankCode: - type: string - description: Canadian financial institution number (3 digits) - example: '001' - minLength: 3 - maxLength: 3 - pattern: ^[0-9]{3}$ - branchCode: - type: string - description: Transit number identifying the branch (5 digits) - example: '00012' - minLength: 5 - maxLength: 5 - pattern: ^[0-9]{5}$ - accountNumber: - type: string - description: Bank account number (7-12 digits) - example: '1234567' - minLength: 7 - maxLength: 12 - pattern: ^[0-9]{7,12}$ - CadAccountExternalAccountInfo: - allOf: - - $ref: '#/components/schemas/BaseExternalAccountInfo' - - $ref: '#/components/schemas/CadAccountInfo' - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' - GbpAccountInfo: - type: object - required: - - sortCode - - accountNumber - - accountType - properties: - accountType: - type: string - enum: - - GBP_ACCOUNT - sortCode: - type: string - description: UK bank sort code (6 digits, may include hyphens) - example: 20-00-00 - pattern: ^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$ - accountNumber: - type: string - description: UK bank account number (8 digits) - example: '12345678' - minLength: 8 - maxLength: 8 - pattern: ^[0-9]{8}$ - GbpAccountExternalAccountInfo: + GbpExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/GbpAccountInfo' @@ -5504,13 +5408,22 @@ components: - beneficiary properties: beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/GbpBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/GbpBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' PhpAccountInfo: type: object required: + - accountType - bankName - accountNumber - - accountType properties: accountType: type: string @@ -5524,7 +5437,40 @@ components: type: string description: Bank account number example: '001234567890' - PhpAccountExternalAccountInfo: + PhpBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + PhpExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/PhpAccountInfo' @@ -5533,14 +5479,23 @@ components: - beneficiary properties: beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/PhpBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/PhpBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' SgdAccountInfo: type: object required: + - accountType - bankName - swiftCode - accountNumber - - accountType properties: accountType: type: string @@ -5561,7 +5516,40 @@ components: type: string description: Bank account number example: '0123456789' - SgdAccountExternalAccountInfo: + SgdBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + SgdExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/SgdAccountInfo' @@ -5570,7 +5558,16 @@ components: - beneficiary properties: beneficiary: - $ref: '#/components/schemas/BeneficiaryOneOf' + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/SgdBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/SgdBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' SparkWalletExternalAccountInfo: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' @@ -5618,49 +5615,749 @@ components: allOf: - $ref: '#/components/schemas/BaseExternalAccountInfo' - $ref: '#/components/schemas/BaseWalletInfo' - ExternalAccountType: - type: string - enum: - - US_ACCOUNT - - CLABE - - PIX - - IBAN - - UPI - - NGN_ACCOUNT - - CAD_ACCOUNT - - GBP_ACCOUNT - - PHP_ACCOUNT - - SGD_ACCOUNT - - SPARK_WALLET - - LIGHTNING - - SOLANA_WALLET - - TRON_WALLET - - POLYGON_WALLET - - BASE_WALLET - description: Type of external account or wallet - example: US_ACCOUNT + BrlExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/BrlAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/BrlBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/BrlBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + DkkAccountInfo: + type: object + required: + - accountType + - iban + properties: + accountType: + type: string + enum: + - DKK_ACCOUNT + iban: + type: string + description: The IBAN of the bank + swiftBic: + type: string + description: The SWIFT BIC of the bank + DkkBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + DkkExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/DkkAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/DkkBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/DkkBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + HkdAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - HKD_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + HkdBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + HkdExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/HkdAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/HkdBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/HkdBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + IdrAccountInfo: + type: object + required: + - accountType + - sortCode + - accountNumber + properties: + accountType: + type: string + enum: + - IDR_ACCOUNT + sortCode: + type: string + description: The sort code of the bank + accountNumber: + type: string + description: The account number of the bank + IdrBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + IdrExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/IdrAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/IdrBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/IdrBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + InrAccountInfo: + type: object + required: + - accountType + - vpa + properties: + accountType: + type: string + enum: + - INR_ACCOUNT + vpa: + type: string + description: The VPA of the bank + InrBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + InrExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/InrAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/InrBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/InrBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + MxnAccountInfo: + type: object + required: + - accountType + - clabeNumber + properties: + accountType: + type: string + enum: + - MXN_ACCOUNT + clabeNumber: + type: string + description: The CLABE number of the bank + example: '123456789012345678' + minLength: 18 + maxLength: 18 + pattern: ^[0-9]{18}$ + MxnBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + MxnExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/MxnAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/MxnBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/MxnBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + MyrAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - MYR_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + MyrBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + MyrExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/MyrAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/MyrBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/MyrBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + ThbAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - THB_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + ThbBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + ThbExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/ThbAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/ThbBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/ThbBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + UsdAccountInfo: + type: object + required: + - accountType + - accountNumber + - routingNumber + properties: + accountType: + type: string + enum: + - USD_ACCOUNT + accountNumber: + type: string + description: The account number of the bank + routingNumber: + type: string + description: The routing number of the bank + UsdBeneficiary: + type: object + required: + - beneficiaryType + - birthDate + - fullName + - nationality + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + UsdExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/UsdAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/UsdBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/UsdBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + VndAccountInfo: + type: object + required: + - accountType + - bankName + - accountNumber + properties: + accountType: + type: string + enum: + - VND_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank + VndBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' + VndExternalAccountInfo: + allOf: + - $ref: '#/components/schemas/BaseExternalAccountInfo' + - $ref: '#/components/schemas/VndAccountInfo' + - type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: '#/components/schemas/VndBeneficiary' + - title: Business Beneficiary + $ref: '#/components/schemas/BusinessBeneficiary' + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: '#/components/schemas/VndBeneficiary' + BUSINESS: '#/components/schemas/BusinessBeneficiary' + ExternalAccountType: + type: string + enum: + - GBP_ACCOUNT + - PHP_ACCOUNT + - SGD_ACCOUNT + - SPARK_WALLET + - LIGHTNING + - SOLANA_WALLET + - TRON_WALLET + - POLYGON_WALLET + - BASE_WALLET + - BRL_ACCOUNT + - DKK_ACCOUNT + - HKD_ACCOUNT + - IDR_ACCOUNT + - INR_ACCOUNT + - MXN_ACCOUNT + - MYR_ACCOUNT + - THB_ACCOUNT + - USD_ACCOUNT + - VND_ACCOUNT + description: Type of external account or wallet + example: GBP_ACCOUNT + BrlAccountInfo: + type: object + required: + - accountType + - pixKey + - pixKeyType + - taxId + properties: + accountType: + type: string + enum: + - BRL_ACCOUNT + pixKey: + type: string + description: The PIX key of the bank + pixKeyType: + type: string + description: The type of PIX key of the bank + taxId: + type: string + description: The tax ID of the bank account + BrlBeneficiary: + type: object + required: + - beneficiaryType + - fullName + properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: '#/components/schemas/Address' ExternalAccountInfoOneOf: oneOf: - - title: US Account - $ref: '#/components/schemas/UsAccountExternalAccountInfo' - - title: CLABE Account - $ref: '#/components/schemas/ClabeAccountExternalAccountInfo' - - title: PIX Account - $ref: '#/components/schemas/PixAccountExternalAccountInfo' - - title: IBAN Account - $ref: '#/components/schemas/IbanAccountExternalAccountInfo' - - title: UPI Account - $ref: '#/components/schemas/UpiAccountExternalAccountInfo' - - title: NGN Account - $ref: '#/components/schemas/NgnAccountExternalAccountInfo' - - title: CAD Account - $ref: '#/components/schemas/CadAccountExternalAccountInfo' + - title: BRL Account + $ref: '#/components/schemas/BrlExternalAccountInfo' + - title: DKK Account + $ref: '#/components/schemas/DkkExternalAccountInfo' - title: GBP Account - $ref: '#/components/schemas/GbpAccountExternalAccountInfo' + $ref: '#/components/schemas/GbpExternalAccountInfo' + - title: HKD Account + $ref: '#/components/schemas/HkdExternalAccountInfo' + - title: IDR Account + $ref: '#/components/schemas/IdrExternalAccountInfo' + - title: INR Account + $ref: '#/components/schemas/InrExternalAccountInfo' + - title: MXN Account + $ref: '#/components/schemas/MxnExternalAccountInfo' + - title: MYR Account + $ref: '#/components/schemas/MyrExternalAccountInfo' - title: PHP Account - $ref: '#/components/schemas/PhpAccountExternalAccountInfo' + $ref: '#/components/schemas/PhpExternalAccountInfo' - title: SGD Account - $ref: '#/components/schemas/SgdAccountExternalAccountInfo' + $ref: '#/components/schemas/SgdExternalAccountInfo' + - title: THB Account + $ref: '#/components/schemas/ThbExternalAccountInfo' + - title: USD Account + $ref: '#/components/schemas/UsdExternalAccountInfo' + - title: VND Account + $ref: '#/components/schemas/VndExternalAccountInfo' - title: Spark Wallet $ref: '#/components/schemas/SparkWalletExternalAccountInfo' - title: Lightning @@ -5676,16 +6373,19 @@ components: discriminator: propertyName: accountType mapping: - US_ACCOUNT: '#/components/schemas/UsAccountExternalAccountInfo' - CLABE: '#/components/schemas/ClabeAccountExternalAccountInfo' - PIX: '#/components/schemas/PixAccountExternalAccountInfo' - IBAN: '#/components/schemas/IbanAccountExternalAccountInfo' - UPI: '#/components/schemas/UpiAccountExternalAccountInfo' - NGN_ACCOUNT: '#/components/schemas/NgnAccountExternalAccountInfo' - CAD_ACCOUNT: '#/components/schemas/CadAccountExternalAccountInfo' - GBP_ACCOUNT: '#/components/schemas/GbpAccountExternalAccountInfo' - PHP_ACCOUNT: '#/components/schemas/PhpAccountExternalAccountInfo' - SGD_ACCOUNT: '#/components/schemas/SgdAccountExternalAccountInfo' + BRL_ACCOUNT: '#/components/schemas/BrlExternalAccountInfo' + DKK_ACCOUNT: '#/components/schemas/DkkExternalAccountInfo' + GBP_ACCOUNT: '#/components/schemas/GbpExternalAccountInfo' + HKD_ACCOUNT: '#/components/schemas/HkdExternalAccountInfo' + IDR_ACCOUNT: '#/components/schemas/IdrExternalAccountInfo' + INR_ACCOUNT: '#/components/schemas/InrExternalAccountInfo' + MXN_ACCOUNT: '#/components/schemas/MxnExternalAccountInfo' + MYR_ACCOUNT: '#/components/schemas/MyrExternalAccountInfo' + PHP_ACCOUNT: '#/components/schemas/PhpExternalAccountInfo' + SGD_ACCOUNT: '#/components/schemas/SgdExternalAccountInfo' + THB_ACCOUNT: '#/components/schemas/ThbExternalAccountInfo' + USD_ACCOUNT: '#/components/schemas/UsdExternalAccountInfo' + VND_ACCOUNT: '#/components/schemas/VndExternalAccountInfo' SPARK_WALLET: '#/components/schemas/SparkWalletExternalAccountInfo' LIGHTNING: '#/components/schemas/LightningExternalAccountInfo' SOLANA_WALLET: '#/components/schemas/SolanaWalletExternalAccountInfo' diff --git a/openapi/components/schemas/common/BrlAccountInfo.yaml b/openapi/components/schemas/common/BrlAccountInfo.yaml new file mode 100644 index 00000000..278a83b8 --- /dev/null +++ b/openapi/components/schemas/common/BrlAccountInfo.yaml @@ -0,0 +1,20 @@ +type: object +required: +- accountType +- pixKey +- pixKeyType +- taxId +properties: + accountType: + type: string + enum: + - BRL_ACCOUNT + pixKey: + type: string + description: The PIX key of the bank + pixKeyType: + type: string + description: The type of PIX key of the bank + taxId: + type: string + description: The tax ID of the bank account diff --git a/openapi/components/schemas/common/BrlBeneficiary.yaml b/openapi/components/schemas/common/BrlBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/BrlBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/DkkAccountInfo.yaml b/openapi/components/schemas/common/DkkAccountInfo.yaml new file mode 100644 index 00000000..b80d6541 --- /dev/null +++ b/openapi/components/schemas/common/DkkAccountInfo.yaml @@ -0,0 +1,15 @@ +type: object +required: +- accountType +- iban +properties: + accountType: + type: string + enum: + - DKK_ACCOUNT + iban: + type: string + description: The IBAN of the bank + swiftBic: + type: string + description: The SWIFT BIC of the bank diff --git a/openapi/components/schemas/common/DkkBeneficiary.yaml b/openapi/components/schemas/common/DkkBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/DkkBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/GbpAccountInfo.yaml b/openapi/components/schemas/common/GbpAccountInfo.yaml index 68a9a163..9726bb6c 100644 --- a/openapi/components/schemas/common/GbpAccountInfo.yaml +++ b/openapi/components/schemas/common/GbpAccountInfo.yaml @@ -1,13 +1,13 @@ type: object required: - - sortCode - - accountNumber - - accountType +- accountType +- sortCode +- accountNumber properties: accountType: type: string enum: - - GBP_ACCOUNT + - GBP_ACCOUNT sortCode: type: string description: UK bank sort code (6 digits, may include hyphens) diff --git a/openapi/components/schemas/common/GbpBeneficiary.yaml b/openapi/components/schemas/common/GbpBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/GbpBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/HkdAccountInfo.yaml b/openapi/components/schemas/common/HkdAccountInfo.yaml new file mode 100644 index 00000000..c3f2c7dd --- /dev/null +++ b/openapi/components/schemas/common/HkdAccountInfo.yaml @@ -0,0 +1,16 @@ +type: object +required: +- accountType +- bankName +- accountNumber +properties: + accountType: + type: string + enum: + - HKD_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank diff --git a/openapi/components/schemas/common/HkdBeneficiary.yaml b/openapi/components/schemas/common/HkdBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/HkdBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/IdrAccountInfo.yaml b/openapi/components/schemas/common/IdrAccountInfo.yaml new file mode 100644 index 00000000..2e601516 --- /dev/null +++ b/openapi/components/schemas/common/IdrAccountInfo.yaml @@ -0,0 +1,16 @@ +type: object +required: +- accountType +- sortCode +- accountNumber +properties: + accountType: + type: string + enum: + - IDR_ACCOUNT + sortCode: + type: string + description: The sort code of the bank + accountNumber: + type: string + description: The account number of the bank diff --git a/openapi/components/schemas/common/IdrBeneficiary.yaml b/openapi/components/schemas/common/IdrBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/IdrBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/InrAccountInfo.yaml b/openapi/components/schemas/common/InrAccountInfo.yaml new file mode 100644 index 00000000..ef09dec1 --- /dev/null +++ b/openapi/components/schemas/common/InrAccountInfo.yaml @@ -0,0 +1,12 @@ +type: object +required: +- accountType +- vpa +properties: + accountType: + type: string + enum: + - INR_ACCOUNT + vpa: + type: string + description: The VPA of the bank diff --git a/openapi/components/schemas/common/InrBeneficiary.yaml b/openapi/components/schemas/common/InrBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/InrBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/MxnAccountInfo.yaml b/openapi/components/schemas/common/MxnAccountInfo.yaml new file mode 100644 index 00000000..d5444dea --- /dev/null +++ b/openapi/components/schemas/common/MxnAccountInfo.yaml @@ -0,0 +1,16 @@ +type: object +required: +- accountType +- clabeNumber +properties: + accountType: + type: string + enum: + - MXN_ACCOUNT + clabeNumber: + type: string + description: The CLABE number of the bank + example: '123456789012345678' + minLength: 18 + maxLength: 18 + pattern: ^[0-9]{18}$ diff --git a/openapi/components/schemas/common/MxnBeneficiary.yaml b/openapi/components/schemas/common/MxnBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/MxnBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/MyrAccountInfo.yaml b/openapi/components/schemas/common/MyrAccountInfo.yaml new file mode 100644 index 00000000..490f59e1 --- /dev/null +++ b/openapi/components/schemas/common/MyrAccountInfo.yaml @@ -0,0 +1,16 @@ +type: object +required: +- accountType +- bankName +- accountNumber +properties: + accountType: + type: string + enum: + - MYR_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank diff --git a/openapi/components/schemas/common/MyrBeneficiary.yaml b/openapi/components/schemas/common/MyrBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/MyrBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/PhpAccountInfo.yaml b/openapi/components/schemas/common/PhpAccountInfo.yaml index 9b01eda6..3be3ffae 100644 --- a/openapi/components/schemas/common/PhpAccountInfo.yaml +++ b/openapi/components/schemas/common/PhpAccountInfo.yaml @@ -1,13 +1,13 @@ type: object required: - - bankName - - accountNumber - - accountType +- accountType +- bankName +- accountNumber properties: accountType: type: string enum: - - PHP_ACCOUNT + - PHP_ACCOUNT bankName: type: string description: Name of the beneficiary's bank diff --git a/openapi/components/schemas/common/PhpBeneficiary.yaml b/openapi/components/schemas/common/PhpBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/PhpBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/SgdAccountInfo.yaml b/openapi/components/schemas/common/SgdAccountInfo.yaml index 1821b632..8a0b5517 100644 --- a/openapi/components/schemas/common/SgdAccountInfo.yaml +++ b/openapi/components/schemas/common/SgdAccountInfo.yaml @@ -1,14 +1,14 @@ type: object required: - - bankName - - swiftCode - - accountNumber - - accountType +- accountType +- bankName +- swiftCode +- accountNumber properties: accountType: type: string enum: - - SGD_ACCOUNT + - SGD_ACCOUNT bankName: type: string description: Name of the beneficiary's bank diff --git a/openapi/components/schemas/common/SgdBeneficiary.yaml b/openapi/components/schemas/common/SgdBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/SgdBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/ThbAccountInfo.yaml b/openapi/components/schemas/common/ThbAccountInfo.yaml new file mode 100644 index 00000000..6ff0eb90 --- /dev/null +++ b/openapi/components/schemas/common/ThbAccountInfo.yaml @@ -0,0 +1,16 @@ +type: object +required: +- accountType +- bankName +- accountNumber +properties: + accountType: + type: string + enum: + - THB_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank diff --git a/openapi/components/schemas/common/ThbBeneficiary.yaml b/openapi/components/schemas/common/ThbBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/ThbBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/UsdAccountInfo.yaml b/openapi/components/schemas/common/UsdAccountInfo.yaml new file mode 100644 index 00000000..25edd0eb --- /dev/null +++ b/openapi/components/schemas/common/UsdAccountInfo.yaml @@ -0,0 +1,16 @@ +type: object +required: +- accountType +- accountNumber +- routingNumber +properties: + accountType: + type: string + enum: + - USD_ACCOUNT + accountNumber: + type: string + description: The account number of the bank + routingNumber: + type: string + description: The routing number of the bank diff --git a/openapi/components/schemas/common/UsdBeneficiary.yaml b/openapi/components/schemas/common/UsdBeneficiary.yaml new file mode 100644 index 00000000..68882d7e --- /dev/null +++ b/openapi/components/schemas/common/UsdBeneficiary.yaml @@ -0,0 +1,34 @@ +type: object +required: +- beneficiaryType +- birthDate +- fullName +- nationality +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/common/VndAccountInfo.yaml b/openapi/components/schemas/common/VndAccountInfo.yaml new file mode 100644 index 00000000..584a0661 --- /dev/null +++ b/openapi/components/schemas/common/VndAccountInfo.yaml @@ -0,0 +1,16 @@ +type: object +required: +- accountType +- bankName +- accountNumber +properties: + accountType: + type: string + enum: + - VND_ACCOUNT + bankName: + type: string + description: The bank name of the bank + accountNumber: + type: string + description: The account number of the bank diff --git a/openapi/components/schemas/common/VndBeneficiary.yaml b/openapi/components/schemas/common/VndBeneficiary.yaml new file mode 100644 index 00000000..c3b5722d --- /dev/null +++ b/openapi/components/schemas/common/VndBeneficiary.yaml @@ -0,0 +1,32 @@ +type: object +required: +- beneficiaryType +- fullName +properties: + beneficiaryType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: The full name of the beneficiary + birthDate: + type: string + description: The birth date of the beneficiary + nationality: + type: string + description: The nationality of the beneficiary + email: + type: string + description: The email of the beneficiary + phoneNumber: + type: string + description: The phone number of the beneficiary + registrationNumber: + type: string + description: The registration number of the beneficiary + countryOfResidence: + type: string + description: The country of residence of the beneficiary + address: + $ref: ./Address.yaml diff --git a/openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml index ea40286e..cc967a8c 100644 --- a/openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml +++ b/openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml @@ -7,19 +7,22 @@ properties: discriminator: propertyName: accountType mapping: - US_ACCOUNT: ./UsAccountExternalAccountInfo.yaml - CLABE: ./ClabeAccountExternalAccountInfo.yaml - PIX: ./PixAccountExternalAccountInfo.yaml - IBAN: ./IbanAccountExternalAccountInfo.yaml - UPI: ./UpiAccountExternalAccountInfo.yaml - NGN_ACCOUNT: ./NgnAccountExternalAccountInfo.yaml - CAD_ACCOUNT: ./CadAccountExternalAccountInfo.yaml - GBP_ACCOUNT: ./GbpAccountExternalAccountInfo.yaml - PHP_ACCOUNT: ./PhpAccountExternalAccountInfo.yaml - SGD_ACCOUNT: ./SgdAccountExternalAccountInfo.yaml + GBP_ACCOUNT: ./GbpExternalAccountInfo.yaml + PHP_ACCOUNT: ./PhpExternalAccountInfo.yaml + SGD_ACCOUNT: ./SgdExternalAccountInfo.yaml SPARK_WALLET: ./SparkWalletExternalAccountInfo.yaml LIGHTNING: ./LightningExternalAccountInfo.yaml SOLANA_WALLET: ./SolanaWalletExternalAccountInfo.yaml TRON_WALLET: ./TronWalletExternalAccountInfo.yaml POLYGON_WALLET: ./PolygonWalletExternalAccountInfo.yaml BASE_WALLET: ./BaseWalletExternalAccountInfo.yaml + BRL_ACCOUNT: ./BrlExternalAccountInfo.yaml + DKK_ACCOUNT: ./DkkExternalAccountInfo.yaml + HKD_ACCOUNT: ./HkdExternalAccountInfo.yaml + IDR_ACCOUNT: ./IdrExternalAccountInfo.yaml + INR_ACCOUNT: ./InrExternalAccountInfo.yaml + MXN_ACCOUNT: ./MxnExternalAccountInfo.yaml + MYR_ACCOUNT: ./MyrExternalAccountInfo.yaml + THB_ACCOUNT: ./ThbExternalAccountInfo.yaml + USD_ACCOUNT: ./UsdExternalAccountInfo.yaml + VND_ACCOUNT: ./VndExternalAccountInfo.yaml diff --git a/openapi/components/schemas/external_accounts/BrlExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/BrlExternalAccountInfo.yaml new file mode 100644 index 00000000..ddfd3557 --- /dev/null +++ b/openapi/components/schemas/external_accounts/BrlExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/BrlAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/BrlBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/BrlBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml deleted file mode 100644 index 055b788c..00000000 --- a/openapi/components/schemas/external_accounts/CadAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/CadAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml deleted file mode 100644 index e422f992..00000000 --- a/openapi/components/schemas/external_accounts/ClabeAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/ClabeAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/DkkExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/DkkExternalAccountInfo.yaml new file mode 100644 index 00000000..2a06b867 --- /dev/null +++ b/openapi/components/schemas/external_accounts/DkkExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/DkkAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/DkkBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/DkkBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml b/openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml index 3833c6b3..b6030a15 100644 --- a/openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml +++ b/openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml @@ -1,49 +1,58 @@ oneOf: - - title: US Account - $ref: ./UsAccountExternalAccountInfo.yaml - - title: CLABE Account - $ref: ./ClabeAccountExternalAccountInfo.yaml - - title: PIX Account - $ref: ./PixAccountExternalAccountInfo.yaml - - title: IBAN Account - $ref: ./IbanAccountExternalAccountInfo.yaml - - title: UPI Account - $ref: ./UpiAccountExternalAccountInfo.yaml - - title: NGN Account - $ref: ./NgnAccountExternalAccountInfo.yaml - - title: CAD Account - $ref: ./CadAccountExternalAccountInfo.yaml - - title: GBP Account - $ref: ./GbpAccountExternalAccountInfo.yaml - - title: PHP Account - $ref: ./PhpAccountExternalAccountInfo.yaml - - title: SGD Account - $ref: ./SgdAccountExternalAccountInfo.yaml - - title: Spark Wallet - $ref: ./SparkWalletExternalAccountInfo.yaml - - title: Lightning - $ref: ./LightningExternalAccountInfo.yaml - - title: Solana Wallet - $ref: ./SolanaWalletExternalAccountInfo.yaml - - title: Tron Wallet - $ref: ./TronWalletExternalAccountInfo.yaml - - title: Polygon Wallet - $ref: ./PolygonWalletExternalAccountInfo.yaml - - title: Base Wallet - $ref: ./BaseWalletExternalAccountInfo.yaml +- title: BRL Account + $ref: ./BrlExternalAccountInfo.yaml +- title: DKK Account + $ref: ./DkkExternalAccountInfo.yaml +- title: GBP Account + $ref: ./GbpExternalAccountInfo.yaml +- title: HKD Account + $ref: ./HkdExternalAccountInfo.yaml +- title: IDR Account + $ref: ./IdrExternalAccountInfo.yaml +- title: INR Account + $ref: ./InrExternalAccountInfo.yaml +- title: MXN Account + $ref: ./MxnExternalAccountInfo.yaml +- title: MYR Account + $ref: ./MyrExternalAccountInfo.yaml +- title: PHP Account + $ref: ./PhpExternalAccountInfo.yaml +- title: SGD Account + $ref: ./SgdExternalAccountInfo.yaml +- title: THB Account + $ref: ./ThbExternalAccountInfo.yaml +- title: USD Account + $ref: ./UsdExternalAccountInfo.yaml +- title: VND Account + $ref: ./VndExternalAccountInfo.yaml +- title: Spark Wallet + $ref: ./SparkWalletExternalAccountInfo.yaml +- title: Lightning + $ref: ./LightningExternalAccountInfo.yaml +- title: Solana Wallet + $ref: ./SolanaWalletExternalAccountInfo.yaml +- title: Tron Wallet + $ref: ./TronWalletExternalAccountInfo.yaml +- title: Polygon Wallet + $ref: ./PolygonWalletExternalAccountInfo.yaml +- title: Base Wallet + $ref: ./BaseWalletExternalAccountInfo.yaml discriminator: propertyName: accountType mapping: - US_ACCOUNT: ./UsAccountExternalAccountInfo.yaml - CLABE: ./ClabeAccountExternalAccountInfo.yaml - PIX: ./PixAccountExternalAccountInfo.yaml - IBAN: ./IbanAccountExternalAccountInfo.yaml - UPI: ./UpiAccountExternalAccountInfo.yaml - NGN_ACCOUNT: ./NgnAccountExternalAccountInfo.yaml - CAD_ACCOUNT: ./CadAccountExternalAccountInfo.yaml - GBP_ACCOUNT: ./GbpAccountExternalAccountInfo.yaml - PHP_ACCOUNT: ./PhpAccountExternalAccountInfo.yaml - SGD_ACCOUNT: ./SgdAccountExternalAccountInfo.yaml + BRL_ACCOUNT: ./BrlExternalAccountInfo.yaml + DKK_ACCOUNT: ./DkkExternalAccountInfo.yaml + GBP_ACCOUNT: ./GbpExternalAccountInfo.yaml + HKD_ACCOUNT: ./HkdExternalAccountInfo.yaml + IDR_ACCOUNT: ./IdrExternalAccountInfo.yaml + INR_ACCOUNT: ./InrExternalAccountInfo.yaml + MXN_ACCOUNT: ./MxnExternalAccountInfo.yaml + MYR_ACCOUNT: ./MyrExternalAccountInfo.yaml + PHP_ACCOUNT: ./PhpExternalAccountInfo.yaml + SGD_ACCOUNT: ./SgdExternalAccountInfo.yaml + THB_ACCOUNT: ./ThbExternalAccountInfo.yaml + USD_ACCOUNT: ./UsdExternalAccountInfo.yaml + VND_ACCOUNT: ./VndExternalAccountInfo.yaml SPARK_WALLET: ./SparkWalletExternalAccountInfo.yaml LIGHTNING: ./LightningExternalAccountInfo.yaml SOLANA_WALLET: ./SolanaWalletExternalAccountInfo.yaml diff --git a/openapi/components/schemas/external_accounts/ExternalAccountType.yaml b/openapi/components/schemas/external_accounts/ExternalAccountType.yaml index 66c8d8b3..be9f55ab 100644 --- a/openapi/components/schemas/external_accounts/ExternalAccountType.yaml +++ b/openapi/components/schemas/external_accounts/ExternalAccountType.yaml @@ -1,12 +1,5 @@ type: string enum: - - US_ACCOUNT - - CLABE - - PIX - - IBAN - - UPI - - NGN_ACCOUNT - - CAD_ACCOUNT - GBP_ACCOUNT - PHP_ACCOUNT - SGD_ACCOUNT @@ -16,5 +9,15 @@ enum: - TRON_WALLET - POLYGON_WALLET - BASE_WALLET + - BRL_ACCOUNT + - DKK_ACCOUNT + - HKD_ACCOUNT + - IDR_ACCOUNT + - INR_ACCOUNT + - MXN_ACCOUNT + - MYR_ACCOUNT + - THB_ACCOUNT + - USD_ACCOUNT + - VND_ACCOUNT description: Type of external account or wallet -example: US_ACCOUNT +example: GBP_ACCOUNT diff --git a/openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml deleted file mode 100644 index d9d01c90..00000000 --- a/openapi/components/schemas/external_accounts/GbpAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/GbpAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/GbpExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/GbpExternalAccountInfo.yaml new file mode 100644 index 00000000..53a6851a --- /dev/null +++ b/openapi/components/schemas/external_accounts/GbpExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/GbpAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/GbpBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/GbpBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/HkdExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/HkdExternalAccountInfo.yaml new file mode 100644 index 00000000..95a14095 --- /dev/null +++ b/openapi/components/schemas/external_accounts/HkdExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/HkdAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/HkdBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/HkdBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml deleted file mode 100644 index 085cdbc8..00000000 --- a/openapi/components/schemas/external_accounts/IbanAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/IbanAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/IdrExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/IdrExternalAccountInfo.yaml new file mode 100644 index 00000000..97057199 --- /dev/null +++ b/openapi/components/schemas/external_accounts/IdrExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/IdrAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/IdrBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/IdrBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/InrExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/InrExternalAccountInfo.yaml new file mode 100644 index 00000000..a2d8c817 --- /dev/null +++ b/openapi/components/schemas/external_accounts/InrExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/InrAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/InrBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/InrBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/MxnExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/MxnExternalAccountInfo.yaml new file mode 100644 index 00000000..9effce05 --- /dev/null +++ b/openapi/components/schemas/external_accounts/MxnExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/MxnAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/MxnBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/MxnBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/MyrExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/MyrExternalAccountInfo.yaml new file mode 100644 index 00000000..a0d4af0c --- /dev/null +++ b/openapi/components/schemas/external_accounts/MyrExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/MyrAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/MyrBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/MyrBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml deleted file mode 100644 index 959e1bfd..00000000 --- a/openapi/components/schemas/external_accounts/NgnAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,27 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/NgnAccountInfo.yaml - - type: object - required: - - purposeOfPayment - - beneficiary - properties: - purposeOfPayment: - type: string - enum: - - GIFT - - SELF - - GOODS_OR_SERVICES - - EDUCATION - - HEALTH_OR_MEDICAL - - REAL_ESTATE_PURCHASE - - LOAN_PAYMENT - - TAX_PAYMENT - - UTILITY_BILL - - DONATION - - TRAVEL - - OTHER - description: Purpose of payment - example: GOODS_OR_SERVICES - beneficiary: - $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml deleted file mode 100644 index d69becbe..00000000 --- a/openapi/components/schemas/external_accounts/PhpAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/PhpAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/PhpExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PhpExternalAccountInfo.yaml new file mode 100644 index 00000000..605d3f18 --- /dev/null +++ b/openapi/components/schemas/external_accounts/PhpExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/PhpAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/PhpBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/PhpBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml deleted file mode 100644 index f492c457..00000000 --- a/openapi/components/schemas/external_accounts/PixAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/PixAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml diff --git a/openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml deleted file mode 100644 index 7e4cca1e..00000000 --- a/openapi/components/schemas/external_accounts/SgdAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/SgdAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/SgdExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/SgdExternalAccountInfo.yaml new file mode 100644 index 00000000..3965a0a9 --- /dev/null +++ b/openapi/components/schemas/external_accounts/SgdExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/SgdAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/SgdBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/SgdBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/ThbExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/ThbExternalAccountInfo.yaml new file mode 100644 index 00000000..ed7328ec --- /dev/null +++ b/openapi/components/schemas/external_accounts/ThbExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/ThbAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/ThbBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/ThbBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml deleted file mode 100644 index e7675259..00000000 --- a/openapi/components/schemas/external_accounts/UpiAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/UpiAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml deleted file mode 100644 index 6fa6a96e..00000000 --- a/openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: ./BaseExternalAccountInfo.yaml - - $ref: ../common/UsAccountInfo.yaml - - type: object - required: - - beneficiary - properties: - beneficiary: - $ref: ./BeneficiaryOneOf.yaml \ No newline at end of file diff --git a/openapi/components/schemas/external_accounts/UsdExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/UsdExternalAccountInfo.yaml new file mode 100644 index 00000000..68ce09ff --- /dev/null +++ b/openapi/components/schemas/external_accounts/UsdExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/UsdAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/UsdBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/UsdBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml diff --git a/openapi/components/schemas/external_accounts/VndExternalAccountInfo.yaml b/openapi/components/schemas/external_accounts/VndExternalAccountInfo.yaml new file mode 100644 index 00000000..5ccce3e3 --- /dev/null +++ b/openapi/components/schemas/external_accounts/VndExternalAccountInfo.yaml @@ -0,0 +1,18 @@ +allOf: +- $ref: ./BaseExternalAccountInfo.yaml +- $ref: ../common/VndAccountInfo.yaml +- type: object + required: + - beneficiary + properties: + beneficiary: + oneOf: + - title: Individual Beneficiary + $ref: ../common/VndBeneficiary.yaml + - title: Business Beneficiary + $ref: ./BusinessBeneficiary.yaml + discriminator: + propertyName: beneficiaryType + mapping: + INDIVIDUAL: ../common/VndBeneficiary.yaml + BUSINESS: ./BusinessBeneficiary.yaml From 420fc413ea195279320c0d516940663bb5924886 Mon Sep 17 00:00:00 2001 From: Jeremy Klein Date: Tue, 17 Feb 2026 09:10:04 -0800 Subject: [PATCH 2/8] [skill] Add a note about the format of list responses. (#200) --- .claude/skills/grid-api/SKILL.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.claude/skills/grid-api/SKILL.md b/.claude/skills/grid-api/SKILL.md index 47c2dd3f..463cf94b 100644 --- a/.claude/skills/grid-api/SKILL.md +++ b/.claude/skills/grid-api/SKILL.md @@ -434,7 +434,7 @@ Use this flow when the user asks for a "realtime quote" or "just in time" funded ## Error Handling -API responses follow this structure on success: +Single-resource responses: ```json { @@ -444,6 +444,19 @@ API responses follow this structure on success: } ``` +List responses return results in a `data` array with pagination fields: + +```json +{ + "data": [ ... ], + "hasMore": true, + "nextCursor": "...", + "totalCount": 42 +} +``` + +Use `jq '.data[]'` to iterate results or `jq '[.data[] | select(.currency == "NGN")]'` to filter. + On error: ```json From 163d78fa1dce170545aa225286e92250f66e4003 Mon Sep 17 00:00:00 2001 From: Jeremy Klein Date: Tue, 17 Feb 2026 10:23:51 -0800 Subject: [PATCH 3/8] Reduce CLAUDE.md to essentials with guide from claude. (#201) --- CLAUDE.md | 260 +++++++++--------------------------------------------- 1 file changed, 41 insertions(+), 219 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 50456e43..a7ae0235 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,237 +1,59 @@ # CLAUDE.md -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +Documentation-only repo (no application code): OpenAPI spec (YAML) + Mintlify docs (MDX). +Grid is an API for global payments across fiat, stablecoins, and Bitcoin. -## Project Overview +## Critical Rules -This is the **Grid API** documentation repository. Grid is an API that enables modern financial institutions to send and receive global payments across fiat, stablecoins, and Bitcoin. The repository contains: +- **Edit OpenAPI in `openapi/`** — never edit the root `openapi.yaml` directly (it's generated by bundling) +- Run `make build` after any OpenAPI changes to rebundle +- Run `make lint` before committing +- **Mintlify CLI must be version 4.2.284** — newer versions (e.g., 4.2.312) have a bug where API reference pages render blank. Install with `npm install -g mintlify@4.2.284 --force` +- **Requires Node.js v20 or v22** — Mintlify does not support Node 25+. If needed: `export PATH="/opt/homebrew/opt/node@22/bin:$PATH"` +- Use snippets from `mintlify/snippets/` instead of duplicating content across use cases +- Follow writing standards in `mintlify/CLAUDE.md` for all documentation content +- MDX files require frontmatter with `title` and `description` +- Do not use `React.useEffect` in MDX — it breaks Mintlify's acorn parser. `React.useState` is fine. -1. **OpenAPI specification** (split into modular YAML files) -2. **Mintlify documentation** (MDX files with guides, tutorials, and API reference) - -This is a documentation-only repository - there is no application code. - -## Common Commands - -### Building and Linting - -```bash -# Install dependencies -npm install -# or -make install - -# Build OpenAPI schema (bundles split files into single openapi.yaml) -npm run build:openapi -# or -make build - -# Lint OpenAPI schema and markdown files -npm run lint -# or -make lint - -# Lint only OpenAPI -npm run lint:openapi -# or -make lint-openapi - -# Lint only markdown -npm run lint:markdown -# or -make lint-markdown -``` - -### Documentation Development +## Commands ```bash -# Serve Mintlify documentation locally (requires mint CLI installed globally) -cd mintlify && mint dev -# or -make mint +make install # Install dependencies +make build # Bundle OpenAPI spec (openapi/ → openapi.yaml + mintlify/openapi.yaml) +make lint # Lint OpenAPI + markdown + run mint openapi-check +make lint-openapi # Lint OpenAPI only +make lint-markdown # Lint markdown only +make mint # Serve docs locally (cd mintlify && mint dev) ``` -## Architecture - -### OpenAPI Schema Structure - -The OpenAPI specification uses a **split-file architecture** managed by Redocly: - -- **Source files**: `openapi/` directory contains modular YAML files - - `openapi/openapi.yaml` - Root specification with references - - `openapi/paths/` - Endpoint definitions organized by domain - - `openapi/components/schemas/` - Reusable schema definitions - - `openapi/webhooks/` - Webhook event definitions - -- **Built file**: `openapi.yaml` - Bundled specification at repository root (also copied to `mintlify/openapi.yaml`) - -**Important**: When editing OpenAPI specs, edit files in `openapi/` directory, then run `npm run build:openapi` to bundle. The root `openapi.yaml` is generated and should not be edited directly. - -### Domain Organization - -The API is organized into four main use cases, reflected in both the OpenAPI paths and Mintlify docs: - -1. **Payouts** - Send value instantly across currencies and borders - - Customer management (`/customers`) - - Internal accounts (`/customers/internal-accounts`, `/platform/internal-accounts`) - - External accounts (`/customers/external-accounts`, `/platform/external-accounts`) - - Quotes and transactions - -2. **Ramps** - Convert between crypto and fiat - - Customer onboarding with KYC - - Plaid integration for bank account linking - - Fiat-to-crypto and crypto-to-fiat conversion flows - - Self-custody wallet support - -3. **Rewards & Cashback** - Deliver micro-payouts at scale - - Similar structure to Payouts - - Optimized for high-volume, low-value transactions - -4. **Global P2P (Remittances)** - Accept funds via bank transfers, wallets, or UMAs - - User management with UMA addresses (`/users` endpoints in actual API) - - UMA address resolution (`/receiver/uma/{receiverUmaAddress}`) - - Payment approval/rejection flows - - Invitations system (`/invitations`) - -### Key Concepts - -- **Customers**: End users of the platform (used in Payouts, Ramps, Rewards) -- **Users**: Distinction unclear from docs, but appears related to UMA-based flows -- **Internal Accounts**: Platform-managed accounts for holding funds -- **External Accounts**: Bank accounts connected for deposits/withdrawals -- **Quotes**: Time-limited exchange rate locks for cross-currency transactions -- **Transactions**: Payment records (incoming/outgoing) -- **UMA Addresses**: Universal Money Addresses (e.g., `$alice@example.com`) for P2P payments - -### Mintlify Documentation Structure - -- `mintlify/docs.json` - Navigation configuration with tabs for each use case -- `mintlify/index.mdx` - Landing page -- `mintlify/{use-case}/` - Use case-specific documentation - - `index.mdx` - Use case overview - - `quickstart.mdx` - Quick start guide - - `onboarding/` or `developer-guides/` - Implementation guides - - `accounts/`, `payment-flow/`, etc. - Topic-specific guides -- `mintlify/snippets/` - Reusable MDX snippets (imported into multiple docs) -- `mintlify/api-reference/` - API authentication and environment docs -- `mintlify/developer-resources/` - SDKs, tools, Postman collections -- `mintlify/changelog.mdx` - API changelog - -### Shared Documentation Patterns - -The repository uses **MDX snippets** to avoid duplication across use cases. Common snippets in `mintlify/snippets/`: - -- `platform-config-currency-api-webhooks.mdx` - Platform configuration -- `internal-accounts.mdx` - Internal account management -- `external-accounts.mdx` - External account management -- `webhooks.mdx` - Webhook setup and verification -- `kyc-onboarding.mdx` - KYC onboarding process -- `plaid-integration.mdx` - Plaid integration -- `terminology.mdx` - Terminology definitions - -Import these snippets rather than duplicating content. - -## Authentication - -The API uses HTTP Basic Authentication with format `:` (Base64 encoded). All endpoints require authentication except the webhook endpoints (which use signature verification instead). +## File Structure -Webhooks use **P-256 ECDSA signatures** in the `X-Grid-Signature` header for verification. - -## Important Notes - -### OpenAPI Development - -- Use Redocly for bundling and linting: `@redocly/cli` -- Configuration in `.redocly.yaml` -- Lint rules include operation descriptions, operation IDs, security definitions -- Always run `npm run lint:openapi` before committing OpenAPI changes - -### Mintlify Development - -- MDX files must include frontmatter with `title` and `description` -- Follow the writing standards in `mintlify/CLAUDE.md` -- Use second-person voice ("you") -- Test all code examples -- Use relative paths for internal links -- The mintlify subdirectory has its own CLAUDE.md with additional guidance - -### Mintlify CLI Version (Important) - -**Use Mintlify CLI version 4.2.284** for local development. Newer versions (e.g., 4.2.312) have a bug where the API reference pages render blank when using the palm theme with OpenAPI auto-generation. - -**Requires Node.js LTS (v20 or v22)** - Mintlify does not support Node 25+. If you have a newer Node version installed, use Node 22 LTS: - -```bash -# Install Node 22 via Homebrew (if needed) -brew install node@22 - -# Run mint dev with Node 22 -export PATH="/opt/homebrew/opt/node@22/bin:$PATH" -cd mintlify && mint dev - -# Or add to ~/.zshrc to make permanent: -# export PATH="/opt/homebrew/opt/node@22/bin:$PATH" ``` - -```bash -# Check current version -mintlify --version - -# If needed, install the working version -npm install -g mintlify@4.2.284 --force +openapi/ # Source OpenAPI YAML (edit here) + openapi.yaml # Root spec with $ref references + paths/ # Endpoint definitions by domain + components/schemas/ # Reusable schema definitions + webhooks/ # Webhook event definitions +openapi.yaml # Generated bundle (don't edit) +mintlify/ # Mintlify documentation (MDX) + docs.json # Navigation and theme config + snippets/ # Shared MDX snippets (use these to avoid duplication) + styles/base.css # CSS overrides +.redocly.yaml # Redocly bundler/linter config ``` -### Troubleshooting: API Reference Not Showing - -If the API reference pages appear blank (only showing title and navigation, no endpoint details): - -1. **Restart the dev server** - hot reload sometimes fails: - ```bash - pkill -f "mint.*dev" - cd mintlify && mint dev - ``` - -2. **Check CLI version** - ensure you're on 4.2.284 (see above) - -3. **Verify OpenAPI spec** - run `mint openapi-check openapi.yaml` in the mintlify folder - -### Documentation Philosophy - -- **Document just enough** for user success - balance between too much and too little -- **Avoid duplication** - use snippets for shared content across use cases -- **Make content evergreen** when possible -- **Check existing patterns** for consistency before making changes -- **Search before adding** - look for existing information before creating new content - -### CSS Styling Tips (Mintlify Overrides) - -When overriding Mintlify's default styles in `mintlify/styles/base.css`: - -- **Tailwind utility classes are hard to override directly** - Classes like `mb-3.5` have high specificity. Even with `!important` and complex selectors, they often won't budge. - -- **Workaround: Use negative margins on sibling elements** - Instead of reducing `margin-bottom` on an element, add negative `margin-top` to the following sibling. This achieves the same visual effect. - -- **Test selectors with visible properties first** - If a style isn't applying, add `border: 2px solid red !important;` to confirm the selector is matching. If the border shows, the selector works but something else is overriding your property. - -- **HeadlessUI portal elements** - Mobile nav and modals render inside `#headlessui-portal-root`. Use this in selectors for higher specificity: `#headlessui-portal-root #mobile-nav ...` - -- **Mobile nav lives in `#mobile-nav`** - Target mobile-specific styles with `#mobile-nav` or `div#mobile-nav` selectors to avoid affecting desktop sidebar. - -- **Negative margins for edge-to-edge layouts** - To break out of parent padding (e.g., make nav items edge-to-edge), use negative margins equal to the parent's padding, then add your own padding inside. - -### MDX Component Limitations - -- **`React.useEffect` breaks the MDX parser** - Mintlify uses acorn to parse MDX, and it chokes on `useEffect`. Avoid using hooks that require cleanup or side effects. - -- **`React.useState` works fine** - Simple state management is supported. +## OpenAPI -- **Keep components simple** - If you need complex interactivity, consider using CSS-only solutions or restructuring to avoid problematic hooks. +Bundled and linted with Redocly (`@redocly/cli`), configured in `.redocly.yaml`. Lint rules enforce operation descriptions, operation IDs, and security definitions. -## Environments +## CSS Overrides (mintlify/styles/base.css) -- **Production**: `https://api.lightspark.com/grid/2025-10-13` -- **Sandbox**: Available for testing (see sandbox endpoints `/sandbox/send`, `/sandbox/receive`) +- Tailwind utility classes (e.g., `mb-3.5`) are hard to override even with `!important` — use negative margins on sibling elements as a workaround +- Test selectors with `border: 2px solid red !important` to confirm they match before debugging property conflicts +- Mobile nav is in `#mobile-nav`; modals/portals are in `#headlessui-portal-root` -## Support +## Troubleshooting: Blank API Reference Pages -For questions or issues: support@lightspark.com +1. Restart dev server: `pkill -f "mint.*dev" && cd mintlify && mint dev` +2. Verify CLI version is 4.2.284 +3. Run `cd mintlify && mint openapi-check openapi.yaml` From afa4387abe8e230935c9b6146a37cd8fde45af02 Mon Sep 17 00:00:00 2001 From: Peng Ying Date: Tue, 17 Feb 2026 10:24:44 -0800 Subject: [PATCH 4/8] fix: extracting counterparty information to fix webhook generation (#190) ### TL;DR Extracted `CounterpartyInformation` into a separate reusable schema component. ### What changed? - Created a new schema component `CounterpartyInformation` that was previously defined inline - Updated references in the `Transaction` schema to use the new component via `$ref` - Applied these changes consistently across both the main OpenAPI file and the modular component files ### How to test? 1. Validate that the OpenAPI spec still compiles correctly 2. Verify that API documentation renders the `CounterpartyInformation` schema properly 3. Confirm that any endpoints using transactions with counterparty information still function as expected ### Why make this change? This refactoring improves the OpenAPI specification by: - Promoting reusability of the `CounterpartyInformation` schema - Making the schema more maintainable by defining it in a single location - Following best practices for OpenAPI schema organization - Ensuring consistency if this schema needs to be referenced from other components in the future --- mintlify/openapi.yaml | 16 +++++++++------- openapi.yaml | 16 +++++++++------- .../transactions/CounterpartyInformation.yaml | 7 +++++++ .../schemas/transactions/Transaction.yaml | 8 +------- 4 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 openapi/components/schemas/transactions/CounterpartyInformation.yaml diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index af4f0f20..0e913e07 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -6553,13 +6553,7 @@ components: description: Optional memo or description for the payment example: 'Payment for invoice #1234' counterpartyInformation: - type: object - description: Additional information about the counterparty, if available and relevant to the transaction and platform. Only applicable for transactions to/from UMA addresses. - additionalProperties: true - example: - FULL_NAME: John Sender - BIRTH_DATE: '1985-06-15' - NATIONALITY: DE + $ref: '#/components/schemas/CounterpartyInformation' discriminator: propertyName: type mapping: @@ -6925,6 +6919,14 @@ components: mapping: ACCOUNT: '#/components/schemas/AccountTransactionDestination' UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' + CounterpartyInformation: + type: object + description: Additional information about the counterparty, if available and relevant to the transaction and platform. Only applicable for transactions to/from UMA addresses. + additionalProperties: true + example: + FULL_NAME: John Sender + BIRTH_DATE: '1985-06-15' + NATIONALITY: DE CurrencyPreference: type: object required: diff --git a/openapi.yaml b/openapi.yaml index af4f0f20..0e913e07 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6553,13 +6553,7 @@ components: description: Optional memo or description for the payment example: 'Payment for invoice #1234' counterpartyInformation: - type: object - description: Additional information about the counterparty, if available and relevant to the transaction and platform. Only applicable for transactions to/from UMA addresses. - additionalProperties: true - example: - FULL_NAME: John Sender - BIRTH_DATE: '1985-06-15' - NATIONALITY: DE + $ref: '#/components/schemas/CounterpartyInformation' discriminator: propertyName: type mapping: @@ -6925,6 +6919,14 @@ components: mapping: ACCOUNT: '#/components/schemas/AccountTransactionDestination' UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' + CounterpartyInformation: + type: object + description: Additional information about the counterparty, if available and relevant to the transaction and platform. Only applicable for transactions to/from UMA addresses. + additionalProperties: true + example: + FULL_NAME: John Sender + BIRTH_DATE: '1985-06-15' + NATIONALITY: DE CurrencyPreference: type: object required: diff --git a/openapi/components/schemas/transactions/CounterpartyInformation.yaml b/openapi/components/schemas/transactions/CounterpartyInformation.yaml new file mode 100644 index 00000000..9bca07f4 --- /dev/null +++ b/openapi/components/schemas/transactions/CounterpartyInformation.yaml @@ -0,0 +1,7 @@ +type: object +description: Additional information about the counterparty, if available and relevant to the transaction and platform. Only applicable for transactions to/from UMA addresses. +additionalProperties: true +example: + FULL_NAME: John Sender + BIRTH_DATE: '1985-06-15' + NATIONALITY: DE diff --git a/openapi/components/schemas/transactions/Transaction.yaml b/openapi/components/schemas/transactions/Transaction.yaml index fe0aa29b..9fb20ba9 100644 --- a/openapi/components/schemas/transactions/Transaction.yaml +++ b/openapi/components/schemas/transactions/Transaction.yaml @@ -47,13 +47,7 @@ properties: description: Optional memo or description for the payment example: 'Payment for invoice #1234' counterpartyInformation: - type: object - description: Additional information about the counterparty, if available and relevant to the transaction and platform. Only applicable for transactions to/from UMA addresses. - additionalProperties: true - example: - FULL_NAME: John Sender - BIRTH_DATE: '1985-06-15' - NATIONALITY: DE + $ref: ./CounterpartyInformation.yaml discriminator: propertyName: type mapping: From b7f5a431bc264181dece5f32b76fe012eb3a5a4c Mon Sep 17 00:00:00 2001 From: patcapulong <58444376+patcapulong@users.noreply.github.com> Date: Tue, 17 Feb 2026 10:26:43 -0800 Subject: [PATCH 5/8] feat: add Building with AI page (#179) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - New documentation page at **Get started > Overview > Building with AI** (before FAQ) - Helps developers use AI coding assistants (Claude Code, Cursor, Windsurf) with the Grid API - Covers: skill installation, credential setup, example prompts by use case, CLI command reference, llms.txt discovery, and tips for best results - Uses custom FeatureCard components with new Central Icons (magnifying-glass, prompt, arrow-path-right, bug, console-sparkle) ## Test plan - [x] Page renders at `/platform-overview/building-with-ai` - [x] Appears in sidebar under Overview, before FAQ - [x] Sidebar icon (console-sparkle) renders correctly - [x] FeatureCards display with colored icons - [x] Code blocks, tables, and Tip component render properly - [x] Internal links (`/llms.txt`, `/llms-full.txt`) work 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 Co-authored-by: Jeremy Klein Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- .gitignore | 3 + mintlify/docs.json | 1 + .../heroes/hero-building-with-ai-dark.svg | 51 ++++++ .../heroes/hero-building-with-ai-light.svg | 51 ++++++ mintlify/images/icons/arrow-path-right.svg | 3 + mintlify/images/icons/bug.svg | 3 + mintlify/images/icons/console-sparkle.svg | 3 + mintlify/images/icons/magnifying-glass.svg | 3 + mintlify/images/icons/prompt.svg | 3 + .../platform-overview/building-with-ai.mdx | 160 ++++++++++++++++++ 10 files changed, 281 insertions(+) create mode 100644 mintlify/images/heroes/hero-building-with-ai-dark.svg create mode 100644 mintlify/images/heroes/hero-building-with-ai-light.svg create mode 100644 mintlify/images/icons/arrow-path-right.svg create mode 100644 mintlify/images/icons/bug.svg create mode 100644 mintlify/images/icons/console-sparkle.svg create mode 100644 mintlify/images/icons/magnifying-glass.svg create mode 100644 mintlify/images/icons/prompt.svg create mode 100644 mintlify/platform-overview/building-with-ai.mdx diff --git a/.gitignore b/.gitignore index 23810883..9c307619 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,6 @@ figma-*.md # Personal todo files TODO-*.md + +# Icon build script (local tool, requires license key) +scripts/export-icons.js diff --git a/mintlify/docs.json b/mintlify/docs.json index 99ac2c9b..b5ef95f7 100644 --- a/mintlify/docs.json +++ b/mintlify/docs.json @@ -44,6 +44,7 @@ "platform-overview/introduction/what-is-grid", "platform-overview/capabilities", "platform-overview/use-cases", + "platform-overview/building-with-ai", "platform-overview/introduction/faq" ] }, diff --git a/mintlify/images/heroes/hero-building-with-ai-dark.svg b/mintlify/images/heroes/hero-building-with-ai-dark.svg new file mode 100644 index 00000000..9f4e8e84 --- /dev/null +++ b/mintlify/images/heroes/hero-building-with-ai-dark.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mintlify/images/heroes/hero-building-with-ai-light.svg b/mintlify/images/heroes/hero-building-with-ai-light.svg new file mode 100644 index 00000000..51c296f4 --- /dev/null +++ b/mintlify/images/heroes/hero-building-with-ai-light.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mintlify/images/icons/arrow-path-right.svg b/mintlify/images/icons/arrow-path-right.svg new file mode 100644 index 00000000..2e760595 --- /dev/null +++ b/mintlify/images/icons/arrow-path-right.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/mintlify/images/icons/bug.svg b/mintlify/images/icons/bug.svg new file mode 100644 index 00000000..db00ea9b --- /dev/null +++ b/mintlify/images/icons/bug.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/mintlify/images/icons/console-sparkle.svg b/mintlify/images/icons/console-sparkle.svg new file mode 100644 index 00000000..046893dc --- /dev/null +++ b/mintlify/images/icons/console-sparkle.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/mintlify/images/icons/magnifying-glass.svg b/mintlify/images/icons/magnifying-glass.svg new file mode 100644 index 00000000..405eeba5 --- /dev/null +++ b/mintlify/images/icons/magnifying-glass.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/mintlify/images/icons/prompt.svg b/mintlify/images/icons/prompt.svg new file mode 100644 index 00000000..79ea07d5 --- /dev/null +++ b/mintlify/images/icons/prompt.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/mintlify/platform-overview/building-with-ai.mdx b/mintlify/platform-overview/building-with-ai.mdx new file mode 100644 index 00000000..b6a8508c --- /dev/null +++ b/mintlify/platform-overview/building-with-ai.mdx @@ -0,0 +1,160 @@ +--- +icon: "/images/icons/console-sparkle.svg" +mode: "wide" +title: "Building with AI" +description: "Use AI coding assistants like Claude Code, Cursor, and Codex to explore, build, and debug with the Grid API" +"og:image": "/images/og/og-get-started.png" +--- + +import { FeatureCard, FeatureCardGrid } from '/snippets/feature-card.mdx'; + +Building with AI hero +Building with AI hero + +Grid's documentation, OpenAPI spec, and CLI are designed to work with AI coding assistants like Claude Code, Cursor, and Codex. Whether you're exploring the API for the first time or building a production integration, AI tools can help you move faster. + +## What AI assistants can do with Grid + + + + Ask questions about endpoints, request/response schemas, supported currencies, and payment rails + + + Use the Grid Skill to create customers, manage accounts, get quotes, and send payments directly from your AI assistant + + + Get step-by-step guidance for multi-step flows like international payouts, on/off-ramps, and KYC onboarding + + + Troubleshoot error codes, validate account details, and diagnose failed transactions + + + +## AI-accessible documentation + +These Grid docs are automatically available to LLMs and AI tools in machine-readable formats — no configuration needed. + +### llms.txt + +Grid docs generate [llms.txt](https://llmstxt.org/) files that give AI tools a structured index of all documentation: + +- [`/llms.txt`](/llms.txt) — Concise index of all pages with titles and descriptions +- [`/llms-full.txt`](/llms-full.txt) — Complete documentation content in a single file + +These are generated automatically and always up to date. Use `llms-full.txt` when you want to give an AI assistant full context about the Grid API in one shot. + +### Markdown export + +Each page in the Grid docs is automatically available as a Markdown file simply by adding `.md` to the end of the URL. + +For example, the [Building with AI](/platform-overview/building-with-ai) page is available as [`/platform-overview/building-with-ai.md`](/platform-overview/building-with-ai.md). + + +You can also copy any page's content as Markdown with the keyboard shortcut Command + C (Ctrl + C on Windows) and paste it directly into ChatGPT, Claude, or any AI assistant for context-aware help with your specific question. + + +## Install the Grid API agent skill + +The Grid API skill gives [Claude Code](https://docs.anthropic.com/en/docs/claude-code) or another Skill-compatible agent full access to the Grid API via a built-in CLI. Install it with: + +```bash +npx skills add lightsparkdev/grid-api +``` + +Make sure to install it for whichever agent you're using. For example, if you're using Claude Code, +you'll need to explicitly select Claude Code in the agent installation selection screen. + +Once installed, you can start asking questions immediately. To execute API operations, you'll need to +configure your credentials. + +### Configure your credentials + +To set your grid credentials, simply ask the agent to help you configure them: + +``` +Help me configure my Grid API credentials. +``` + +It'll prompt you for your API Token ID and Client Secret, validate them, and save to `~/.grid-credentials` for future use. + + +Start in the sandbox environment to experiment safely. The Skill is great at generating fake account data to help you test different flows. + + +## Example prompts + +Try these prompts in Claude Code or paste them into your AI assistant of choice: + +### Getting started +``` +What currencies does Grid support? Show me the coverage by country. +``` +``` +Walk me through the steps to send a payout from USD to MXN via CLABE. +``` + +### Payouts +``` +Create an external account for a bank in Mexico using CLABE, then create +a quote to send $500 USD and show me the exchange rate before executing. +``` +``` +Send $100 to $alice@example.com via UMA. Show me the exchange rate first. +``` + +### On/off-ramps +``` +Help me set up a fiat-to-crypto on-ramp. I want to convert USD to BTC +using a Spark wallet. +``` +``` +I need to off-ramp USDC to a US bank account. Walk me through the full flow. +``` + +### Account management +``` +List all my customers and their KYC status in a table. +``` +``` +Create a new individual customer and generate a KYC onboarding link. +``` + +### Debugging +``` +I'm getting QUOTE_EXPIRED errors. What's happening and how do I fix it? +``` +``` +My external account creation is failing for a Nigerian bank account. +What fields am I missing? +``` + +## Tips for best results + +1. **Be specific about your use case** — "Send a payout to Brazil via PIX" gets better results than "help me send money" +2. **Start with the sandbox** — Ask the AI to use sandbox mode so you can experiment without real funds +3. **Give context** — Paste the relevant docs page or point the AI to `/llms-full.txt` for full API context +4. **Iterate on errors** — If an API call fails, paste the error and ask the AI to diagnose it From 1109684a92499b282d4f78f2a5e0cfb4bcbb3954 Mon Sep 17 00:00:00 2001 From: Shreya Vissamsetti Date: Wed, 18 Feb 2026 09:18:01 -0800 Subject: [PATCH 6/8] Remove originalTransactionId (#203) more leftover from removing the retry quotes api --- mintlify/openapi.yaml | 4 ---- openapi.yaml | 4 ---- .../components/schemas/transactions/OutgoingTransaction.yaml | 5 ----- 3 files changed, 13 deletions(-) diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index 0e913e07..9ee2ad7a 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -6812,10 +6812,6 @@ components: type: string description: The ID of the quote that was used to trigger this payment example: Quote:019542f5-b3e7-1d02-0000-000000000006 - originalTransactionId: - type: string - description: ID of the original transaction that this transaction is retrying, if applicable - example: Transaction:019542f5-b3e7-1d02-0000-000000000003 paymentInstructions: type: array description: Payment instructions for executing the payment. diff --git a/openapi.yaml b/openapi.yaml index 0e913e07..9ee2ad7a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6812,10 +6812,6 @@ components: type: string description: The ID of the quote that was used to trigger this payment example: Quote:019542f5-b3e7-1d02-0000-000000000006 - originalTransactionId: - type: string - description: ID of the original transaction that this transaction is retrying, if applicable - example: Transaction:019542f5-b3e7-1d02-0000-000000000003 paymentInstructions: type: array description: Payment instructions for executing the payment. diff --git a/openapi/components/schemas/transactions/OutgoingTransaction.yaml b/openapi/components/schemas/transactions/OutgoingTransaction.yaml index 6eae9b86..69539cab 100644 --- a/openapi/components/schemas/transactions/OutgoingTransaction.yaml +++ b/openapi/components/schemas/transactions/OutgoingTransaction.yaml @@ -31,11 +31,6 @@ allOf: type: string description: The ID of the quote that was used to trigger this payment example: Quote:019542f5-b3e7-1d02-0000-000000000006 - originalTransactionId: - type: string - description: >- - ID of the original transaction that this transaction is retrying, if applicable - example: Transaction:019542f5-b3e7-1d02-0000-000000000003 paymentInstructions: type: array description: Payment instructions for executing the payment. From 4c62c88ca5423847a4e6a206252b9c0114f0286f Mon Sep 17 00:00:00 2001 From: Peng Ying Date: Wed, 18 Feb 2026 10:49:16 -0800 Subject: [PATCH 7/8] feat: adding kotlin sample (#192) --- .gitignore | 3 + .../2026-02-12-grid-sample-app-design.md | 202 ++ docs/plans/2026-02-12-grid-sample-app-plan.md | 2029 ++++++++++++++ samples/README.md | 30 + samples/frontend/README.md | 30 + samples/frontend/index.html | 12 + samples/frontend/package-lock.json | 2450 +++++++++++++++++ samples/frontend/package.json | 24 + samples/frontend/src/App.tsx | 89 + .../frontend/src/components/JsonEditor.tsx | 35 + .../frontend/src/components/ResponsePanel.tsx | 34 + .../frontend/src/components/StepWizard.tsx | 75 + .../frontend/src/components/WebhookStream.tsx | 88 + samples/frontend/src/index.css | 1 + samples/frontend/src/lib/api.ts | 18 + samples/frontend/src/main.tsx | 10 + samples/frontend/src/steps/CreateCustomer.tsx | 62 + .../src/steps/CreateExternalAccount.tsx | 83 + samples/frontend/src/steps/CreateQuote.tsx | 67 + samples/frontend/src/steps/ExecuteQuote.tsx | 48 + samples/frontend/src/steps/SandboxFund.tsx | 57 + samples/frontend/src/vite-env.d.ts | 1 + samples/frontend/tsconfig.json | 21 + samples/frontend/tsconfig.node.json | 19 + samples/frontend/tsconfig.tsbuildinfo | 1 + samples/frontend/vite.config.ts | 21 + samples/kotlin/.env.example | 6 + samples/kotlin/.gitignore | 9 + samples/kotlin/README.md | 111 + samples/kotlin/build.gradle.kts | 62 + samples/kotlin/gradle.properties | 2 + .../kotlin/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43583 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + samples/kotlin/gradlew | 251 ++ samples/kotlin/gradlew.bat | 94 + samples/kotlin/settings.gradle.kts | 1 + .../kotlin/com/grid/sample/Application.kt | 47 + .../src/main/kotlin/com/grid/sample/Config.kt | 21 + .../com/grid/sample/GridClientBuilder.kt | 13 + .../main/kotlin/com/grid/sample/JsonUtils.kt | 21 + .../src/main/kotlin/com/grid/sample/Log.kt | 61 + .../kotlin/com/grid/sample/WebhookStream.kt | 15 + .../com/grid/sample/routes/Customers.kt | 73 + .../grid/sample/routes/ExternalAccounts.kt | 114 + .../kotlin/com/grid/sample/routes/Quotes.kt | 125 + .../kotlin/com/grid/sample/routes/Sandbox.kt | 50 + .../main/kotlin/com/grid/sample/routes/Sse.kt | 29 + .../kotlin/com/grid/sample/routes/Webhooks.kt | 31 + .../src/main/resources/application.yaml | 6 + samples/kotlin/src/main/resources/logback.xml | 10 + 50 files changed, 6669 insertions(+) create mode 100644 docs/plans/2026-02-12-grid-sample-app-design.md create mode 100644 docs/plans/2026-02-12-grid-sample-app-plan.md create mode 100644 samples/README.md create mode 100644 samples/frontend/README.md create mode 100644 samples/frontend/index.html create mode 100644 samples/frontend/package-lock.json create mode 100644 samples/frontend/package.json create mode 100644 samples/frontend/src/App.tsx create mode 100644 samples/frontend/src/components/JsonEditor.tsx create mode 100644 samples/frontend/src/components/ResponsePanel.tsx create mode 100644 samples/frontend/src/components/StepWizard.tsx create mode 100644 samples/frontend/src/components/WebhookStream.tsx create mode 100644 samples/frontend/src/index.css create mode 100644 samples/frontend/src/lib/api.ts create mode 100644 samples/frontend/src/main.tsx create mode 100644 samples/frontend/src/steps/CreateCustomer.tsx create mode 100644 samples/frontend/src/steps/CreateExternalAccount.tsx create mode 100644 samples/frontend/src/steps/CreateQuote.tsx create mode 100644 samples/frontend/src/steps/ExecuteQuote.tsx create mode 100644 samples/frontend/src/steps/SandboxFund.tsx create mode 100644 samples/frontend/src/vite-env.d.ts create mode 100644 samples/frontend/tsconfig.json create mode 100644 samples/frontend/tsconfig.node.json create mode 100644 samples/frontend/tsconfig.tsbuildinfo create mode 100644 samples/frontend/vite.config.ts create mode 100644 samples/kotlin/.env.example create mode 100644 samples/kotlin/.gitignore create mode 100644 samples/kotlin/README.md create mode 100644 samples/kotlin/build.gradle.kts create mode 100644 samples/kotlin/gradle.properties create mode 100644 samples/kotlin/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/kotlin/gradle/wrapper/gradle-wrapper.properties create mode 100755 samples/kotlin/gradlew create mode 100644 samples/kotlin/gradlew.bat create mode 100644 samples/kotlin/settings.gradle.kts create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/Application.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/Config.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/GridClientBuilder.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/JsonUtils.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/Log.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/WebhookStream.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/routes/ExternalAccounts.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/routes/Quotes.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/routes/Sandbox.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/routes/Sse.kt create mode 100644 samples/kotlin/src/main/kotlin/com/grid/sample/routes/Webhooks.kt create mode 100644 samples/kotlin/src/main/resources/application.yaml create mode 100644 samples/kotlin/src/main/resources/logback.xml diff --git a/.gitignore b/.gitignore index 9c307619..ef5b47fa 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,9 @@ local.properties # CLI build output cli/dist/ +# Frontend build output +samples/frontend/dist/ + # Figma design tokens (local reference only) mintlify/tokens/ diff --git a/docs/plans/2026-02-12-grid-sample-app-design.md b/docs/plans/2026-02-12-grid-sample-app-design.md new file mode 100644 index 00000000..2defeea5 --- /dev/null +++ b/docs/plans/2026-02-12-grid-sample-app-design.md @@ -0,0 +1,202 @@ +# Grid API Sample Application Design + +## Overview + +A sample application demonstrating the Grid API payout flow using the Grid Kotlin SDK. Consists of a shared Vite/React frontend and a Kotlin (Ktor) backend. The frontend is reusable with future backend implementations in other languages. + +## Architecture + +**Approach:** Thin backend proxy. The Kotlin backend holds API credentials, translates frontend JSON requests into Grid SDK builder calls, and returns raw JSON responses. The frontend orchestrates the step-by-step wizard flow. Webhooks stream from backend to frontend via SSE. + +## Directory Structure + +``` +samples/ +├── frontend/ # Shared Vite + React + Tailwind frontend +│ ├── package.json +│ ├── vite.config.ts # Proxies /api → localhost:8080 +│ ├── tsconfig.json +│ ├── index.html +│ └── src/ +│ ├── main.tsx +│ ├── App.tsx # Wizard flow + webhook panel +│ ├── components/ +│ │ ├── StepWizard.tsx # Step container with progress indicator +│ │ ├── JsonEditor.tsx # Editable JSON textarea +│ │ ├── ResponsePanel.tsx # Shows API response JSON +│ │ └── WebhookStream.tsx # SSE-connected live webhook feed +│ ├── steps/ +│ │ ├── CreateCustomer.tsx +│ │ ├── CreateExternalAccount.tsx +│ │ ├── CreateQuote.tsx +│ │ ├── ExecuteQuote.tsx +│ │ └── SandboxFund.tsx +│ └── lib/ +│ └── api.ts # fetch wrappers for /api/* endpoints +│ +├── kotlin/ # Kotlin backend sample +│ ├── README.md +│ ├── .env.example +│ ├── build.gradle.kts +│ ├── settings.gradle.kts +│ ├── gradle.properties +│ ├── gradlew / gradlew.bat +│ └── src/main/kotlin/com/grid/sample/ +│ ├── Application.kt +│ ├── Config.kt +│ ├── GridClientBuilder.kt +│ ├── Routing.kt +│ ├── WebhookStream.kt +│ ├── JsonUtils.kt +│ └── routes/ +│ ├── Customers.kt +│ ├── ExternalAccounts.kt +│ ├── Quotes.kt +│ ├── Sandbox.kt +│ ├── Webhooks.kt +│ └── Sse.kt +│ +└── README.md +``` + +## API Contract + +| Method | Path | Description | +|--------|------|-------------| +| `POST` | `/api/customers` | Create an individual customer | +| `POST` | `/api/customers/{customerId}/external-accounts` | Create a USD external bank account | +| `POST` | `/api/quotes` | Create a quote (USDC internal → USD external) | +| `POST` | `/api/quotes/{quoteId}/execute` | Execute the quote to initiate payment | +| `POST` | `/api/sandbox/send-funds` | Simulate funding for the quote | +| `POST` | `/api/webhooks` | Receives webhooks from Grid (not called by frontend) | +| `GET` | `/api/sse` | SSE stream of webhook events to frontend | + +## Step-by-Step Flow + +### Step 1 — Create Customer + +```json +// POST /api/customers +{ + "customerType": "INDIVIDUAL", + "platformCustomerId": "sample-customer-001" +} +// Response includes `id` → used in Step 2 +``` + +### Step 2 — Create External Account + +```json +// POST /api/customers/{customerId}/external-accounts +{ + "currency": "USD", + "accountInfo": { + "accountType": "CHECKING", + "routingNumber": "021000021", + "accountNumber": "123456789" + } +} +// Response includes `id` → used in Step 3 +``` + +### Step 3 — Create Quote + +```json +// POST /api/quotes +{ + "source": { "internalAccountId": "" }, + "destination": { "externalAccountId": "" }, + "lockedCurrencyAmount": 1000, + "lockedCurrencySide": "SENDING" +} +// Response includes `quoteId` → used in Steps 4 and 5 +``` + +### Step 4 — Execute Quote + +```json +// POST /api/quotes/{quoteId}/execute +// No body needed +// Response: updated quote with status change +``` + +### Step 5 — Sandbox Fund + +```json +// POST /api/sandbox/send-funds +{ + "quoteId": "" +} +// Response: sandbox funding confirmation +``` + +## Frontend Design + +### Layout + +Two-panel layout: + +- **Left (60%):** Step wizard with vertical stepper. Active step shows editable JSON textarea and submit button. Response panel below. Completed steps collapse to summary. Future steps grayed out. +- **Right (40%):** Webhook stream panel. SSE connection on page load with auto-reconnect. Newest events at top. Each shows timestamp, event type badge, expandable raw JSON. + +### Tech Stack + +React 18, TypeScript, Vite 5, Tailwind CSS 4. No component libraries. + +### Data Flow Between Steps + +The frontend auto-populates IDs from previous responses into the next step's JSON template. Users can edit any value before submitting. + +## Backend Design (Kotlin) + +### Server + +Ktor 3.x with Netty engine. CORS enabled for all origins. SSE plugin installed. + +### Request Handling Pattern + +Each route handler: +1. Receives raw JSON string from request body +2. Parses with Jackson into `JsonNode` +3. Builds Grid SDK params using builder pattern +4. Calls Grid SDK +5. Returns SDK response as JSON + +### Key Components + +- **`Config.kt`** — Loads `GRID_API_TOKEN_ID`, `GRID_API_CLIENT_SECRET`, `GRID_WEBHOOK_PUBLIC_KEY` from `.env` or system env vars via dotenv-kotlin +- **`GridClientBuilder.kt`** — Lazy singleton `GridOkHttpClient` +- **`WebhookStream.kt`** — `MutableSharedFlow(replay = 10)` for broadcasting webhook events +- **`Webhooks.kt`** — Verifies P-256 ECDSA signature via `X-Grid-Signature` header, broadcasts to `WebhookStream` +- **`Sse.kt`** — Collects from `WebhookStream.eventFlow`, sends as `ServerSentEvent`. Heartbeat endpoint for keep-alive. + +### Dependencies + +- Grid Kotlin SDK (published Maven artifact from `com.grid:grid-kotlin`) +- Ktor 3.x (server-core, server-netty, server-cors, server-sse, server-content-negotiation) +- Jackson (kotlin module) +- dotenv-kotlin +- Logback + +### Error Handling + +Minimal. SDK exceptions caught and returned as JSON with appropriate HTTP status. + +## README Structure + +### `samples/README.md` + +Overview of the sample apps, directory structure, links to sub-READMEs. + +### `samples/kotlin/README.md` + +1. Overview of what the sample demonstrates +2. Prerequisites: Java 21+, Node.js 18+, Grid API sandbox credentials +3. Setup: copy `.env.example`, fill in credentials +4. Running: two terminals (backend `./gradlew run` on :8080, frontend `npm run dev` on :5173) +5. Webhook setup: ngrok for local dev, configure webhook URL in Grid dashboard +6. Walkthrough of each wizard step + +### `samples/frontend/README.md` + +How to run, how to configure proxy target for different backends. diff --git a/docs/plans/2026-02-12-grid-sample-app-plan.md b/docs/plans/2026-02-12-grid-sample-app-plan.md new file mode 100644 index 00000000..ef4b0983 --- /dev/null +++ b/docs/plans/2026-02-12-grid-sample-app-plan.md @@ -0,0 +1,2029 @@ +# Grid API Sample Application Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** Build a sample app (Kotlin backend + shared React frontend) demonstrating the Grid API payout flow: create customer → external account → quote → execute → sandbox fund, with live webhook streaming. + +**Architecture:** Thin backend proxy pattern. Ktor server translates JSON requests to Grid SDK builder calls. React frontend runs a step-by-step wizard, passing IDs between steps. Webhooks stream via SSE from backend to frontend. + +**Tech Stack:** Kotlin 2.1 + Ktor 3.x + Grid Kotlin SDK (backend), React 18 + TypeScript + Vite 5 + Tailwind CSS 4 (frontend) + +**Design doc:** `docs/plans/2026-02-12-grid-sample-app-design.md` + +--- + +### Task 1: Kotlin Backend — Gradle Project Scaffold + +**Files:** +- Create: `samples/kotlin/build.gradle.kts` +- Create: `samples/kotlin/settings.gradle.kts` +- Create: `samples/kotlin/gradle.properties` +- Create: `samples/kotlin/.env.example` +- Create: `samples/kotlin/src/main/resources/application.yaml` +- Create: `samples/kotlin/src/main/resources/logback.xml` + +**Step 1: Initialize Gradle wrapper** + +```bash +cd samples/kotlin +gradle wrapper --gradle-version 8.12 +``` + +If `gradle` is not installed locally, copy wrapper files from `/Users/pengying/Src/grid-api/sdks/grid-kotlin/`: + +```bash +mkdir -p samples/kotlin +cp -r sdks/grid-kotlin/gradle samples/kotlin/gradle +cp sdks/grid-kotlin/gradlew samples/kotlin/gradlew +cp sdks/grid-kotlin/gradlew.bat samples/kotlin/gradlew.bat +``` + +**Step 2: Create settings.gradle.kts** + +```kotlin +rootProject.name = "grid-sample" +``` + +**Step 3: Create gradle.properties** + +```properties +kotlin.code.style=official +org.gradle.jvmargs=-Xmx1024m +``` + +**Step 4: Create build.gradle.kts** + +```kotlin +plugins { + kotlin("jvm") version "2.1.21" + kotlin("plugin.serialization") version "2.1.21" + id("io.ktor.plugin") version "3.1.3" +} + +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } +} + +group = "com.grid.sample" +version = "0.0.1" + +application { + mainClass = "io.ktor.server.netty.EngineMain" + applicationDefaultJvmArgs = listOf("-Dio.ktor.development=true") +} + +repositories { + mavenCentral() +} + +dependencies { + // Ktor server + implementation("io.ktor:ktor-server-core:3.1.3") + implementation("io.ktor:ktor-server-netty:3.1.3") + implementation("io.ktor:ktor-server-cors:3.1.3") + implementation("io.ktor:ktor-server-sse:3.1.3") + implementation("io.ktor:ktor-server-content-negotiation:3.1.3") + implementation("io.ktor:ktor-server-config-yaml:3.1.3") + + // Grid Kotlin SDK + implementation("com.lightspark.grid:lightspark-grid-kotlin:0.4.0") + + // JSON + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2") + + // Environment + implementation("io.github.cdimascio:dotenv-kotlin:6.4.1") + + // Logging + implementation("ch.qos.logback:logback-classic:1.5.6") +} +``` + +**Step 5: Create .env.example** + +```bash +# Grid API Credentials (from https://app.lightspark.com) +GRID_API_TOKEN_ID=your_api_token_id +GRID_API_CLIENT_SECRET=your_api_client_secret + +# Webhook verification (P-256 public key, PEM format) +GRID_WEBHOOK_PUBLIC_KEY=your_webhook_public_key +``` + +**Step 6: Create application.yaml** + +```yaml +ktor: + application: + modules: + - com.grid.sample.ApplicationKt.module + deployment: + port: 8080 +``` + +**Step 7: Create logback.xml** + +```xml + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + +``` + +**Step 8: Verify compilation** + +```bash +cd samples/kotlin && ./gradlew build +``` + +Expected: BUILD SUCCESSFUL (may have warnings about no source files yet, that's fine) + +**Step 9: Commit** + +```bash +git add samples/kotlin/ +git commit -m "feat(samples): scaffold Kotlin backend Gradle project" +``` + +--- + +### Task 2: Kotlin Backend — Core Infrastructure + +**Files:** +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/Application.kt` +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/Config.kt` +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/GridClientBuilder.kt` +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/WebhookStream.kt` +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/JsonUtils.kt` +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/Routing.kt` + +**Step 1: Create Config.kt** + +```kotlin +package com.grid.sample + +import io.github.cdimascio.dotenv.dotenv + +object Config { + private val dotenv = dotenv { + directory = "./" + ignoreIfMalformed = true + ignoreIfMissing = true + } + + val apiTokenId: String = getEnvVar("GRID_API_TOKEN_ID") + val apiClientSecret: String = getEnvVar("GRID_API_CLIENT_SECRET") + val webhookPublicKey: String = getEnvVar("GRID_WEBHOOK_PUBLIC_KEY").replace("\\n", "\n") + + private fun getEnvVar(key: String): String = + System.getProperty(key) + ?: dotenv[key] + ?: System.getenv(key) + ?: throw IllegalStateException("$key environment variable not set") +} +``` + +**Step 2: Create GridClientBuilder.kt** + +```kotlin +package com.grid.sample + +import com.grid.api.client.GridClient +import com.grid.api.client.okhttp.GridOkHttpClient + +object GridClientBuilder { + val client: GridClient by lazy { + GridOkHttpClient.builder() + .username(Config.apiTokenId) + .password(Config.apiClientSecret) + .build() + } +} +``` + +**Step 3: Create WebhookStream.kt** + +```kotlin +package com.grid.sample + +import kotlinx.coroutines.flow.MutableSharedFlow +import kotlinx.coroutines.flow.SharedFlow +import kotlinx.coroutines.flow.asSharedFlow + +object WebhookStream { + private val _eventFlow = MutableSharedFlow(replay = 10) + val eventFlow: SharedFlow = _eventFlow.asSharedFlow() + + fun addEvent(event: String) { + println("Broadcasting webhook: $event") + _eventFlow.tryEmit(event) + } +} +``` + +**Step 4: Create JsonUtils.kt** + +```kotlin +package com.grid.sample + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper + +object JsonUtils { + val mapper: ObjectMapper = jacksonObjectMapper().apply { + enable(SerializationFeature.INDENT_OUTPUT) + } + + fun prettyPrint(obj: Any): String = + try { + mapper.writeValueAsString(obj) + } catch (e: Exception) { + """{"error": "Failed to serialize response: ${e.message}"}""" + } +} +``` + +**Step 5: Create Routing.kt** + +Minimal routing that just installs CORS and SSE — route modules added in later tasks. + +```kotlin +package com.grid.sample + +import io.ktor.http.* +import io.ktor.server.application.* +import io.ktor.server.plugins.cors.routing.* +import io.ktor.server.routing.* +import io.ktor.server.sse.* + +fun Application.module() { + install(CORS) { + allowMethod(HttpMethod.Options) + allowMethod(HttpMethod.Get) + allowMethod(HttpMethod.Post) + allowHeader(HttpHeaders.ContentType) + allowHeader(HttpHeaders.Authorization) + allowCredentials = true + anyHost() + } + install(SSE) + routing { + // Route modules will be added here + } +} +``` + +**Step 6: Create Application.kt** + +```kotlin +package com.grid.sample + +import io.ktor.server.application.* + +fun main(args: Array) { + io.ktor.server.netty.EngineMain.main(args) +} +``` + +**Step 7: Verify compilation** + +```bash +cd samples/kotlin && ./gradlew build +``` + +Expected: BUILD SUCCESSFUL + +**Step 8: Commit** + +```bash +git add samples/kotlin/src/ +git commit -m "feat(samples): add Kotlin backend core infrastructure" +``` + +--- + +### Task 3: Kotlin Backend — Customer Route + +**Files:** +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt` +- Modify: `samples/kotlin/src/main/kotlin/com/grid/sample/Routing.kt` + +**Step 1: Create Customers.kt** + +```kotlin +package com.grid.sample.routes + +import com.fasterxml.jackson.databind.JsonNode +import com.grid.api.models.customers.CustomerCreateParams +import com.grid.api.models.customers.CustomerCreateParams.CreateCustomerRequest +import com.grid.api.models.customers.CustomerType +import com.grid.sample.GridClientBuilder +import com.grid.sample.JsonUtils +import io.ktor.http.* +import io.ktor.server.request.* +import io.ktor.server.response.* +import io.ktor.server.routing.* + +fun Route.customerRoutes() { + route("/api/customers") { + post { + try { + val body = call.receiveText() + val json = JsonUtils.mapper.readTree(body) + + val individualRequest = CreateCustomerRequest + .IndividualCustomerCreateRequest.builder() + .customerType(CustomerType.INDIVIDUAL) + .apply { + json.optText("platformCustomerId")?.let { platformCustomerId(it) } + json.optText("fullName")?.let { fullName(it) } + json.optText("nationality")?.let { nationality(it) } + } + .build() + + val params = CustomerCreateParams.builder() + .createCustomerRequest( + CreateCustomerRequest.ofIndividualCustomerCreate(individualRequest) + ) + .build() + + val customer = GridClientBuilder.client.customers().create(params) + call.respondText( + JsonUtils.prettyPrint(customer), + ContentType.Application.Json, + HttpStatusCode.Created + ) + } catch (e: Exception) { + call.respondText( + """{"error": "${e.message}"}""", + ContentType.Application.Json, + HttpStatusCode.InternalServerError + ) + } + } + } +} + +private fun JsonNode.optText(field: String): String? = + if (has(field) && !get(field).isNull) get(field).asText() else null +``` + +**Step 2: Register route in Routing.kt** + +Add inside the `routing { }` block: + +```kotlin +import com.grid.sample.routes.customerRoutes + +// Inside routing { }: +customerRoutes() +``` + +**Step 3: Verify compilation** + +```bash +cd samples/kotlin && ./gradlew build +``` + +Expected: BUILD SUCCESSFUL + +**Step 4: Commit** + +```bash +git add samples/kotlin/src/ +git commit -m "feat(samples): add customer creation route" +``` + +--- + +### Task 4: Kotlin Backend — External Account Route + +**Files:** +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/routes/ExternalAccounts.kt` +- Modify: `samples/kotlin/src/main/kotlin/com/grid/sample/Routing.kt` + +**Step 1: Create ExternalAccounts.kt** + +```kotlin +package com.grid.sample.routes + +import com.fasterxml.jackson.databind.JsonNode +import com.grid.api.models.customers.externalaccounts.ExternalAccountCreate +import com.grid.api.models.customers.externalaccounts.ExternalAccountCreateParams +import com.grid.api.models.customers.externalaccounts.ExternalAccountInfoOneOf +import com.grid.api.models.customers.externalaccounts.IndividualBeneficiary +import com.grid.sample.GridClientBuilder +import com.grid.sample.JsonUtils +import io.ktor.http.* +import io.ktor.server.request.* +import io.ktor.server.response.* +import io.ktor.server.routing.* + +fun Route.externalAccountRoutes() { + route("/api/customers/{customerId}/external-accounts") { + post { + try { + val customerId = call.parameters["customerId"] + ?: return@post call.respondText( + """{"error": "customerId is required"}""", + ContentType.Application.Json, + HttpStatusCode.BadRequest + ) + + val body = call.receiveText() + val json = JsonUtils.mapper.readTree(body) + val accountInfo = json.get("accountInfo") + + val usAccountInfo = ExternalAccountInfoOneOf + .UsAccountExternalAccountInfo.builder() + .accountNumber(accountInfo.get("accountNumber").asText()) + .routingNumber(accountInfo.get("routingNumber").asText()) + .accountType(accountInfo.optText("accountType") ?: "CHECKING") + .apply { + val beneficiaryNode = json.get("beneficiary") + if (beneficiaryNode != null && !beneficiaryNode.isNull) { + beneficiary( + IndividualBeneficiary.builder() + .firstName(beneficiaryNode.optText("firstName") ?: "") + .lastName(beneficiaryNode.optText("lastName") ?: "") + .build() + ) + } + } + .build() + + val externalAccountCreate = ExternalAccountCreate.builder() + .accountInfo( + ExternalAccountInfoOneOf.ofUsAccountExternalAccountInfo(usAccountInfo) + ) + .currency(json.optText("currency") ?: "USD") + .customerId(customerId) + .apply { + json.optText("platformAccountId")?.let { platformAccountId(it) } + } + .build() + + val params = ExternalAccountCreateParams.builder() + .externalAccountCreate(externalAccountCreate) + .build() + + val account = GridClientBuilder.client.customers().externalAccounts().create(params) + call.respondText( + JsonUtils.prettyPrint(account), + ContentType.Application.Json, + HttpStatusCode.Created + ) + } catch (e: Exception) { + call.respondText( + """{"error": "${e.message}"}""", + ContentType.Application.Json, + HttpStatusCode.InternalServerError + ) + } + } + } +} + +private fun JsonNode.optText(field: String): String? = + if (has(field) && !get(field).isNull) get(field).asText() else null +``` + +**Step 2: Register route in Routing.kt** + +```kotlin +import com.grid.sample.routes.externalAccountRoutes + +// Inside routing { }: +externalAccountRoutes() +``` + +**Step 3: Verify compilation** + +```bash +cd samples/kotlin && ./gradlew build +``` + +**Step 4: Commit** + +```bash +git add samples/kotlin/src/ +git commit -m "feat(samples): add external account creation route" +``` + +--- + +### Task 5: Kotlin Backend — Quote Routes (Create + Execute) + +**Files:** +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/routes/Quotes.kt` +- Modify: `samples/kotlin/src/main/kotlin/com/grid/sample/Routing.kt` + +**Step 1: Create Quotes.kt** + +```kotlin +package com.grid.sample.routes + +import com.fasterxml.jackson.databind.JsonNode +import com.grid.api.models.quotes.BaseDestination +import com.grid.api.models.quotes.BaseQuoteSource +import com.grid.api.models.quotes.QuoteCreateParams +import com.grid.api.models.quotes.QuoteSourceOneOf +import com.grid.api.models.quotes.QuoteDestinationOneOf +import com.grid.sample.GridClientBuilder +import com.grid.sample.JsonUtils +import io.ktor.http.* +import io.ktor.server.request.* +import io.ktor.server.response.* +import io.ktor.server.routing.* + +fun Route.quoteRoutes() { + route("/api/quotes") { + post { + try { + val body = call.receiveText() + val json = JsonUtils.mapper.readTree(body) + + val sourceNode = json.get("source") + val source = buildQuoteSource(sourceNode) + + val destNode = json.get("destination") + val destination = buildQuoteDestination(destNode) + + val params = QuoteCreateParams.builder() + .source(source) + .destination(destination) + .lockedCurrencyAmount(json.get("lockedCurrencyAmount").asLong()) + .lockedCurrencySide( + when (json.optText("lockedCurrencySide")?.uppercase()) { + "RECEIVING" -> QuoteCreateParams.LockedCurrencySide.RECEIVING + else -> QuoteCreateParams.LockedCurrencySide.SENDING + } + ) + .apply { + json.optText("description")?.let { description(it) } + } + .build() + + val quote = GridClientBuilder.client.quotes().create(params) + call.respondText( + JsonUtils.prettyPrint(quote), + ContentType.Application.Json, + HttpStatusCode.Created + ) + } catch (e: Exception) { + call.respondText( + """{"error": "${e.message}"}""", + ContentType.Application.Json, + HttpStatusCode.InternalServerError + ) + } + } + + post("/{quoteId}/execute") { + try { + val quoteId = call.parameters["quoteId"] + ?: return@post call.respondText( + """{"error": "quoteId is required"}""", + ContentType.Application.Json, + HttpStatusCode.BadRequest + ) + + val quote = GridClientBuilder.client.quotes().execute(quoteId) + call.respondText( + JsonUtils.prettyPrint(quote), + ContentType.Application.Json, + HttpStatusCode.OK + ) + } catch (e: Exception) { + call.respondText( + """{"error": "${e.message}"}""", + ContentType.Application.Json, + HttpStatusCode.InternalServerError + ) + } + } + } +} + +private fun buildQuoteSource(sourceNode: JsonNode): QuoteSourceOneOf { + val sourceType = sourceNode.optText("sourceType") + + if (sourceType == "REALTIME_FUNDING" || sourceNode.has("currency")) { + return QuoteSourceOneOf.ofRealtimeFundingQuoteSource( + QuoteSourceOneOf.RealtimeFundingQuoteSource.builder() + .sourceType(BaseQuoteSource.SourceType.REALTIME_FUNDING) + .currency(sourceNode.get("currency").asText()) + .apply { + sourceNode.optText("customerId")?.let { customerId(it) } + } + .build() + ) + } + + return QuoteSourceOneOf.ofAccountQuoteSource( + QuoteSourceOneOf.AccountQuoteSource.builder() + .sourceType(BaseQuoteSource.SourceType.ACCOUNT) + .accountId(sourceNode.get("accountId").asText()) + .apply { + sourceNode.optText("customerId")?.let { customerId(it) } + } + .build() + ) +} + +private fun buildQuoteDestination(destNode: JsonNode): QuoteDestinationOneOf { + if (destNode.has("umaAddress")) { + return QuoteDestinationOneOf.ofUmaAddressDestination( + QuoteDestinationOneOf.UmaAddressDestination.builder() + .destinationType(BaseDestination.DestinationType.UMA_ADDRESS) + .umaAddress(destNode.get("umaAddress").asText()) + .build() + ) + } + + return QuoteDestinationOneOf.ofAccountDestination( + QuoteDestinationOneOf.AccountDestination.builder() + .destinationType(BaseDestination.DestinationType.ACCOUNT) + .accountId(destNode.get("accountId").asText()) + .build() + ) +} + +private fun JsonNode.optText(field: String): String? = + if (has(field) && !get(field).isNull) get(field).asText() else null +``` + +**Step 2: Register route in Routing.kt** + +```kotlin +import com.grid.sample.routes.quoteRoutes + +// Inside routing { }: +quoteRoutes() +``` + +**Step 3: Verify compilation** + +```bash +cd samples/kotlin && ./gradlew build +``` + +**Step 4: Commit** + +```bash +git add samples/kotlin/src/ +git commit -m "feat(samples): add quote creation and execution routes" +``` + +--- + +### Task 6: Kotlin Backend — Sandbox + Webhooks + SSE Routes + +**Files:** +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/routes/Sandbox.kt` +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/routes/Webhooks.kt` +- Create: `samples/kotlin/src/main/kotlin/com/grid/sample/routes/Sse.kt` +- Modify: `samples/kotlin/src/main/kotlin/com/grid/sample/Routing.kt` + +**Step 1: Create Sandbox.kt** + +```kotlin +package com.grid.sample.routes + +import com.grid.api.models.sandbox.SandboxSendFundsParams +import com.grid.sample.GridClientBuilder +import com.grid.sample.JsonUtils +import io.ktor.http.* +import io.ktor.server.request.* +import io.ktor.server.response.* +import io.ktor.server.routing.* + +fun Route.sandboxRoutes() { + route("/api/sandbox") { + post("/send-funds") { + try { + val body = call.receiveText() + val json = JsonUtils.mapper.readTree(body) + + val params = SandboxSendFundsParams.builder() + .quoteId(json.get("quoteId").asText()) + .currencyCode(json.optText("currencyCode") ?: "USD") + .apply { + if (json.has("currencyAmount") && !json.get("currencyAmount").isNull) { + currencyAmount(json.get("currencyAmount").asLong()) + } + } + .build() + + val response = GridClientBuilder.client.sandbox().sendFunds(params) + call.respondText( + JsonUtils.prettyPrint(response), + ContentType.Application.Json, + HttpStatusCode.OK + ) + } catch (e: Exception) { + call.respondText( + """{"error": "${e.message}"}""", + ContentType.Application.Json, + HttpStatusCode.InternalServerError + ) + } + } + } +} + +private fun com.fasterxml.jackson.databind.JsonNode.optText(field: String): String? = + if (has(field) && !get(field).isNull) get(field).asText() else null +``` + +**Step 2: Create Webhooks.kt** + +```kotlin +package com.grid.sample.routes + +import com.grid.sample.Config +import com.grid.sample.WebhookStream +import io.ktor.http.* +import io.ktor.server.request.* +import io.ktor.server.response.* +import io.ktor.server.routing.* +import java.security.KeyFactory +import java.security.Signature +import java.security.spec.X509EncodedKeySpec +import java.util.Base64 + +fun Route.webhookRoutes() { + route("/api/webhooks") { + post { + val rawBody = call.receiveText() + val signatureHeader = call.request.headers["X-Grid-Signature"] + + if (signatureHeader != null) { + val isValid = verifyWebhookSignature(rawBody, signatureHeader) + if (!isValid) { + call.respondText( + """{"error": "Invalid webhook signature"}""", + ContentType.Application.Json, + HttpStatusCode.Unauthorized + ) + return@post + } + } + + WebhookStream.addEvent(rawBody) + call.respond(HttpStatusCode.OK) + } + } +} + +private fun verifyWebhookSignature(body: String, signature: String): Boolean { + return try { + val publicKeyPem = Config.webhookPublicKey + .replace("-----BEGIN PUBLIC KEY-----", "") + .replace("-----END PUBLIC KEY-----", "") + .replace("\\s".toRegex(), "") + + val keyBytes = Base64.getDecoder().decode(publicKeyPem) + val keySpec = X509EncodedKeySpec(keyBytes) + val keyFactory = KeyFactory.getInstance("EC") + val publicKey = keyFactory.generatePublic(keySpec) + + val sig = Signature.getInstance("SHA256withECDSA") + sig.initVerify(publicKey) + sig.update(body.toByteArray()) + + val decodedSignature = Base64.getDecoder().decode(signature) + sig.verify(decodedSignature) + } catch (e: Exception) { + println("Webhook signature verification failed: ${e.message}") + false + } +} +``` + +**Step 3: Create Sse.kt** + +```kotlin +package com.grid.sample.routes + +import com.grid.sample.WebhookStream +import io.ktor.server.routing.* +import io.ktor.server.sse.* +import io.ktor.sse.* +import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach +import kotlin.time.Duration.Companion.seconds + +fun Route.sseRoutes() { + sse("/api/sse") { + val connected = """{"type":"connected","timestamp":${System.currentTimeMillis()}}""" + send(ServerSentEvent(connected)) + + WebhookStream.eventFlow + .onEach { event -> send(ServerSentEvent(event)) } + .catch { e -> println("SSE stream error: ${e.message}") } + .launchIn(this) + } + + sse("/api/sse/heartbeat") { + heartbeat { + period = 30.seconds + event = ServerSentEvent("heartbeat") + } + } +} +``` + +**Step 4: Update Routing.kt with all routes** + +Replace the full `Routing.kt` with: + +```kotlin +package com.grid.sample + +import com.grid.sample.routes.* +import io.ktor.http.* +import io.ktor.server.application.* +import io.ktor.server.plugins.cors.routing.* +import io.ktor.server.routing.* +import io.ktor.server.sse.* + +fun Application.module() { + install(CORS) { + allowMethod(HttpMethod.Options) + allowMethod(HttpMethod.Get) + allowMethod(HttpMethod.Post) + allowHeader(HttpHeaders.ContentType) + allowHeader(HttpHeaders.Authorization) + allowCredentials = true + anyHost() + } + install(SSE) + routing { + customerRoutes() + externalAccountRoutes() + quoteRoutes() + sandboxRoutes() + webhookRoutes() + sseRoutes() + } +} +``` + +**Step 5: Verify compilation** + +```bash +cd samples/kotlin && ./gradlew build +``` + +Expected: BUILD SUCCESSFUL + +**Step 6: Commit** + +```bash +git add samples/kotlin/src/ +git commit -m "feat(samples): add sandbox, webhook, and SSE routes" +``` + +--- + +### Task 7: Frontend — Vite + React + Tailwind Scaffold + +**Files:** +- Create: `samples/frontend/package.json` +- Create: `samples/frontend/vite.config.ts` +- Create: `samples/frontend/tsconfig.json` +- Create: `samples/frontend/tsconfig.node.json` +- Create: `samples/frontend/index.html` +- Create: `samples/frontend/src/main.tsx` +- Create: `samples/frontend/src/index.css` + +**Step 1: Create package.json** + +```json +{ + "name": "grid-sample-frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "preview": "vite preview" + }, + "dependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@tailwindcss/vite": "^4.1.10", + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react": "^4.3.4", + "tailwindcss": "^4.1.10", + "typescript": "^5.6.3", + "vite": "^6.0.0" + } +} +``` + +**Step 2: Create vite.config.ts** + +```typescript +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import tailwindcss from '@tailwindcss/vite' + +export default defineConfig({ + plugins: [react(), tailwindcss()], + server: { + port: 5173, + proxy: { + '/api': { + target: 'http://localhost:8080', + changeOrigin: true, + secure: false, + } + } + } +}) +``` + +**Step 3: Create tsconfig.json** + +```json +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} +``` + +**Step 4: Create tsconfig.node.json** + +```json +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} +``` + +**Step 5: Create index.html** + +```html + + + + + + Grid API Sample + + +
+ + + +``` + +**Step 6: Create src/index.css** + +```css +@import "tailwindcss"; +``` + +**Step 7: Create src/main.tsx** + +```tsx +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App' +import './index.css' + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +) +``` + +**Step 8: Create placeholder src/App.tsx** + +```tsx +export default function App() { + return ( +
+

Grid API Sample

+

Frontend scaffold — components coming next.

+
+ ) +} +``` + +**Step 9: Install dependencies and verify** + +```bash +cd samples/frontend && npm install && npm run build +``` + +Expected: Build succeeds, output in `dist/` + +**Step 10: Commit** + +```bash +git add samples/frontend/ +git commit -m "feat(samples): scaffold Vite + React + Tailwind frontend" +``` + +--- + +### Task 8: Frontend — API Client + Shared Components + +**Files:** +- Create: `samples/frontend/src/lib/api.ts` +- Create: `samples/frontend/src/components/JsonEditor.tsx` +- Create: `samples/frontend/src/components/ResponsePanel.tsx` + +**Step 1: Create api.ts** + +```typescript +export async function apiPost(path: string, body?: unknown): Promise { + const res = await fetch(path, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: body ? JSON.stringify(body) : undefined, + }) + const text = await res.text() + let data: T + try { + data = JSON.parse(text) + } catch { + throw new Error(text) + } + if (!res.ok) { + throw new Error((data as Record).error ?? text) + } + return data +} +``` + +**Step 2: Create JsonEditor.tsx** + +```tsx +import { useState, useEffect } from 'react' + +interface JsonEditorProps { + value: string + onChange: (value: string) => void + disabled?: boolean +} + +export default function JsonEditor({ value, onChange, disabled }: JsonEditorProps) { + const [error, setError] = useState(null) + + useEffect(() => { + try { + JSON.parse(value) + setError(null) + } catch (e) { + setError((e as Error).message) + } + }, [value]) + + return ( +
+