Book
A Book represents General Ledger for a company or business, but can also represent a Ledger for a project or department
It contains all Accounts where Transactions are recorded/posted;
Performs create new Book.
Returns The created Book object
Creates a new Integration in the Book.
Returns The created Integration object
integration
The Integration object or wrapped plain json
Formats a date according to date pattern of the Book.
Returns The date formated
date
The date to format as string.
timeZone
The output timezone of the result. Default to script’s timeZone
Formats a value according to DecimalSeparator and fraction digits of the Book.
Returns The value formated
value
The value to be formatted.
getAccount(
idOrName?:
string
):
Promise<
Account
|
undefined
>
Gets an Account object
Returns The matching Account object
idOrName
The id or name of the Account
Gets all Accounts of this Book
Returns The retrieved Account objects
getClosingDate():
string
|
undefined
Returns The closing date of the Book in ISO format yyyy-MM-dd
Returns The collection of this book
getDatePattern():
string
|
undefined
Returns The date pattern of the Book. Current: dd/MM/yyyy |
MM/dd/yyyy |
yyyy/MM/dd |
getDecimalPlaces():
number
|
undefined
Returns The number of decimal places supported by this Book. Same as getFractionDigits
Returns The decimal separator of the Book
getFile(
id:
string
):
Promise<
File
>
Retrieve a file by id
getFractionDigits():
number
|
undefined
Returns The number of fraction digits supported by this Book. Same as getDecimalPlaces
getGroup(
idOrName?:
string
):
Promise<
Group
|
undefined
>
Gets a Group object
Returns The matching Group object
idOrName
The id or name of the Group
getGroups():
Promise<
Group
[]>
Gets all Groups of this Book
Returns The retrieved Group objects
Gets the existing Integrations in the Book.
Returns The existing Integration objects
getLastUpdateMs():
number
|
undefined
Returns The last update date of the book, in in milliseconds
getLockDate():
string
|
undefined
Returns The lock date of the Book in ISO format yyyy-MM-dd
getName():
string
|
undefined
Returns The name of this Book
getOwnerName():
string
|
undefined
Returns The name of the owner of the Book
getPageSize():
number
|
undefined
Returns The transactions pagination page size
Returns The period slice for balances visualization
getPeriodStartMonth():
Month
Returns The start month when YEAR period set
Returns The permission for the current user
getProperties():
any
Gets the custom properties stored in this Book
getProperty(
keys:
string
[]):
string
|
undefined
Gets the property value for given keys. First property found will be retrieved
getTimeZone():
string
|
undefined
Returns The time zone of the Book
getTimeZoneOffset():
number
|
undefined
Returns The time zone offset of the book, in minutes
getTotalTransactions():
number
Returns The total number of posted transactions
getTotalTransactionsCurrentMonth():
number
Returns The total number of posted transactions on current month
getTotalTransactionsCurrentYear():
number
Returns The total number of posted transactions on current year
getTransaction(
id:
string
):
Promise<
Transaction
|
undefined
>
Retrieve a transaction by id
Returns The visibility of the book
Returns An immutable copy of the json payload
listTransactions(
query?:
string
,
limit?:
number
,
cursor?:
string
):
Promise<
TransactionList
>
Lists transactions in the Book based on the provided query, limit, and cursor, for pagination.
Returns A TransactionPage object containing the list of transactions
query
The query string to filter transactions
limit
The maximum number of transactions to return. Default to 100, max to 1000;
cursor
The cursor for pagination
parseDate(
date:
string
):
Date
Parse a date string according to date pattern and timezone of the Book.
Also parse ISO yyyy-mm-dd format.
parseValue(
value:
string
):
Amount
|
undefined
Parse a value string according to DecimalSeparator and fraction digits of the Book.
Rounds a value according to the number of fraction digits of the Book
Returns The value rounded
setClosingDate(
closingDate:
string
):
Book
Sets the closing date of the Book in ISO format yyyy-MM-dd.
Returns This Book, for chainning.
setDatePattern(
datePattern:
string
):
Book
Sets the date pattern of the Book. Current: dd/MM/yyyy |
MM/dd/yyyy |
yyyy/MM/dd |
Returns This Book, for chainning.
Sets the decimal separator of the Book
Returns This Book, for chainning.
setFractionDigits(
fractionDigits:
number
):
Book
Sets the number of fraction digits (decimal places) supported by this Book
Returns This Book, for chainning.
setLockDate(
lockDate:
string
):
Book
Sets the lock date of the Book in ISO format yyyy-MM-dd.
Returns This Book, for chainning.
setName(
name:
string
):
Book
Sets the name of the Book.
Returns This Book, for chainning.
setPageSize(
pageSize:
number
):
Book
Sets the transactions pagination page size
Returns This Book, for chainning.
Sets the period slice for balances visualization
Returns This Book, for chainning.
Sets the start month when YEAR period set
Returns This Book, for chainning.
setProperties(
properties:
any):
Book
Sets the custom properties of the Book
Returns This Book, for chainning.
properties
Object with key/value pair properties
setProperty(
key:
string
,
value:
string
|
null
):
Book
Sets a custom property in the Book.
Returns This Book, for chainning.
setTimeZone(
timeZone:
string
):
Book
Sets the time zone of the Book
Returns This Book, for chainning.
Perform update Book, applying pending changes.
Updates an existing Integration in the Book.
Returns The updated Integration object
integration
The Integration wrapped plain json