diff --git a/DESCRIPTION.md b/DESCRIPTION.md index 9f3c4d6..2a86e66 100644 --- a/DESCRIPTION.md +++ b/DESCRIPTION.md @@ -10,7 +10,7 @@ * Optimize the platform load for requests from Fireblocks ## How Fireblocks customers access 3rd parties -Fireblocks customers use the Fireblocks web-based console to connect their third-party accounts such as crypto 3rd partyie. This requires generating an API Key and an API Secret from their 3rd party portals, logging into their Fireblocks Console, adding an 3rd party account, selecting the 3rd party by a name and a logo, and then entering their account API Key, API Secret, and login details. +Fireblocks customers use the Fireblocks web-based console to connect their third-party accounts such as crypto 3rd parties. This requires generating an API Key and an API Secret from their 3rd party portals, logging into their Fireblocks Console, adding an 3rd party account, selecting the 3rd party by a name and a logo, and then entering their account API Key, API Secret, and login details. Once the third-party account is connected, Fireblocks customers can use the Fireblocks Console and API to: diff --git a/v2/api-validator/package-lock.json b/v2/api-validator/package-lock.json index 89e5ef9..5816525 100644 --- a/v2/api-validator/package-lock.json +++ b/v2/api-validator/package-lock.json @@ -1,12 +1,12 @@ { "name": "fireblocks-netlink-v2-api-validator", - "version": "0.3.1", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fireblocks-netlink-v2-api-validator", - "version": "0.3.1", + "version": "0.4.1", "license": "Apache-2.0", "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", diff --git a/v2/api-validator/src/config/index.ts b/v2/api-validator/src/config/index.ts index 65ed22a..ff3e2b1 100644 --- a/v2/api-validator/src/config/index.ts +++ b/v2/api-validator/src/config/index.ts @@ -221,6 +221,7 @@ const config = convict({ 'fb-provider-liquidity-api.yaml', 'fb-provider-trading-api.yaml', 'fb-provider-transfer-api.yaml', + 'fb-provider-crosstransfer-api.yaml', ], }, unifiedFilename: { diff --git a/v2/openapi/README.md b/v2/openapi/README.md index fde458f..ac6eb0d 100644 --- a/v2/openapi/README.md +++ b/v2/openapi/README.md @@ -131,6 +131,7 @@ this response indicates that all the capabilities are supported: "transfersBlockchain": "*", "transfersFiat": "*", "transfersPeerAccounts": "*", + "transfersCrossTransfer": "*", "trading": "*", "liquidity": "*" } diff --git a/v2/openapi/fb-provider-api.yaml b/v2/openapi/fb-provider-api.yaml index 4b53831..708fa98 100644 --- a/v2/openapi/fb-provider-api.yaml +++ b/v2/openapi/fb-provider-api.yaml @@ -37,7 +37,7 @@ paths: summary: Describe server capabilities description: >- Returns the API version and all the capabilities that the server supports. - + The capabilities are specified as a map. The map keys are the capability names and the values are lists of account IDs. If all the accounts support a capability, an asterisk could be used, instead of listing all the accounts. @@ -68,6 +68,9 @@ paths: transfersFiat: "*" transfersPeerAccounts: "*" transfersInternal: "*" + transfersOnRamp: "*" + transfersOffRamp: "*" + transfersBridging: "*" trading: "*" liquidity: "*" allAccountsSupportSomeCapabilities: @@ -122,7 +125,7 @@ paths: application/json: schema: type: object - required: [assets] + required: [ assets ] properties: assets: type: array @@ -280,6 +283,268 @@ paths: '5XX': $ref: '#/components/responses/ErrorResponse' + /accounts/external: + get: + operationId: listExternalAccounts + summary: Get list of external accounts + tags: [ accounts ] + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - $ref: '#/components/parameters/PaginationLimit' + - $ref: '#/components/parameters/PaginationStartingAfter' + - $ref: '#/components/parameters/PaginationEndingBefore' + - in: query + name: customerId + required: false + description: ID of the customer whose external accounts are to be listed. + schema: + type: string + responses: + '200': + description: List of external accounts. + content: + application/json: + schema: + type: object + properties: + accounts: + type: array + items: + $ref: '#/components/schemas/ExternalAccount' + example: + accounts: + - id: "76a33ed9-8aa2-4781-93f8-d2369c0c2b14" + customerId: "123e4567-e89b-12d3-a456-426614174000" + currency: + "nationalCurrencyCode": "USD" + servicedBy: "Bank of America" + account: + type: "Swift" + accountNumber: "GB29NWBK60161331926819" + bic: "NWBKGB2L" + country: "GB" + address: + streetLine1: "1 Churchill Place" + city: "London" + postalCode: "E14 5HP" + country: "GB" + accountHolder: + type: "Business" + businessName: "Acme Inc." + address: + streetLine1: "1 Churchill Place" + city: "London" + postalCode: "E14 5HP" + country: "GB" + category: "Client" + purpose: "IntraGroupTransfer" + shortBusinessDescription: "Payment for goods and services" + + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '4XX': + $ref: '#/components/responses/ErrorResponse' + '5XX': + $ref: '#/components/responses/ErrorResponse' + post: + operationId: createExternalAccount + summary: Create a new external account. + tags: [ accounts ] + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [ idempotencyKey, customerId ] + properties: + idempotencyKey: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Unique identifier of the request. + customerId: + description: ID of the customer who will be account holder. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + currency: + $ref: '#/components/schemas/AssetReference' + servicedBy: + type: string + description: Name of the external service provider (e.g. bank name). + example: 'Bank of America' + account: + $ref: '#/components/schemas/ExternalAccountDetails' + accountHolder: + oneOf: + - $ref: '#/components/schemas/BusinessAccountHolder' + - $ref: '#/components/schemas/IndividualAccountHolder' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalAccount' + examples: + swiftExternalAccount: + $ref: '#/components/examples/swiftExternalAccount' + iBANExternalAccount: + $ref: '#/components/examples/iBANExternalAccount' + usBankExternalAccount: + $ref: '#/components/examples/usBankExternalAccount' + + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '4XX': + $ref: '#/components/responses/ErrorResponse' + '5XX': + $ref: '#/components/responses/ErrorResponse' + + /accounts/external/{accountId}: + get: + operationId: getExternalAccountDetails + summary: Get external account details + tags: [ accounts ] + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - in: path + name: accountId + required: true + description: External account identifier. + schema: + type: string + responses: + '200': + description: External account details. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalAccount' + examples: + swiftExternalAccount: + $ref: '#/components/examples/swiftExternalAccount' + iBANExternalAccount: + $ref: '#/components/examples/iBANExternalAccount' + usBankExternalAccount: + $ref: '#/components/examples/usBankExternalAccount' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '4XX': + $ref: '#/components/responses/ErrorResponse' + '5XX': + $ref: '#/components/responses/ErrorResponse' + put: + operationId: updateExternalAccount + summary: Update external account details + tags: [ accounts ] + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - in: path + name: accountId + required: true + description: External account identifier. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [ idempotencyKey ] + properties: + idempotencyKey: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Unique identifier of the request. + account: + type: object + description: Update US bank account details. + properties: + accountType: + description: Type of the account. + type: string + enum: + - Checking + - Savings + example: 'Checking' + accountHolder: + type: object + description: Update account holder address. + properties: + address: + $ref: '#/components/schemas/Address' + responses: + '200': + description: External account updated. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalAccount' + examples: + swiftExternalAccount: + $ref: '#/components/examples/swiftExternalAccount' + iBANExternalAccount: + $ref: '#/components/examples/iBANExternalAccount' + usBankExternalAccount: + $ref: '#/components/examples/usBankExternalAccount' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '4XX': + $ref: '#/components/responses/ErrorResponse' + '5XX': + $ref: '#/components/responses/ErrorResponse' + delete: + operationId: deleteExternalAccount + summary: Delete external account + tags: [ accounts ] + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - in: path + name: accountId + required: true + description: External account identifier. + schema: + type: string + responses: + '201': + description: External account deleted. + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '4XX': + $ref: '#/components/responses/ErrorResponse' + '5XX': + $ref: '#/components/responses/ErrorResponse' + + + /accounts/{accountId}/balances: get: operationId: getBalances @@ -519,7 +784,7 @@ components: in: query schema: type: string - + NationalCurrencyCodeQueryParam: name: nationalCurrencyCode description: >- @@ -744,6 +1009,226 @@ components: - $ref: '#/components/schemas/AccountId' - $ref: '#/components/schemas/AccountData' + ExternalAccountRef: + type: object + required: [ type, externalAccountId ] + properties: + type: + type: string + enum: ['ExternalAccount'] + example: 'ExternalAccount' + externalAccountId: + $ref: '#/components/schemas/ExternalAccountId' + + AccountRef: + type: object + required: [ type, accountId ] + properties: + type: + type: string + enum: ['Account'] + example: 'Account' + accountId: + $ref: '#/components/schemas/AccountId' + + ExternalAccountId: + description: >- + ID of the account in the external system. + type: string + example: '76a33ed9-8aa2-4781-93f8-d2369c0c2b14' + + USBankAccountDetails: + type: object + required: [ type, accountNumber, routingNumber ] + properties: + type: + type: string + example: 'US' + description: Type of the account. + enum: + - US + accountNumber: + type: string + example: '123456789' + description: 'Account number of the US bank account.' + routingNumber: + type: string + example: '123456789' + description: 'Routing number of the US bank account.' + accountType: + type: string + enum: + - Checking + - Savings + example: 'Checking' + + iBanAccountDetails: + type: object + required: [ type, accountNumber, bic, country ] + properties: + type: + type: string + description: Type of the account. + example: 'IBAN' + enum: + - IBAN + accountNumber: + description: International Bank Account Number (iBAN). + type: string + example: 'DE89370400440532013000' + bic: + description: Bank Identifier Code (BIC). + type: string + example: 'DEUTDEFF' + country: + description: ISO 3166-1 alpha-2 country code. + type: string + example: 'DE' + + Address: + type: object + required: [ streetLine1, city, country ] + description: >- + Address details for the SWIFT transfer. + properties: + streetLine1: + type: string + example: '1 Churchill Place' + streetLine2: + type: string + example: 'Canary Wharf' + city: + type: string + example: 'London' + state: + type: string + postalCode: + type: string + example: 'E14 5HP' + country: + description: ISO 3166-1 alpha-2 country code. + type: string + example: 'GB' + + SwiftAccountDetails: + type: object + description: >- + Account details for the SWIFT transfer. + required: [ accountNumber, bic , address ] + properties: + type: + type: string + example: 'Swift' + description: Type of the account. + enum: + - Swift + accountNumber: + description: International Bank Account Number (iBAN). + type: string + example: 'GB29NWBK60161331926819' + bic: + description: Bank Identifier Code (BIC). + type: string + example: 'NWBKGB2L' + country: + description: ISO 3166-1 alpha-2 country code. + type: string + example: 'GB' + address: + $ref: '#/components/schemas/Address' + category: + description: The context of business operations + type: string + enum: + - Client + - ParentCompany + - Subsidiary + - Affiliate + - Supplier + purpose: + type: string + description: The nature of the transactions this account will participate in + enum: + - IntraGroupTransfer + - InvoiceForGoodsAndServices + shortBusinessDescription: + type: string + description: How the business uses the funds + example: 'Payment for goods and services' + + ExternalAccountDetails: + oneOf: + - $ref: '#/components/schemas/SwiftAccountDetails' + - $ref: '#/components/schemas/USBankAccountDetails' + - $ref: '#/components/schemas/iBanAccountDetails' + discriminator: + propertyName: type + mapping: + Swift: '#/components/schemas/SwiftAccountDetails' + US: '#/components/schemas/USBankAccountDetails' + IBAN: '#/components/schemas/iBanAccountDetails' + + IndividualAccountHolder: + description: >- + Individual account holder details. + type: object + required: [ type, firstName, lastName, address ] + properties: + type: + type: string + enum: + - Individual + firstName: + type: string + lastName: + type: string + address: + $ref: '#/components/schemas/Address' + + BusinessAccountHolder: + description: >- + Business account holder details. + type: object + required: [ type, businessName, address ] + properties: + type: + type: string + enum: + - Business + businessName: + type: string + example: 'Acme Inc.' + address: + $ref: '#/components/schemas/Address' + + ExternalAccount: + type: object + required: [ id, currency, customerId, servicedBy, account, accountHolder ] + properties: + id: + $ref: '#/components/schemas/ExternalAccountId' + currency: + $ref: '#/components/schemas/AssetReference' + customerId: + type: string + description: 'ID of the customer who will be account holder.' + example: 123e4567-e89b-12d3-a456-426614174000 + servicedBy: + type: string + description: 'Name of the external service provider (e.g. bank name).' + example: 'Bank of America' + account: + $ref: '#/components/schemas/ExternalAccountDetails' + accountHolder: + oneOf: + - $ref: '#/components/schemas/BusinessAccountHolder' + - $ref: '#/components/schemas/IndividualAccountHolder' + discriminator: + propertyName: type + mapping: + Individual: '#/components/schemas/IndividualAccountHolder' + Business: '#/components/schemas/BusinessAccountHolder' + Balances: type: array description: >- @@ -886,6 +1371,16 @@ components: - $ref: '#/components/schemas/NativeCryptocurrency' - $ref: '#/components/schemas/OtherAssetReference' + FiatRail: + type: string + example: 'SWIFT' + enum: + - ACH + - SEPA + - SWIFT + - IBAN + - Wire + Blockchain: type: string enum: @@ -1315,3 +1810,87 @@ components: - ZWL - ZWN - ZWR + + examples: + usBankExternalAccount: + summary: US bank account + description: >- + Example of a US bank account. + value: + id: "4ff63424-7e09-4cdf-b7f1-da7b7c65eabe" + customerId: "76a33ed9-8aa2-4781-93f8-d2369c0c2b14" + currency: + "nationalCurrencyCode": "USD" + servicedBy: "Bank of America" + account: + type: "US" + accountNumber: "1234567890" + routingNumber: "123456789" + accountType: "Checking" + accountHolder: + type: "Individual" + firstName: "John" + lastName: "Doe" + address: + streetLine1: "1 Churchill Place" + city: "London" + postalCode: "E14 5HP" + country: "GB" + + iBANExternalAccount: + summary: iBAN account + description: >- + Example of an iBAN account. + value: + id: "76a33ed9-8aa2-4781-93f8-d2369c0c2b14" + customerId: "76a33ed9-8aa2-4781-93f8-d2369c0c2b14" + currency: + "nationalCurrencyCode": "EUR" + servicedBy: "Deutsche Bank" + account: + type: "IBAN" + accountNumber: "DE89370400440532013000" + bic: "DEUTDEFF" + country: "DE" + accountHolder: + type: "Individual" + firstName: "John" + lastName: "Doe" + address: + streetLine1: "1 Churchill Place" + city: "London" + postalCode: "E14 5HP" + country: "GB" + + swiftExternalAccount: + summary: SWIFT account + description: >- + Example of a SWIFT account. + value: + id: "76a33ed9-8aa2-4781-93f8-d2369c0c2b14" + customerId: "2e7b3b9b-8aa2-4781-93f8-d2369c0c2b14" + currency: + "nationalCurrencyCode": "USD" + servicedBy: "Bank of America" + account: + type: "Swift" + accountNumber: "GB29NWBK60161331926819" + bic: "NWBKGB2L" + country: "GB" + address: + streetLine1: "1 Churchill Place" + city: "London" + postalCode: "E14 5HP" + country: "GB" + accountHolder: + type: "Business" + businessName: "Acme Inc." + address: + streetLine1: "1 Churchill Place" + city: "London" + postalCode: "E14 5HP" + country: "GB" + category: "Client" + purpose: "IntraGroupTransfer" + shortBusinessDescription: "Payment for goods and services" + diff --git a/v2/openapi/fb-provider-crosstransfer-api.yaml b/v2/openapi/fb-provider-crosstransfer-api.yaml new file mode 100644 index 0000000..4047e14 --- /dev/null +++ b/v2/openapi/fb-provider-crosstransfer-api.yaml @@ -0,0 +1,304 @@ +openapi: 3.0.0 +info: + title: '[Draft] Fireblocks Provider CrossTransfer API' + version: 0.0.1 + + contact: + name: Fireblocks + url: https://fireblocks.com + +tags: + - name: capabilities + description: Server capabilities discovery operations. + - name: crosstransfers + description: Fund transfers from fiat to digital assets, digital assets to fiat or digital to digital assets. + +x-path-params: + EntityIdPathParam: { $ref: './fb-provider-api.yaml#/components/parameters/EntityIdPathParam' } + SubAccountIdPathParam: { $ref: './fb-provider-api.yaml#/components/parameters/SubAccountIdPathParam' } + +x-query-params: + PaginationLimit: { $ref: './fb-provider-api.yaml#/components/parameters/PaginationLimit' } + PaginationStartingAfter: { $ref: './fb-provider-api.yaml#/components/parameters/PaginationStartingAfter' } + PaginationEndingBefore: { $ref: './fb-provider-api.yaml#/components/parameters/PaginationEndingBefore' } + ListOrderQueryParam: { $ref: './fb-provider-api.yaml#/components/parameters/ListOrderQueryParam' } + +x-header-params: + X-FBAPI-KEY: { $ref: './fb-provider-api.yaml#/components/parameters/X-FBAPI-KEY' } + X-FBAPI-SIGNATURE: { $ref: './fb-provider-api.yaml#/components/parameters/X-FBAPI-SIGNATURE' } + X-FBAPI-NONCE: { $ref: './fb-provider-api.yaml#/components/parameters/X-FBAPI-NONCE' } + X-FBAPI-TIMESTAMP: { $ref: './fb-provider-api.yaml#/components/parameters/X-FBAPI-TIMESTAMP' } + +x-schemas: + PositiveAmount: { $ref: './fb-provider-api.yaml#/components/schemas/PositiveAmount' } + AssetReference: { $ref: './fb-provider-api.yaml#/components/schemas/AssetReference' } + CryptocurrencyReference: { $ref: './fb-provider-api.yaml#/components/schemas/CryptocurrencyReference' } + Blockchain: { $ref: './fb-provider-api.yaml#/components/schemas/Blockchain' } + NationalCurrency: { $ref: './fb-provider-api.yaml#/components/schemas/NationalCurrency' } + NativeCryptocurrency: { $ref: './fb-provider-api.yaml#/components/schemas/NativeCryptocurrency' } + AccountId: { './fb-provider-api.yaml#/components/schemas/AccountId' } + AccountRef: { './fb-provider-api.yaml#/components/schemas/AccountRef' } + ExternalAccountRef: { './fb-provider-api.yaml#/components/schemas/ExternalAccountRef' } + FiatRail: { './fb-provider-api.yaml#/components/schemas/FiatRail' } +x-responses: + BadRequestResponse: { $ref: './fb-provider-api.yaml#/components/responses/BadRequestResponse' } + UnauthorizedResponse: { $ref: './fb-provider-api.yaml#/components/responses/UnauthorizedResponse' } + ErrorResponse: { $ref: './fb-provider-api.yaml#/components/responses/ErrorResponse' } + +paths: + /crosstransfer/onramp: + post: + operationId: createCrossTransferOnRampRouting + summary: >- + Creates deposit-only fiat account as a source, configures trigger and stores + payment instruction details about destination crypto account. As a result, the user will be + able to deposit fiat to the source account and receive payment in crypto to the + destination account. + tags: [ crosstransfers ] + parameters: + - $ref: '#/x-header-params/X-FBAPI-KEY' + - $ref: '#/x-header-params/X-FBAPI-NONCE' + - $ref: '#/x-header-params/X-FBAPI-SIGNATURE' + - $ref: '#/x-header-params/X-FBAPI-TIMESTAMP' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOnRampRoutingRequest' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/x-schemas/AccountId' + '400': + $ref: '#/x-responses/BadRequestResponse' + '401': + $ref: '#/x-responses/UnauthorizedResponse' + '4XX': + $ref: '#/x-responses/ErrorResponse' + '5XX': + $ref: '#/x-responses/ErrorResponse' + + + /crosstransfer/offramp: + post: + operationId: createCrossTransferOffRampRouting + summary: >- + Creates deposit-only crypto account as a source, configures trigger and stores + payment instruction details about destination fiat account. As a result, the user will be + able to deposit crypto to the source account and receive fiat to the destination account. + tags: [ crosstransfers ] + parameters: + - $ref: '#/x-header-params/X-FBAPI-KEY' + - $ref: '#/x-header-params/X-FBAPI-NONCE' + - $ref: '#/x-header-params/X-FBAPI-SIGNATURE' + - $ref: '#/x-header-params/X-FBAPI-TIMESTAMP' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOffRampRoutingRequest' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/x-schemas/AccountId' + '400': + $ref: '#/x-responses/BadRequestResponse' + '401': + $ref: '#/x-responses/UnauthorizedResponse' + '4XX': + $ref: '#/x-responses/ErrorResponse' + '5XX': + $ref: '#/x-responses/ErrorResponse' + + /crosstransfer/bridging: + post: + operationId: createCrossTransferBridging + summary: >- + Creates deposit-only crypto account as a source, configures trigger and stores + payment instruction details about destination crypto address. As a result, the user will be + able to deposit crypto to the source account and receive exchanged value to destination address + in selected cryptocurrency. + tags: [ crosstransfers ] + parameters: + - $ref: '#/x-header-params/X-FBAPI-KEY' + - $ref: '#/x-header-params/X-FBAPI-NONCE' + - $ref: '#/x-header-params/X-FBAPI-SIGNATURE' + - $ref: '#/x-header-params/X-FBAPI-TIMESTAMP' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateBridgingRequest' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/x-schemas/AccountId' + '400': + $ref: '#/x-responses/BadRequestResponse' + '401': + $ref: '#/x-responses/UnauthorizedResponse' + '4XX': + $ref: '#/x-responses/ErrorResponse' + '5XX': + $ref: '#/x-responses/ErrorResponse' + +components: + schemas: + CreateBridgingRequest: + type: object + required: [ idempotencyKey, customerId, source, destination, ] + properties: + idempotencyKey: + type: string + example: '76a33ed9-8aa2-4781-93f8-d2369c0c2b14' + customerId: + type: string + example: '76a33ed9-8aa2-4781-93f8-d2369c0c2b14' + source: + $ref: '#/components/schemas/BridgingSourceParameters' + destination: + $ref: '#/components/schemas/BridgingDestination' + BridgingDestination: + type: object + required: + - chain + - currency + - address + properties: + chain: + $ref: '#/x-schemas/Blockchain' + currency: + $ref: '#/x-schemas/NativeCryptocurrency' + address: + description: Address of the destination account. + type: string + memo: + description: Memo field for the destination address. Required for some blockchains. + type: string + BridgingSourceParameters: + type: object + required: [ currency ] + properties: + chain: + $ref: '#/x-schemas/Blockchain' + currency: + $ref: '#/x-schemas/NativeCryptocurrency' + developerFee: + $ref: './fb-provider-api.yaml#/components/schemas/PositiveAmount' + CreateOnRampRoutingRequest: + type: object + required: + - idempotencyKey + - customerId + - source + - destination + properties: + idempotencyKey: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + customerId: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + source: + $ref: '#/components/schemas/OnRampSourceParameters' + destination: + $ref: '#/components/schemas/OnRampDestination' + OnRampDestination: + type: object + required: + - chain + - currency + - address + properties: + chain: + $ref: '#/x-schemas/Blockchain' + currency: + $ref: '#/x-schemas/NativeCryptocurrency' + address: + description: Address of the destination account. + type: string + memo: + description: Memo field for the destination address. Required for some blockchains. + type: string + OnRampSourceParameters: + type: object + required: + - currency + properties: + currency: + $ref: '#/x-schemas/NativeCryptocurrency' + developerFee: + $ref: '#/x-schemas/PositiveAmount' + OffRampSourceParameters: + type: object + required: [ chain, currency ] + properties: + chain: + $ref: '#/x-schemas/Blockchain' + currency: + $ref: '#/x-schemas/NativeCryptocurrency' + developerFee: + $ref: '#/x-schemas/PositiveAmount' + returnAddress: + type: string + description: >- + Blockchain address to return the funds in case of a failed transaction. + MUST be on same blockchain network that is selected in the chain field. + Field will be ignored in case of Stellar chain. + OffRampDestination: + type: object + required: [ rail, currency, account ] + properties: + rail: + $ref: '#/x-schemas/FiatRail' + currency: + $ref: '#/x-schemas/NationalCurrency' + message: + type: string + description: >- + A message to be sent with a wire transfer. + It can have at most 3 lines (separated by "\n"), + each line with a max length of 35 chars + maxLength: 109 + reference: + type: string + description: >- + If rail is SEPA, this is the SEPA reference and must be from 6 to 140 characters. + The allowed characters are a-z, A-Z, 0-9, spaces, ampersand (&), hyphen (-), + full stop (.), and solidus (/). If rail is ACH, this is the ACH reference and + can be at most 10 characters, A-Z, a-z, 0-9, and spaces. + account: + oneOf: + - $ref: '#/x-schemas/ExternalAccountRef' + - $ref: '#/x-schemas/AccountRef' + discriminator: + propertyName: type + mapping: + ExternalAccount: '#/x-schemas/ExternalAccountRef' + Account: '#/components/schemas/AccountRef' + CreateOffRampRoutingRequest: + type: object + required: [ idempotencyKey, customerId, source, destination, ] + properties: + idempotencyKey: + type: string + example: '76a33ed9-8aa2-4781-93f8-d2369c0c2b14' + customerId: + type: string + example: '76a33ed9-8aa2-4781-93f8-d2369c0c2b14' + source: + $ref: '#/components/schemas/OffRampSourceParameters' + destination: + $ref: '#/components/schemas/OffRampDestination' diff --git a/v2/openapi/fb-provider-transfer-api.yaml b/v2/openapi/fb-provider-transfer-api.yaml index 7751b8f..2e980e4 100644 --- a/v2/openapi/fb-provider-transfer-api.yaml +++ b/v2/openapi/fb-provider-transfer-api.yaml @@ -38,10 +38,10 @@ x-header-params: X-FBAPI-TIMESTAMP: { $ref: './fb-provider-api.yaml#/components/parameters/X-FBAPI-TIMESTAMP' } x-schemas: - PositiveAmount: { $ref: './fb-provider-api.yaml#/components/schemas/PositiveAmount'} - AssetReference: { $ref: './fb-provider-api.yaml#/components/schemas/AssetReference'} - CryptocurrencyReference: { $ref: './fb-provider-api.yaml#/components/schemas/CryptocurrencyReference'} - Blockchain: { $ref: './fb-provider-api.yaml#/components/schemas/Blockchain'} + PositiveAmount: { $ref: './fb-provider-api.yaml#/components/schemas/PositiveAmount' } + AssetReference: { $ref: './fb-provider-api.yaml#/components/schemas/AssetReference' } + CryptocurrencyReference: { $ref: './fb-provider-api.yaml#/components/schemas/CryptocurrencyReference' } + Blockchain: { $ref: './fb-provider-api.yaml#/components/schemas/Blockchain' } NationalCurrency: { $ref: './fb-provider-api.yaml#/components/schemas/NationalCurrency' } x-responses: @@ -166,7 +166,7 @@ paths: examples: allUsdcToBucket: summary: USDCs deposit into a bucket or USD - description: >- + description: >- This response indicates that all USDC token on the various blockchains could be deposited either into the USDC bucket balance or into the USD balance. The USD balance can be specified directly while token and @@ -534,7 +534,7 @@ paths: post: operationId: createSubAccountWithdrawal summary: Create new transfer to another sub-account - description: >- + description: >- Transfers assets between different sub-accounts of the same user. Should reject any withdrawals that are not sub-account transfers. tags: [ transfersInternal ] @@ -979,7 +979,7 @@ components: properties: accountId: type: string - + PeerAccountTransferDestination: type: object allOf: @@ -999,7 +999,7 @@ components: properties: accountId: type: string - + InternalTransferDestination: type: object allOf: @@ -1303,4 +1303,4 @@ components: DepositAddressCreationPolicy: enum: - CanCreate - - CannotCreate \ No newline at end of file + - CannotCreate diff --git a/v2/openapi/fb-unified-openapi.yaml b/v2/openapi/fb-unified-openapi.yaml index d43a3df..d92e100 100644 --- a/v2/openapi/fb-unified-openapi.yaml +++ b/v2/openapi/fb-unified-openapi.yaml @@ -39,6 +39,8 @@ tags: description: Transfers to a peer account managed by the same provider. - name: transfersInternal description: Transfers to a sub account in the same account. + - name: crosstransfers + description: Fund transfers from fiat to digital assets, digital assets to fiat or digital to digital assets. paths: /capabilities: get: @@ -46,7 +48,6 @@ paths: summary: Describe server capabilities description: |- Returns the API version and all the capabilities that the server supports. - The capabilities are specified as a map. The map keys are the capability names and the values are lists of account IDs. If all the accounts support a capability, an asterisk could be used, instead of listing all the accounts. tags: - capabilities @@ -75,6 +76,9 @@ paths: transfersFiat: '*' transfersPeerAccounts: '*' transfersInternal: '*' + transfersOnRamp: '*' + transfersOffRamp: '*' + transfersBridging: '*' trading: '*' liquidity: '*' allAccountsSupportSomeCapabilities: @@ -276,6 +280,270 @@ paths: $ref: '#/components/responses/ErrorResponse' 5XX: $ref: '#/components/responses/ErrorResponse' + /accounts/external: + get: + operationId: listExternalAccounts + summary: Get list of external accounts + tags: + - accounts + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - $ref: '#/components/parameters/PaginationLimit' + - $ref: '#/components/parameters/PaginationStartingAfter' + - $ref: '#/components/parameters/PaginationEndingBefore' + - in: query + name: customerId + required: false + description: ID of the customer whose external accounts are to be listed. + schema: + type: string + responses: + '200': + description: List of external accounts. + content: + application/json: + schema: + type: object + properties: + accounts: + type: array + items: + $ref: '#/components/schemas/ExternalAccount' + example: + accounts: + - id: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + customerId: 123e4567-e89b-12d3-a456-426614174000 + currency: + nationalCurrencyCode: USD + servicedBy: Bank of America + account: + type: Swift + accountNumber: GB29NWBK60161331926819 + bic: NWBKGB2L + country: GB + address: + streetLine1: 1 Churchill Place + city: London + postalCode: E14 5HP + country: GB + accountHolder: + type: Business + businessName: Acme Inc. + address: + streetLine1: 1 Churchill Place + city: London + postalCode: E14 5HP + country: GB + category: Client + purpose: IntraGroupTransfer + shortBusinessDescription: Payment for goods and services + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' + post: + operationId: createExternalAccount + summary: Create a new external account. + tags: + - accounts + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - idempotencyKey + - customerId + properties: + idempotencyKey: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Unique identifier of the request. + customerId: + description: ID of the customer who will be account holder. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + currency: + $ref: '#/components/schemas/AssetReference' + servicedBy: + type: string + description: Name of the external service provider (e.g. bank name). + example: Bank of America + account: + $ref: '#/components/schemas/ExternalAccountDetails' + accountHolder: + oneOf: + - $ref: '#/components/schemas/BusinessAccountHolder' + - $ref: '#/components/schemas/IndividualAccountHolder' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalAccount' + examples: + swiftExternalAccount: + $ref: '#/components/examples/swiftExternalAccount' + iBANExternalAccount: + $ref: '#/components/examples/iBANExternalAccount' + usBankExternalAccount: + $ref: '#/components/examples/usBankExternalAccount' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' + /accounts/external/{accountId}: + get: + operationId: getExternalAccountDetails + summary: Get external account details + tags: + - accounts + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - in: path + name: accountId + required: true + description: External account identifier. + schema: + type: string + responses: + '200': + description: External account details. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalAccount' + examples: + swiftExternalAccount: + $ref: '#/components/examples/swiftExternalAccount' + iBANExternalAccount: + $ref: '#/components/examples/iBANExternalAccount' + usBankExternalAccount: + $ref: '#/components/examples/usBankExternalAccount' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' + put: + operationId: updateExternalAccount + summary: Update external account details + tags: + - accounts + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - in: path + name: accountId + required: true + description: External account identifier. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - idempotencyKey + properties: + idempotencyKey: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Unique identifier of the request. + account: + type: object + description: Update US bank account details. + properties: + accountType: + description: Type of the account. + type: string + enum: + - Checking + - Savings + example: Checking + accountHolder: + type: object + description: Update account holder address. + properties: + address: + $ref: '#/components/schemas/Address' + responses: + '200': + description: External account updated. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalAccount' + examples: + swiftExternalAccount: + $ref: '#/components/examples/swiftExternalAccount' + iBANExternalAccount: + $ref: '#/components/examples/iBANExternalAccount' + usBankExternalAccount: + $ref: '#/components/examples/usBankExternalAccount' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' + delete: + operationId: deleteExternalAccount + summary: Delete external account + tags: + - accounts + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - in: path + name: accountId + required: true + description: External account identifier. + schema: + type: string + responses: + '201': + description: External account deleted. + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' /accounts/{accountId}/balances: get: operationId: getBalances @@ -1691,6 +1959,102 @@ paths: $ref: '#/components/responses/ErrorResponse' 5XX: $ref: '#/components/responses/ErrorResponse' + /crosstransfer/onramp: + post: + operationId: createCrossTransferOnRampRouting + summary: Creates deposit-only fiat account as a source, configures trigger and stores payment instruction details about destination crypto account. As a result, the user will be able to deposit fiat to the source account and receive payment in crypto to the destination account. + tags: + - crosstransfers + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOnRampRoutingRequest' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountId' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' + /crosstransfer/offramp: + post: + operationId: createCrossTransferOffRampRouting + summary: Creates deposit-only crypto account as a source, configures trigger and stores payment instruction details about destination fiat account. As a result, the user will be able to deposit crypto to the source account and receive fiat to the destination account. + tags: + - crosstransfers + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOffRampRoutingRequest' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountId' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' + /crosstransfer/bridging: + post: + operationId: createCrossTransferBridging + summary: Creates deposit-only crypto account as a source, configures trigger and stores payment instruction details about destination crypto address. As a result, the user will be able to deposit crypto to the source account and receive exchanged value to destination address in selected cryptocurrency. + tags: + - crosstransfers + parameters: + - $ref: '#/components/parameters/X-FBAPI-KEY' + - $ref: '#/components/parameters/X-FBAPI-NONCE' + - $ref: '#/components/parameters/X-FBAPI-SIGNATURE' + - $ref: '#/components/parameters/X-FBAPI-TIMESTAMP' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateBridgingRequest' + responses: + '200': + description: Sub-account created. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountId' + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + 4XX: + $ref: '#/components/responses/ErrorResponse' + 5XX: + $ref: '#/components/responses/ErrorResponse' components: parameters: X-FBAPI-KEY: @@ -1986,6 +2350,242 @@ components: allOf: - $ref: '#/components/schemas/AccountId' - $ref: '#/components/schemas/AccountData' + ExternalAccountRef: + type: object + required: + - type + - externalAccountId + properties: + type: + type: string + enum: + - ExternalAccount + example: ExternalAccount + externalAccountId: + $ref: '#/components/schemas/ExternalAccountId' + AccountRef: + type: object + required: + - type + - accountId + properties: + type: + type: string + enum: + - Account + example: Account + accountId: + $ref: '#/components/schemas/AccountId' + ExternalAccountId: + description: ID of the account in the external system. + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + USBankAccountDetails: + type: object + required: + - type + - accountNumber + - routingNumber + properties: + type: + type: string + example: US + description: Type of the account. + enum: + - US + accountNumber: + type: string + example: '123456789' + description: Account number of the US bank account. + routingNumber: + type: string + example: '123456789' + description: Routing number of the US bank account. + accountType: + type: string + enum: + - Checking + - Savings + example: Checking + iBanAccountDetails: + type: object + required: + - type + - accountNumber + - bic + - country + properties: + type: + type: string + description: Type of the account. + example: IBAN + enum: + - IBAN + accountNumber: + description: International Bank Account Number (iBAN). + type: string + example: DE89370400440532013000 + bic: + description: Bank Identifier Code (BIC). + type: string + example: DEUTDEFF + country: + description: ISO 3166-1 alpha-2 country code. + type: string + example: DE + Address: + type: object + required: + - streetLine1 + - city + - country + description: Address details for the SWIFT transfer. + properties: + streetLine1: + type: string + example: 1 Churchill Place + streetLine2: + type: string + example: Canary Wharf + city: + type: string + example: London + state: + type: string + postalCode: + type: string + example: E14 5HP + country: + description: ISO 3166-1 alpha-2 country code. + type: string + example: GB + SwiftAccountDetails: + type: object + description: Account details for the SWIFT transfer. + required: + - accountNumber + - bic + - address + properties: + type: + type: string + example: Swift + description: Type of the account. + enum: + - Swift + accountNumber: + description: International Bank Account Number (iBAN). + type: string + example: GB29NWBK60161331926819 + bic: + description: Bank Identifier Code (BIC). + type: string + example: NWBKGB2L + country: + description: ISO 3166-1 alpha-2 country code. + type: string + example: GB + address: + $ref: '#/components/schemas/Address' + category: + description: The context of business operations + type: string + enum: + - Client + - ParentCompany + - Subsidiary + - Affiliate + - Supplier + purpose: + type: string + description: The nature of the transactions this account will participate in + enum: + - IntraGroupTransfer + - InvoiceForGoodsAndServices + shortBusinessDescription: + type: string + description: How the business uses the funds + example: Payment for goods and services + ExternalAccountDetails: + oneOf: + - $ref: '#/components/schemas/SwiftAccountDetails' + - $ref: '#/components/schemas/USBankAccountDetails' + - $ref: '#/components/schemas/iBanAccountDetails' + discriminator: + propertyName: type + mapping: + Swift: '#/components/schemas/SwiftAccountDetails' + US: '#/components/schemas/USBankAccountDetails' + IBAN: '#/components/schemas/iBanAccountDetails' + IndividualAccountHolder: + description: Individual account holder details. + type: object + required: + - type + - firstName + - lastName + - address + properties: + type: + type: string + enum: + - Individual + firstName: + type: string + lastName: + type: string + address: + $ref: '#/components/schemas/Address' + BusinessAccountHolder: + description: Business account holder details. + type: object + required: + - type + - businessName + - address + properties: + type: + type: string + enum: + - Business + businessName: + type: string + example: Acme Inc. + address: + $ref: '#/components/schemas/Address' + ExternalAccount: + type: object + required: + - id + - currency + - customerId + - servicedBy + - account + - accountHolder + properties: + id: + $ref: '#/components/schemas/ExternalAccountId' + currency: + $ref: '#/components/schemas/AssetReference' + customerId: + type: string + description: ID of the customer who will be account holder. + example: 123e4567-e89b-12d3-a456-426614174000 + servicedBy: + type: string + description: Name of the external service provider (e.g. bank name). + example: Bank of America + account: + $ref: '#/components/schemas/ExternalAccountDetails' + accountHolder: + oneOf: + - $ref: '#/components/schemas/BusinessAccountHolder' + - $ref: '#/components/schemas/IndividualAccountHolder' + discriminator: + propertyName: type + mapping: + Individual: '#/components/schemas/IndividualAccountHolder' + Business: '#/components/schemas/BusinessAccountHolder' Balances: type: array description: Maps balance assets to their balances. @@ -2137,6 +2737,15 @@ components: - $ref: '#/components/schemas/NationalCurrency' - $ref: '#/components/schemas/NativeCryptocurrency' - $ref: '#/components/schemas/OtherAssetReference' + FiatRail: + type: string + example: SWIFT + enum: + - ACH + - SEPA + - SWIFT + - IBAN + - Wire Blockchain: type: string enum: @@ -3350,4 +3959,231 @@ components: enum: - CanCreate - CannotCreate + CreateBridgingRequest: + type: object + required: + - idempotencyKey + - customerId + - source + - destination + properties: + idempotencyKey: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + customerId: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + source: + $ref: '#/components/schemas/BridgingSourceParameters' + destination: + $ref: '#/components/schemas/BridgingDestination' + BridgingDestination: + type: object + required: + - chain + - currency + - address + properties: + chain: + $ref: '#/components/schemas/Blockchain' + currency: + $ref: '#/components/schemas/NativeCryptocurrency' + address: + description: Address of the destination account. + type: string + memo: + description: Memo field for the destination address. Required for some blockchains. + type: string + BridgingSourceParameters: + type: object + required: + - currency + properties: + chain: + $ref: '#/components/schemas/Blockchain' + currency: + $ref: '#/components/schemas/NativeCryptocurrency' + developerFee: + $ref: ./fb-provider-api.yaml#/components/schemas/PositiveAmount + CreateOnRampRoutingRequest: + type: object + required: + - idempotencyKey + - customerId + - source + - destination + properties: + idempotencyKey: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + customerId: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + source: + $ref: '#/components/schemas/OnRampSourceParameters' + destination: + $ref: '#/components/schemas/OnRampDestination' + OnRampDestination: + type: object + required: + - chain + - currency + - address + properties: + chain: + $ref: '#/components/schemas/Blockchain' + currency: + $ref: '#/components/schemas/NativeCryptocurrency' + address: + description: Address of the destination account. + type: string + memo: + description: Memo field for the destination address. Required for some blockchains. + type: string + OnRampSourceParameters: + type: object + required: + - currency + properties: + currency: + $ref: '#/components/schemas/NativeCryptocurrency' + developerFee: + $ref: '#/components/schemas/PositiveAmount' + OffRampSourceParameters: + type: object + required: + - chain + - currency + properties: + chain: + $ref: '#/components/schemas/Blockchain' + currency: + $ref: '#/components/schemas/NativeCryptocurrency' + developerFee: + $ref: '#/components/schemas/PositiveAmount' + returnAddress: + type: string + description: Blockchain address to return the funds in case of a failed transaction. MUST be on same blockchain network that is selected in the chain field. Field will be ignored in case of Stellar chain. + OffRampDestination: + type: object + required: + - rail + - currency + - account + properties: + rail: + $ref: '#/components/schemas/FiatRail' + currency: + $ref: '#/components/schemas/NationalCurrency' + message: + type: string + description: A message to be sent with a wire transfer. It can have at most 3 lines (separated by "\n"), each line with a max length of 35 chars + maxLength: 109 + reference: + type: string + description: If rail is SEPA, this is the SEPA reference and must be from 6 to 140 characters. The allowed characters are a-z, A-Z, 0-9, spaces, ampersand (&), hyphen (-), full stop (.), and solidus (/). If rail is ACH, this is the ACH reference and can be at most 10 characters, A-Z, a-z, 0-9, and spaces. + account: + oneOf: + - $ref: '#/components/schemas/ExternalAccountRef' + - $ref: '#/components/schemas/AccountRef' + discriminator: + propertyName: type + mapping: + ExternalAccount: '#/components/schemas/ExternalAccountRef' + Account: '#/components/schemas/AccountRef' + CreateOffRampRoutingRequest: + type: object + required: + - idempotencyKey + - customerId + - source + - destination + properties: + idempotencyKey: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + customerId: + type: string + example: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + source: + $ref: '#/components/schemas/OffRampSourceParameters' + destination: + $ref: '#/components/schemas/OffRampDestination' + examples: + usBankExternalAccount: + summary: US bank account + description: Example of a US bank account. + value: + id: 4ff63424-7e09-4cdf-b7f1-da7b7c65eabe + customerId: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + currency: + nationalCurrencyCode: USD + servicedBy: Bank of America + account: + type: US + accountNumber: '1234567890' + routingNumber: '123456789' + accountType: Checking + accountHolder: + type: Individual + firstName: John + lastName: Doe + address: + streetLine1: 1 Churchill Place + city: London + postalCode: E14 5HP + country: GB + iBANExternalAccount: + summary: iBAN account + description: Example of an iBAN account. + value: + id: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + customerId: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + currency: + nationalCurrencyCode: EUR + servicedBy: Deutsche Bank + account: + type: IBAN + accountNumber: DE89370400440532013000 + bic: DEUTDEFF + country: DE + accountHolder: + type: Individual + firstName: John + lastName: Doe + address: + streetLine1: 1 Churchill Place + city: London + postalCode: E14 5HP + country: GB + swiftExternalAccount: + summary: SWIFT account + description: Example of a SWIFT account. + value: + id: 76a33ed9-8aa2-4781-93f8-d2369c0c2b14 + customerId: 2e7b3b9b-8aa2-4781-93f8-d2369c0c2b14 + currency: + nationalCurrencyCode: USD + servicedBy: Bank of America + account: + type: Swift + accountNumber: GB29NWBK60161331926819 + bic: NWBKGB2L + country: GB + address: + streetLine1: 1 Churchill Place + city: London + postalCode: E14 5HP + country: GB + accountHolder: + type: Business + businessName: Acme Inc. + address: + streetLine1: 1 Churchill Place + city: London + postalCode: E14 5HP + country: GB + category: Client + purpose: IntraGroupTransfer + shortBusinessDescription: Payment for goods and services securitySchemes: {}