Bank Channels

Available since API version 2

Table of Contents


What is a bank channel in foreign exchange operations?

Bank channels represent the mechanisms used for the payment and settlement of foreign exchange orders. They are defined based on the associated asset (fiat currency or crypto asset).


Types of Bank Channels

The API supports the following types of bank channels:

TED_PIX

This channel is used for local currency (BRL) transactions via TED or PIX transfers.

  • For buy orders (of foreign currency or crypto assets), the company pays BRL through a channel defined by Trace Finance.
  • For sell orders, the company will receive BRL via TED or PIX as settlement.
  • This channel only supports BRL.
  • This channel cannot be associated with counterparties.

SWIFT

An international channel used exclusively for foreign fiat currencies.

  • For buy orders, the settlement is made through a channel associated with the counterparty.
  • For sell orders, the counterparty makes the payment via SWIFT defined by Trace Finance.
  • Supported currencies: AUD, CAD, EUR, GBP, USD.
  • This channel must always be associated with a counterparty.

CRYPTO_WALLET

A channel used exclusively for crypto assets.

  • For buy orders, the settlement is made through a channel associated with the counterparty.
  • For sell orders, the counterparty sends the crypto assets to a wallet defined by Trace Finance.
  • Supported currencies: USDC, USDT.
  • This channel must always be associated with a counterparty.

How to Create a Bank Channel

SWIFT Bank Channel

curl --location 'https://faas.dev.tracefinance.io/exchange/api/bankChannels' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer *********' \
--data '{
  "counterpartyId": "counterparty-uuid",
  "type": "SWIFT",
  "currency": "USD",
  "swiftCode": "swift-code",
  "iban": "iban-code",
  "aba": "aban-number",
  "name": "John Doe - Bank Channel",
  "institutionNumber": null,
  "transitNumber": null,
  "referenceField": null
}'
{
  "id": "bank-channel-uuid",
  "companyId": "company-uuid",
  "counterpartyId": "counterparty-uuid",
  "type": "SWIFT",
  "currency": "USD",
  "swiftCode": "swift-code",
  "iban": "iban-code",
  "aba": "aban-number",
  "name": "John Doe - Bank Channel",
  "institutionNumber": null,
  "transitNumber": null,
  "referenceField": null,
  "createdAt": "YYYY-MM-DDTHH:mm:SSs",
  "updatedAt": "YYYY-MM-DDTHH:mm:SSs"
}

TED_PIX Bank Channel

curl --location 'https://faas.dev.tracefinance.io/exchange/api/bankChannels' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer *********' \
--data '{
  "type": "TED_PIX",
  "name": "Company TED_PIX Account",
  "bankCode": "brazilian-bank-code",
  "branchCode": "branch-code",
  "accountNumber": "account-number"
}'
{
  "id": "bank-channel-uuid",
  "companyId": "company-uuid",
  "counterpartyId": null,
  "type": "TED_PIX",
  "currency": "BRL",
  "bankCode": "brazilian-bank-code",
  "bankName": "BANCO NAME",
  "branchCode": "branch-code",
  "accountNumber": "account-number",
  "pixKey": null,
  "name": "Bank XXX",
  "createdAt": "YYYY-MM-DDTHH:mm:SSs",
  "updatedAt": "YYYY-MM-DDTHH:mm:SSs"
}

CRYPTO_WALLET Channel

curl --location 'https://faas.dev.tracefinance.io/exchange/api/bankChannels' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer *********' \
--data '{
  "type": "CRYPTO_WALLET",
  "currency": "USDC",
  "name": "My USDT Wallet",
  "address": "wallet-address",
  "chain": "ETHEREUM"
}'
{
  "id": "bank-channel-id",
  "companyId": "company-id",
  "counterpartyId": "counterparty-id",
  "type": "CRYPTO_WALLET",
  "currency": "USDC",
  "name": "My USDT Wallet",
  "address": "wallet-address",
  "chain": "ETHEREUM",
  "createdAt": "YYYY-MM-DDTHH:mm:SSs",
  "updatedAt": "YYYY-MM-DDTHH:mm:SSs"
}

How to List Bank Channels

List by Currency and Counterparty

curl --location 'https://faas.dev.tracefinance.io/exchange/api/bankChannels?filters=and(currency[eq]={{CURRENCY_CODE}},counterpartyId[eq]={{COUNTERPARTY_ID}})'
{
    "data": [
      {
        "id": "bank-channel-uuid",
        "companyId": "company-uuid",
        "counterpartyId": "counterparty-uuid",
        "type": "SWIFT",
        "currency": "USD",
        "swiftCode": "swift-code",
        "iban": "iban-code",
        "aba": "aban-number",
        "name": "John Doe - Bank Channel",
        "institutionNumber": null,
        "transitNumber": null,
        "referenceField": null,
        "createdAt": "YYYY-MM-DDTHH:mm:SSs",
        "updatedAt": "YYYY-MM-DDTHH:mm:SSs"
      }
    ],
    "meta": {
      "previousCursor": null,
      "nextCursor": null,
      "total": 1,
      "totalMatches": null
    }
}

List by Currency

curl --location 'https://faas.dev.tracefinance.io/exchange/api/bankChannels?filters=currency[eq]={{CURRENCY_CODE}}'
{
  "data": [
    {
      "id": "bank-channel-uuid",
      "companyId": "company-uuid",
      "counterpartyId": "counterparty-uuid",
      "type": "CRYPTO_WALLET",
      "currency": "USDT",
      "name": "My USDT Wallet",
      "address": "wallet-address",
      "chain": "ETHEREUM",
      "createdAt": "YYYY-MM-DDTHH:mm:SSs",
      "updatedAt": "YYYY-MM-DDTHH:mm:SSs"
    }
  ],
  "meta": {
    "previousCursor": null,
    "nextCursor": null,
    "total": 1,
    "totalMatches": null
  }
}

Common Errors

BRAZILIAN_BANK_NOT_FOUND

Error returned when the bank code is invalid during the creation of a TED_PIX account.

{
  "code": "BRAZILIAN_BANK_NOT_FOUND",
  "message": "Brazilian bank not found",
  "details": {
    "field": "bankCode",
    "value": "XXX"
  }
}

RESOURCE_NOT_FOUND

Error returned when the specified counterparty ID is invalid or does not exist.

{
  "code": "RESOURCE_NOT_FOUND",
  "message": "Counterparty with id equal to counterparty-uuid not found",
  "details": {
    "resource": "Counterparty",
    "field": "id",
    "value": "counterparty-uuid"
  }
}

BANK_CHANNEL_CURRENCY_UNSUPPORTED

Error returned when the currency is not compatible with the specified channel type.

{
  "code": "BANK_CHANNEL_CURRENCY_UNSUPPORTED",
  "message": "Currency is not supported for crypto wallet",
  "details": {
    "currency": "USD"
  }
}