3: Fetch Global Currency Accounts

See Authorization section for details to get a valid autheintication token

curl -X POST \
  https://sandbox.api.ofx.com/v1/gca/virtual-accounts \
  -H 'authorization: Bearer your_access_code' \
  -H 'content-type: application/json' \

In this example:

  • We want to list all the virtual accounts for an OFX user with the available balance in each of them.

The successful response contains the virtual account list:.

[
  {
    "virtualAccountId": "05a1effe-ae0d-4c61-986f-db11c5b7dd8d",
    "currency": "USD",
    "virtualAccountNumber": "1233397887",
    "virtualAccountNickname": "Amazon USA",
    "bankName": "Bank Of America, NA",
    "bankCode": "121000358",
    "bankSwift": "BOFAUS3N",
    "bankAddress": {
      "country": "AU",
      "addressLine1": "60 Martin Place",
      "addressLine2": "Sydney",
      "citySuburb": "Sydney",
      "stateProvince": "NSW",
      "postcode": "NSW"
    },
    "availableBalance": 100.25
  },
  {
    "virtualAccountId": "xxx2c4f9-3238-4cef-9ee6-71c91c35d2c5",
    "currency": "AUD",
    "virtualAccountNumber": "45678-123",
    "virtualAccountNickname": "Another Account",
    "bankName": "Barclays AUD",
    "bankCode": "203222",
    "bankSwift": "xxxCGB11XXX",
    "bankIban": "xxx5BARC20320630419xxx",
    "bankAddress": {
      "country": "AU",
      "addressLine1": "60 Martin Place",
      "addressLine2": "Sydney",
      "citySuburb": "Sydney",
      "stateProvince": "NSW",
      "postcode": "NSW"
    },
    "availableBalance": 3000
  }
]

Congratulations

We’ve just retrieved a list of global currency accounts with it’s balance!

You can also get more information at our Developer FAQ page and OFX FAQ page