Nominal codes

Nominal codes are the codes that are used in the chart of accounts to record income and expenditure, they can be applied to line items in an invoice.

The nominal code object

Attributes

  • _id
    string

    A unique Id for the nominal code.

  • created
    string

    The date/time the nominal code was created.

  • description
    string

    A description of the nominal code (e.g. Cleaning supplies).

  • modified
    string

    The date/time the nominal code was modified.

  • nominal_code
    string

    A unique nominal code.

The nominal code object
{
    "_id": "662edc5a835c6a1ad9675ce8",
    "created": "2024-04-28 23:31:38",
    "description": "Sales",
    "modified": "2024-04-28 23:31:38",
    "nominal_code": "200"
}

List all nominal codes

Return a list of nominal codes 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; description, nominal_code.

  • 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
    • modified
    • nominal_code

Response

Returns a page of nominal codes.

GET
/v1/nominal-codes
var nominalCodes = apiClient.Request(
    HttpMethod.Get,
    "nominal-codes",
    new MultiValueDict()
        .Add("attributes", "description")
);
<?php

$nominal_codes = $api_client->request(
    'GET',
    'nominal-codes',
    [
        'attributes'=>['description']
    ]
);
nominal_codes = api_client(
    'GET',
    'nominal-codes',
    params={
        'attributes': ['description']
    }
)
nominal_codes = api_client.request(
    'GET',
    'nominal-codes',
    params: {
        'attributes' => ['description']
    }
)
Response
{
    "item_count": 2,
    "items": [
        {
            "_id": "662edc5a835c6a1ad9675ce6",
            "description": "Other revenue"
        },
        {
            "_id": "662edc5a835c6a1ad9675ce8",
            "description": "Sales"
        }
    ],
    "page": 1,
    "page_count": 1,
    "per_page": 10
}

Retrieve a nominal code

Retrieve a nominal code object.

Response

Returns a nominal code object.

GET
/v1/nominal-codes/<nominal_code_id>
var nominalCode = apiClient.Request(
    HttpMethod.Get, 
    $"nominal-codes/{nominalCodeId}"
);
<?php

$nominal_code = $api_client->request(
    'GET',
    'nominal-codes/' . $nominal_code_id
);
nominal_code = api_client('GET', f'nominal-codes/{nominal_code_id}')
nominal_code = api_client.request('GET', "nominal-codes/#{nominal_code_id}")
Response
{
    "_id": "662edc5a835c6a1ad9675ce8",
    "created": "2024-04-28 23:31:38",
    "description": "Sales",
    "modified": "2024-04-28 23:31:38",
    "nominal_code": "200"
}