Skip to main content
POST
/
v1
/
chart-of-accounts:search
Fetch a list of accounts
curl --request POST \
  --url https://external.pleo.io/v1/chart-of-accounts:search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json;charset=UTF-8' \
  --data '
{
  "companyId": "123e4567-e89b-12d3-a456-426614174011",
  "excludeIfAssignedToCategory": false,
  "excludeIfAssignedToContraAccount": false,
  "archived": false,
  "code": "2001",
  "externalId": "123e4567-e89b-12d3-a456-426614174011",
  "ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "name": "Bank Charges"
}
'
{
  "data": [
    {
      "accountingSystem": "xero",
      "archived": false,
      "code": "2001",
      "companyId": "123e4567-e89b-12d3-a456-426614174006",
      "externalId": "External Id",
      "id": "123e4567-e89b-12d3-a456-426614174005",
      "name": "Bank Charges",
      "taxCodeExternalId": "IVA 20"
    }
  ],
  "pagination": {
    "currentRequestPagination": {
      "parameters": {}
    },
    "endCursor": "string",
    "hasNextPage": true,
    "hasPreviousPage": true,
    "startCursor": "string",
    "total": 1
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

before
string

Lower bound of the page of data to return (cannot be used together with [after] or [offset]).

after
string

Upper bound of the page of data to return (cannot be used together with [before] or [offset]).

offset
integer<int64>

Offset of the page of data to return (cannot be used together with [before] or [after]).

limit
integer<int32>

The maximum amount of items to return.

sorting_keys
string[]

The keys to sort the results by.

sorting_order
enum<string>[]

The order to sort the results by. Must be the same length as [sortingKeys]; one order per key.

Available options:
ASC,
ASC_NULLS_FIRST,
ASC_NULLS_LAST,
DESC,
DESC_NULLS_FIRST,
DESC_NULLS_LAST

Body

application/json;charset=UTF-8

Represents a request to search for accounts.

companyId
string<uuid>
required

Filter by company ID.

Example:

"123e4567-e89b-12d3-a456-426614174011"

excludeIfAssignedToCategory
boolean
default:false
required

Exclude bookkeeping accounts assigned to a bookkeeping category.

Example:

false

excludeIfAssignedToContraAccount
boolean
default:false
required

Exclude bookkeeping accounts assigned to a contra account.

Example:

false

archived
boolean | null

Filter by archived status.

Example:

false

code
string | null

Search by code.

Example:

"2001"

externalId
string | null

Search by external id.

Example:

"123e4567-e89b-12d3-a456-426614174011"

ids
(string<uuid> | null)[] | null

Filter by a list of account IDs.

Filter by a list of account IDs.

name
string | null

Search by name.

Example:

"Bank Charges"

Response

Retrieval of accounts successful.

data
object[]
required
pagination
object
required