Accounts

Accounts are a crucial part of Fin X — they represent the various types of financial accounts you can manage. On this page, we’ll dive into the different account endpoints you can use to manage accounts programmatically. We'll look at how to query, create, update, and delete accounts.

The account model

The account model contains all the information about the financial accounts you manage. Each account can have different attributes based on its type and usage.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the account.

  • Name
    type
    Type
    string
    Description

    Type of the account (e.g., savings, checking, investment).

  • Name
    balance
    Type
    number
    Description

    Current balance of the account.

  • Name
    currency
    Type
    string
    Description

    Currency used in the account.

  • Name
    owner_id
    Type
    string
    Description

    Unique identifier for the account owner.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the account was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the account was last updated.


GET/v1/accounts

List all accounts

This endpoint allows you to retrieve a paginated list of all your accounts. By default, a maximum of ten accounts are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of accounts returned.

  • Name
    type
    Type
    string
    Description

    Only show accounts of the specified type.

  • Name
    owner_id
    Type
    string
    Description

    Only show accounts for the specified owner.

Request

GET
/v1/accounts
curl -G https://api.finx.ai/v1/accounts \
  -H "Authorization: Bearer {token}" \
  -d limit=10

Response

{
  "has_more": false,
  "data": [
    {
      "id": "xgQQXg3hrtjh7AvZ",
      "type": "savings",
      "balance": 5000,
      "currency": "USD",
      "owner_id": "WAz8eIbvDR60rouK",
      "created_at": 705103200,
      "updated_at": 705103200
    },
    {
      "id": "hSIhXBhNe8X1d8Et"
      // ...
    }
  ]
}

POST/v1/accounts

Create an account

This endpoint allows you to add a new account. You need to provide the account type, initial balance, currency, and owner ID to create an account.

Required attributes

  • Name
    type
    Type
    string
    Description

    Type of the account (e.g., savings, checking, investment).

  • Name
    balance
    Type
    number
    Description

    Initial balance of the account.

  • Name
    currency
    Type
    string
    Description

    Currency used in the account.

  • Name
    owner_id
    Type
    string
    Description

    Unique identifier for the account owner.

Request

POST
/v1/accounts
curl https://api.finx.ai/v1/accounts \
  -H "Authorization: Bearer {token}" \
  -d 'type'="savings" \
  -d 'balance'=5000 \
  -d 'currency'="USD" \
  -d 'owner_id'="WAz8eIbvDR60rouK"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "type": "savings",
  "balance": 5000,
  "currency": "USD",
  "owner_id": "WAz8eIbvDR60rouK",
  "created_at": 705103200,
  "updated_at": 705103200
}

GET/v1/accounts/:id

Retrieve an account

This endpoint allows you to retrieve an account by providing the account id. Refer to the list at the top of this page to see which properties are included with account objects.

Request

GET
/v1/accounts/xgQQXg3hrtjh7AvZ
curl https://api.finx.ai/v1/accounts/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "type": "savings",
  "balance": 5000,
  "currency": "USD",
  "owner_id": "WAz8eIbvDR60rouK",
  "created_at": 705103200,
  "updated_at": 705103200
}

PUT/v1/accounts/:id

Update an account

This endpoint allows you to perform an update on an account. Examples of updates are changing the balance, updating the currency, or modifying the account type.

Optional attributes

  • Name
    balance
    Type
    number
    Description

    Updated balance of the account.

  • Name
    currency
    Type
    string
    Description

    Updated currency used in the account.

  • Name
    type
    Type
    string
    Description

    Updated type of the account.

Request

PUT
/v1/accounts/xgQQXg3hrtjh7AvZ
curl -X PUT https://api.finx.ai/v1/accounts/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}" \
  -d 'balance'=6000

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "type": "savings",
  "balance": 6000,
  "currency": "USD",
  "owner_id": "WAz8eIbvDR60rouK",
  "created_at": 705103200,
  "updated_at": 705103200
}

DELETE/v1/accounts/:id

Delete an account

This endpoint allows you to delete your accounts in Fin X. Note: This will permanently delete the account and all its data — ensure this is the desired action before proceeding.

Request

DELETE
/v1/accounts/xgQQXg3hrtjh7AvZ
curl -X DELETE https://api.finx.ai/v1/accounts/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Was this page helpful?