GL accounts

name holds the account number and description holds the label. That is backwards from most expectations and it is the single most important thing to know about this resource. Scoped per company, on the companyid column.

The object#

FieldTypeDescription
idread-onlyintegerNolaPro id.
namestring(20)The code this resource is keyed by. Matching is case insensitive.
descriptionstring(255)The account label, despite the column name.
accounttypeidintegerAccount type. See glaccounttypes - read-only.
block_journalbooleanWhen true this account refuses direct journal entries, and gltransactions writes against it are rejected.
cancelbooleanTrue once cancelled. Cancelled rows stay referenced by history.
externalidstring(100)Your own key for this gl accounts. Scoped to your company.
lastchangedateread-onlystringLast modification (lastchangedate). Drives modifiedsince.

Endpoints#

GET/glaccounts/{id}/periods 200422

Period totals for one GL account.

The per-period balances NolaPro maintains for the account - the series a trial balance or a comparative statement is built from. /glaccounts/{id}/balance answers for a single date. This answers for every period, split into posted, unposted, and the year-end entries that close the books. Do not recompute these by summing gltransaction. NolaPro maintains them through period close, so a recomputed figure will disagree with the books after any adjustment or closing entry - and the books are the version the accountant already signed.

Requires scope glaccounts:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe GL account id.
When it fails
StatusCodeMeaning
422unknown_valueNo such parent record in this company. The same answer whether it does not exist or belongs to someone else, so a caller cannot probe another company's ids.
curl \
  'https://acme.nolapro.com/!/api/v2/glaccounts/104/periods' \
  -H 'Authorization: Bearer $NP_TOKEN'
GET/glaccounts 200403

List gl accounts.

Requires scope glaccounts:read.

Parameters
NameInTypeNotes
descriptionquerystringdescription. Partial match, case-insensitive.
namequerystringPartial match, case insensitive.
cancelquerystringDefaults to false. Pass true for cancelled only, or any.
modifiedsincequerystringRFC 3339 UTC timestamp. Returns only records changed since then, including cancelled ones - so cancel defaults to any rather than false when this is used. The response carries _meta.synced_through; store it and send it back next time.
externalidquerystringExact match on your own key. Scoped to your company.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
403insufficient_scopeToken lacks glaccounts:read.
curl \
  'https://acme.nolapro.com/!/api/v2/glaccounts' \
  -H 'Authorization: Bearer $NP_TOKEN'
GET/glaccounts/{id} 200404

Retrieve one record.

Requires scope glaccounts:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
404not_foundNo record with that id.
curl \
  'https://acme.nolapro.com/!/api/v2/glaccounts/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "id": 2376,
    "name": "4000",
    "description": "Sales - Retail",
    "accounttypeid": 4,
    "block_journal": false,
    "cancel": false
}
GET/glaccounts/{id}/balance 200404

Account balance, per currency.

Replaces v1's account-balance action. Computed by Glaccount_model::getBalance() - the same code the Trial Balance uses, so the number here and the number on the report cannot disagree. Optional asofdate picks a different point in time; it defaults to the end of the current GL period.

Requires scope glaccounts:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe GL account id.
asofdatequerystringDefaults to the end of the current GL period.
When it fails
StatusCodeMeaning
404not_foundNo account with that id.
curl \
  'https://acme.nolapro.com/!/api/v2/glaccounts/104/balance' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "balances": [
        {
            "currency": "Example currency",
            "balance": "125.0000",
            "period": "125.0000"
        }
    ]
}
GET/glaccounts/{id}/activity 200400404

Posted transactions against this account.

The detail lines behind /glaccounts/{id}/balance, newest first. Posted lines only. An unposted voucher is not part of the balance, so including it here would give you an activity list that does not add up to the balance on the same page - which is the one thing this endpoint has to get right. Dates filter on the GL period the voucher posted to (post2date), not the day it was keyed, for the same reason: that is what the balance is measured against. Amounts are signed - debits positive, credits negative - and the lines of any one voucher sum to zero.

Requires scope glaccounts:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe GL account id.
fromdatequerystringOnly lines posted to this period or later.
todatequerystringOnly lines posted to this period or earlier.
pagequeryintegerPage number, 1-based.
perpagequeryintegerRows per page.
When it fails
StatusCodeMeaning
400invalid_requestA date that is not a date, or page 0.
404not_foundNo account with that id.
curl \
  'https://acme.nolapro.com/!/api/v2/glaccounts/104/activity' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "data": [
        []
    ]
}