Cash books

A cash book for recording receipts and payments against (via a bank account).

The cash book object

Attributes

  • _id
    string

    A unique Id for the cash book.

  • code
    string

    The cash books code.

  • created
    string

    The date/time the cash book was created.

  • modified
    string

    The date/time the cash book was modified.

  • name
    string

    The name of the cash book.

The cash book object
{
    "_id": "6932cde23550e2b34494ab9d",
    "code": "1000",
    "created": "2025-12-05 12:19:46",
    "modified": "2025-12-05 12:19:46",
    "name": "Douglas House CB"
}

List all cash books

Return a list of cash books setup for your account on CareHQ.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-ids
    optional

    A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.

  • filters-modified_after
    optional

    A filter that accepts a date/time and filters the items returned to those modified after the date/time.

  • filters-modified_before
    optional

    A filter that accepts a date/time and filters the items returned to those modified before the date/time.

  • filters-q
    optional

    A case insensitive keyword filter applied to the following fields; code, name.

  • page
    optional
    default 1

    The page number to fetch.

  • per_page
    optional
    default 10

    The number of items to return per page.

  • sort_by
    optional
    default _id

    A list of fields the returned items can be sorted by. Fields prefixed with minus (-) sign are sorted in descending order.

    • _id
    • created
    • code
    • modified
    • name

Response

Returns a page of cash books.

GET
/v1/cash-books
var cashBooks = apiClient.Request(
    HttpMethod.Get,
    "cash-books",
    new MultiValueDict()
        .Add("attributes", "name", "code")
);
<?php

$cash_books = $api_client->request(
    'GET',
    'cash-books',
    [
        'attributes'=>['name', 'code']
    ]
);
cash_books = api_client(
    'GET',
    'cash-books',
    params={
        'attributes': ['name', 'code']
    }
)
cash_books = api_client.request(
    'GET',
    'cash-books',
    params: {
        'attributes' => ['name', 'code']
    }
)
Response
{
    "item_count": 3,
    "items": [
        {
            "_id": "6932cde23550e2b34494ab9b",
            "code": "3000",
            "name": "Direct debit"
        },
        {
            "_id": "6932cde23550e2b34494ab9d",
            "code": "1000",
            "name": "Douglas House CB"
        },
        {
            "_id": "6932cde23550e2b34494ab9f",
            "code": "2000",
            "name": "Upton Court CB"
        }
    ],
    "page": 1,
    "page_count": 1,
    "per_page": 10
}

Retrieve a cash book

Retrieve a cash book object.

Response

Returns a cash book object.

GET
/v1/cash-books/<cash_book_id>
var cash_book = apiClient.Request(
    HttpMethod.Get,
    $"cash-books/{cashBookId}"
);
<?php

$cash_book = $api_client->request(
    'GET',
    'cash-books/' . $cash_book_id
);
cash_book = api_client('GET', f'cash-books/{cash_book_id}')
cash_book = api_client.request('GET', "cash-books/#{cash_book_id}")
Response
{
    "_id": "6932cde23550e2b34494ab9d",
    "code": "1000",
    "created": "2025-12-05 12:19:46",
    "modified": "2025-12-05 12:19:46",
    "name": "Douglas House CB"
}