Home Integration API reference

Integration API reference

REST API for integrations and external apps

Payment accounts

Payment account endpoints cover account catalog management, account ledgers, account-focused reports, deposits, and fund transfers. Unless a section says otherwise, all endpoints require account.access, and non-admin users with restricted locations only see accounts that are enabled on their permitted business locations.

List payment accounts

Lists payment accounts visible to the token user with the same location-based visibility rules as the web Payment Accounts list.

Endpoint summary

PropertyValue
MethodGET
Path/api/v1/integration/accounts
Permissionaccount.access.
VisibilityWhen the token user is not a business admin and has restricted locations, only accounts enabled as default payment accounts on permitted locations are returned.
Search behaviorq requires at least 2 characters when sent. Legacy search still matches account name or account number.
CSV behaviorformat=csv downloads all matching rows as UTF-8 CSV with BOM and ignores page and per_page. Nested objects are JSON-encoded in CSV cells.
Success response200 with paginated PaymentAccountListItem rows or a CSV download.

Query parameters

ParameterTypeRequiredDescription
per_page, pageintegerNoPagination controls. per_page accepts 1 to 100 and defaults to 20.
is_closedboolean-like stringNo0 or 1 to filter open versus closed accounts.
q, searchstringNoText search across account name and account number.
formatstringNojson (default) or csv.

AccountTypeSummary object

FieldTypeDescription
idintegerAccount-type id.
namestringAccount-type label.
parentobject | nullOptional parent account type with id and name.

AccountDetailEntry object

FieldTypeDescription
labelstringDisplay label for one custom account detail row.
valuestringSaved value for that detail row.

PaymentAccountListItem object

FieldTypeDescription
id, name, account_numbermixedAccount identity fields.
notestring | nullOptional free-text note stored on the account.
is_closedbooleanWhether the account has been marked closed.
balancenumberRunning balance computed as credits minus debits from account transactions.
account_typeAccountTypeSummary | nullResolved type hierarchy for the account.
account_detailsarray<AccountDetailEntry> | nullOptional structured detail rows configured on the account.

Top-level JSON response

FieldTypeDescription
dataarray<PaymentAccountListItem>The current result page.
meta.current_page, meta.last_page, meta.per_page, meta.totalintegerLaravel paginator metadata.

Status codes

StatusWhen it happensResponse shape
200The payment accounts were returned successfully.{ "data": [...], "meta": { ... } } or CSV download.
403The token user lacks account.access.{ "message": "Unauthorized" }
422The query string failed validation or q was shorter than 2 characters.Laravel validation JSON or { "message": string }.

Get payment account

Returns one visible payment account with its running balance, type hierarchy, and creator id.

Endpoint summary

PropertyValue
MethodGET
Path/api/v1/integration/accounts/{id}
Permissionaccount.access.
VisibilityUses the same permitted-location account visibility as List payment accounts.
CSV behaviorformat=csv streams one UTF-8 BOM row whose data_json cell matches the JSON data object.
Success response200 with one PaymentAccountDetail object.

Query parameters

ParameterTypeRequiredDescription
formatstringNojson (default) or csv. CSV download name: payment-account-{id}-{business_id}-{timestamp}.csv.

PaymentAccountDetail object

FieldTypeDescription
All PaymentAccountListItem fieldsmixedThe same fields returned by the list endpoint.
created_byinteger | nullThe user id that created the account.

Top-level JSON response

FieldTypeDescription
dataPaymentAccountDetailThe requested payment-account payload.

Status codes

StatusWhen it happensResponse shape
200The payment account was returned successfully.{ "data": { ... } } or CSV download.
403The token user lacks account.access.{ "message": "Unauthorized" }
404The payment account id does not exist or is not visible to the token user.{ "message": "Not found" }

Account transactions (ledger)

Returns the paginated account ledger for one visible payment account, including optional opening-balance math for date-range queries.

Endpoint summary

PropertyValue
MethodGET
Path/api/v1/integration/accounts/{id}/transactions
Permissionaccount.access.
VisibilityUses the same account visibility as Get payment account.
Date rulestart_date and end_date must be sent together. When present, data.beginning_balance is the net balance before start_date.
CSV behaviorformat=csv downloads all matching lines and can prepend one opening_balance row when a date range is applied.
Success response200 with one ledger payload plus pagination metadata.

Query parameters

ParameterTypeRequiredDescription
per_page, pageintegerNoPagination controls. per_page accepts 1 to 100 and defaults to 20.
start_date, end_datestringConditionalDate strings normalized through Util::uf_date(). Both must be sent together.
typestringNocredit or debit.
qstringNoMatches note, sub type, payment reference number, or a numeric ledger-line id. Requires at least 2 characters when sent.
formatstringNojson (default) or csv.

AccountTransactionLine object

FieldTypeDescription
id, account_idintegerLedger-line id and owning account id.
type, sub_typestring | nullCredit/debit identity plus transaction subtype such as deposit or fund_transfer.
amountnumberStored transaction amount.
operation_datestring | nullISO-8601 operation timestamp.
notestring | nullOptional note stored on the account transaction.
transaction_id, transaction_payment_id, transfer_transaction_idinteger | nullOptional linked transaction, payment, and paired transfer ids.
payment_ref_no, payment_methodstring | nullResolved payment metadata when the account transaction is linked to a transaction payment.

Top-level JSON response

FieldTypeDescription
data.account_idintegerThe requested payment-account id.
data.beginning_balancenumber | nullNet balance before start_date when a date range is applied, otherwise null.
data.linesarray<AccountTransactionLine>The current result page of ledger lines.
meta.current_page, meta.last_page, meta.per_page, meta.total, meta.start_date, meta.end_date, meta.type, meta.qmixedPagination metadata plus echoed filters.

Status codes

StatusWhen it happensResponse shape
200The account ledger was returned successfully.{ "data": { ... }, "meta": { ... } } or CSV download.
403The token user lacks account.access.{ "message": "Unauthorized" }
404The payment account id does not exist or is not visible to the token user.{ "message": "Not found" }
422The date pair is incomplete or reversed, the query string failed validation, or q was shorter than 2 characters.Laravel validation JSON or { "message": string }.

Create payment account (POST)

Creates a payment account for the token user's business and can optionally seed its opening balance in the same request.

Endpoint summary

PropertyValue
MethodPOST
Path/api/v1/integration/accounts
Permissionaccount.access.
Write guardReturns 403 in demo environments.
Type ruleaccount_type_id, when sent, must belong to the current business.
Opening-balance ruleWhen opening_balance is non-zero, the API creates one opening_balance account-transaction row. Positive values create a credit; negative values create a debit.
Success response201 with one PaymentAccountDetail object.

Request body

FieldTypeRequiredDescription
namestringYesDisplay name for the payment account.
account_numberstringYesBusiness-visible account number or code.
account_type_idinteger | nullNoOptional account-type id that must belong to the current business.
notestring | nullNoOptional free-text note up to 2000 characters.
account_detailsarray<AccountDetailEntry> | nullNoOptional structured detail rows. Empty rows are discarded by the API.
opening_balancenumber | nullNoOptional opening balance parsed with the business currency settings.

Top-level JSON response

FieldTypeDescription
dataPaymentAccountDetailThe created payment-account payload reloaded with its running balance.

Status codes

StatusWhen it happensResponse shape
201The payment account was created successfully.{ "data": { ... } }
403Demo mode is active or the token user lacks account.access.{ "message": string }
422The request body failed validation, account_type_id does not belong to the business, or the business currency is not configured.Laravel validation JSON or { "message": string }.
500The account row could not be created.{ "message": "Could not create account" }

Update payment account (PATCH)

Updates the metadata for one visible payment account without changing its transaction history.

Endpoint summary

PropertyValue
MethodPATCH or PUT
Path/api/v1/integration/accounts/{id}
Permissionaccount.access.
VisibilityUses the same account visibility rules as Get payment account.
Write guardReturns 403 in demo environments.
Empty-update ruleThe request must include at least one valid updatable field; otherwise the API returns 422.
Success response200 with the refreshed PaymentAccountDetail object.

Request body

FieldTypeRequiredDescription
name, account_numberstringNoOptional basic identity fields.
account_type_idinteger | nullNoOptional account-type change. Non-null values must belong to the current business.
notestring | nullNoOptional note update.
account_detailsarray<AccountDetailEntry> | nullNoOptional replacement for the structured detail rows.

Top-level JSON response

FieldTypeDescription
dataPaymentAccountDetailThe updated payment-account payload reloaded with its running balance.

Status codes

StatusWhen it happensResponse shape
200The payment account was updated successfully.{ "data": { ... } }
403Demo mode is active or the token user lacks account.access.{ "message": string }
404The payment account id does not exist or is not visible to the token user.{ "message": "Not found" }
422The request body failed validation, no valid fields were supplied, or account_type_id does not belong to the business.Laravel validation JSON or { "message": string }.
500The account row could not be updated.{ "message": "Could not update account" }

Close payment account (POST)

Marks a visible payment account as closed, matching the web Close action.

Endpoint summary

PropertyValue
MethodPOST
Path/api/v1/integration/accounts/{id}/close
Permissionaccount.access.
VisibilityUses the same account visibility rules as Get payment account.
Write guardReturns 403 in demo environments.
Business ruleReturns 422 when the account is already closed.
Success response200 with the refreshed PaymentAccountDetail object.

Top-level JSON response

FieldTypeDescription
dataPaymentAccountDetailThe closed payment-account payload with is_closed = true.

Status codes

StatusWhen it happensResponse shape
200The payment account was closed successfully.{ "data": { ... } }
403Demo mode is active or the token user lacks account.access.{ "message": string }
404The payment account id does not exist or is not visible to the token user.{ "message": "Not found" }
422The account is already closed.{ "message": string }
500The account row could not be closed.{ "message": "Could not close account" }

Balance sheet (report)

Returns balance-sheet figures derived from purchase totals, sell totals, account balances, and closing stock.

Endpoint summary

PropertyValue
MethodGET
Path/api/v1/integration/accounts/reports/balance-sheet
Permissionaccount.access.
Date defaultWhen end_date is omitted, the API resolves it to today.
Location ruleWhen location_id is provided, it must exist for the business and be within the token user's permitted locations.
CSV behaviorformat=csv flattens the summary into section / field / value rows.

Query parameters

ParameterTypeRequiredDescription
end_datestringNoBusiness-format date resolved through TransactionUtil::uf_date(). Defaults to today.
location_idintegerNoOptional business-location filter.
formatstringNojson (default) or csv.

Top-level JSON response

FieldTypeDescription
data.end_datestringThe resolved end date used for the report.
data.supplier_due, data.customer_due, data.closing_stocknumberHeadline balance-sheet summary figures.
data.account_balancesobjectMap of account name to balance through the resolved end_date.
data.capital_account_detailsnullCurrently always null.

Status codes

StatusWhen it happensResponse shape
200The balance sheet was returned successfully.{ "data": { ... } } or CSV download.
403The token user lacks account.access or is forbidden from the requested location.{ "message": string }
404The requested location id does not exist for the current business.{ "message": "Location not found" }
422The query string failed validation.Laravel validation JSON.

Trial balance (report)

Returns supplier due, customer due, and account balances through one resolved end date.

Endpoint summary

PropertyValue
MethodGET
Path/api/v1/integration/accounts/reports/trial-balance
Permissionaccount.access.
Date defaultWhen end_date is omitted, the API resolves it to today.
Location ruleWhen location_id is provided, it must exist for the business and be within the token user's permitted locations.
CSV behaviorformat=csv flattens the summary into section / field / value rows.

Query parameters

ParameterTypeRequiredDescription
end_datestringNoBusiness-format date resolved through TransactionUtil::uf_date(). Defaults to today.
location_idintegerNoOptional business-location filter.
formatstringNojson (default) or csv.

Top-level JSON response

FieldTypeDescription
data.end_datestringThe resolved end date used for the report.
data.supplier_due, data.customer_duenumberHeadline trial-balance summary figures.
data.account_balancesobjectMap of account name to balance through the resolved end_date.
data.capital_account_detailsnullCurrently always null.

Status codes

StatusWhen it happensResponse shape
200The trial balance was returned successfully.{ "data": { ... } } or CSV download.
403The token user lacks account.access or is forbidden from the requested location.{ "message": string }
404The requested location id does not exist for the current business.{ "message": "Location not found" }
422The query string failed validation.Laravel validation JSON.

Cash flow (report)

Returns cash-flow rows built from account transactions, transaction payments, contacts, and running balance calculations.

Endpoint summary

PropertyValue
MethodGET
Path/api/v1/integration/accounts/reports/cash-flow
Permissionaccount.access.
OrderingRows are sorted ascending by operation_date and then by ledger-line id.
Date filterThe date range is only applied when both start_date and end_date are supplied. Sending only one date passes validation but leaves the result unfiltered.
Location ruleWhen location_id is provided, it must exist for the business and be within the token user's permitted locations.
CSV behaviorformat=csv downloads all matching rows and ignores pagination.

Query parameters

ParameterTypeRequiredDescription
per_page, pageintegerNoPagination controls. per_page accepts 1 to 100 and defaults to 20.
start_date, end_datestringNoDate strings resolved through TransactionUtil::uf_date(). The filter only applies when both are supplied.
typestringNocredit or debit.
location_id, account_idintegerNoOptional location and account filters.
only_payment_recoveredbooleanNoApplies the same special recovered-payment filter used by the web Cash Flow screen.
qstringNoMatches account name, payment ref, transaction number, contact fields, created-by name, linked transaction invoice/ref, or numeric account-transaction and account ids. Requires at least 2 characters when sent.
formatstringNojson (default) or csv.

CashFlowReportRow object

FieldTypeDescription
id, account_id, account_namemixedLedger-line and account identity fields.
type, sub_typestring | nullCredit/debit identity and transaction subtype.
amount, debit, creditnumber | nullRaw amount plus debit/credit convenience columns.
operation_datestring | nullISO-8601 operation timestamp.
method, method_label, payment_ref_no, transaction_nostring | nullResolved payment-method metadata.
is_return, is_advanceintegerReturn and advance-payment flags.
payment_for_contact, payment_for_type, payment_for_business_name, added_bystring | nullContact and creator display fields.
total_recovered, child_invoice_numbersnumber | string | nullRecovered total and comma-separated child invoice numbers.
account_balance_after, combined_balance_afternumberRunning balances after the current line.

Top-level JSON response

FieldTypeDescription
dataarray<CashFlowReportRow>The current result page of cash-flow rows.
meta.current_page, meta.last_page, meta.per_page, meta.total, meta.qmixedPagination metadata plus the resolved text filter.

Status codes

StatusWhen it happensResponse shape
200The cash-flow report was returned successfully.{ "data": [...], "meta": { ... } } or CSV download.
403The token user lacks account.access or is forbidden from the requested location.{ "message": string }
404The requested location id does not exist for the current business.{ "message": "Location not found" }
422The query string failed validation or q was shorter than 2 characters.Laravel validation JSON or { "message": string }.

Payment account report

Returns payment lines linked to transactions, aligned with the web Payment Account Report grid.

Endpoint summary

PropertyValue
MethodGET
Path/api/v1/integration/accounts/reports/payment-account-report
Permissionaccount.access.
Row scopeOnly parent payment rows are included. Advance payments are excluded. Users with restricted locations only see payments from transactions in permitted locations.
Account filteraccount_id accepts a numeric account id or the literal string none to filter unlinked payments.
CSV behaviorformat=csv downloads all matching rows and ignores pagination.

Query parameters

ParameterTypeRequiredDescription
per_page, pageintegerNoPagination controls. per_page accepts 1 to 100 and defaults to 20.
start_date, end_datestringConditionalDate strings resolved through TransactionUtil::uf_date(). Both must be sent together.
account_idinteger | stringNoNumeric account id or none for payments with no linked account.
q, searchstringNoMatches account name/number, invoice, transaction ref, payment ref, contact fields, or numeric payment/transaction ids. Requires at least 2 characters when sent.
formatstringNojson (default) or csv.

PaymentAccountReportRow object

FieldTypeDescription
id, paid_on, amount, payment_ref_nomixedPayment identity and timing fields.
method, method_labelstring | nullPayment method key and resolved label.
is_advance, is_returnintegerAdvance-payment and return flags.
transactionobjectLinked transaction summary with id, type, ref_no, invoice_no, and location_id.
accountobject | nullLinked account summary with id, name, and account_number.
contactobject | nullOptional contact summary with name and type.

Top-level JSON response

FieldTypeDescription
dataarray<PaymentAccountReportRow>The current result page.
meta.current_page, meta.last_page, meta.per_page, meta.total, meta.qmixedPagination metadata plus the resolved text filter.

Status codes

StatusWhen it happensResponse shape
200The payment-account report was returned successfully.{ "data": [...], "meta": { ... } } or CSV download.
403The token user lacks account.access.{ "message": "Unauthorized" }
422The date pair is incomplete, account_id is invalid, the query string failed validation, or q was shorter than 2 characters.Laravel validation JSON or { "message": string }.

Deposit to account (POST)

Records a deposit into one payment account and can optionally create the paired debit from another account in the same transaction.

Endpoint summary

PropertyValue
MethodPOST
Path/api/v1/integration/accounts/deposit
Permissionaccount.access.
Write guardReturns 403 in demo environments.
Account ruleaccount_id must point to a visible, open account. If from_account_id is sent, it must also be visible, open, and different from account_id.
Amount ruleamount is parsed through the business currency configuration and must be greater than zero.
Success response201 with the created credit line and the optional paired debit line.

Request body

FieldTypeRequiredDescription
account_idintegerYesThe account that will receive the credit deposit line.
amountnumberYesDeposit amount. Must be greater than zero after currency parsing.
operation_datestringYesParseable date or datetime string used for the account-transaction timestamp.
from_account_idinteger | nullNoOptional source account for the paired debit line. Must differ from account_id.
notestring | nullNoOptional note up to 1000 characters.

Top-level JSON response

FieldTypeDescription
data.creditAccountTransactionLineThe created credit-side deposit transaction.
data.debitAccountTransactionLine | nullThe optional paired debit transaction when from_account_id was supplied.

Status codes

StatusWhen it happensResponse shape
201The deposit was recorded successfully.{ "data": { "credit": { ... }, "debit": { ... } | null } }
403Demo mode is active or the token user lacks account.access.{ "message": string }
404account_id or from_account_id does not exist or is not visible to the token user.{ "message": "Account not found" }
422The request body failed validation, the source and destination accounts are the same, the amount is invalid, an account is closed, or the business currency is not configured.Laravel validation JSON or { "message": string }.
500The deposit transaction could not be recorded.{ "message": "Could not record deposit" }

Fund transfer (POST)

Transfers funds between two visible, open payment accounts by creating one debit and one credit account-transaction row.

Endpoint summary

PropertyValue
MethodPOST
Path/api/v1/integration/accounts/fund-transfer
Permissionaccount.access.
Write guardReturns 403 in demo environments.
Account rulefrom_account_id and to_account_id must point to visible, open accounts and must differ from each other.
Amount ruleamount is parsed through the business currency configuration and must be greater than zero.
Success response201 with the created debit and credit transfer lines.

Request body

FieldTypeRequiredDescription
from_account_idintegerYesThe account that will receive the debit transfer line.
to_account_idintegerYesThe account that will receive the credit transfer line.
amountnumberYesTransfer amount. Must be greater than zero after currency parsing.
operation_datestringYesParseable date or datetime string used for the account-transaction timestamp.
notestring | nullNoOptional note up to 1000 characters.

Top-level JSON response

FieldTypeDescription
data.debitAccountTransactionLineThe created debit-side transfer transaction.
data.creditAccountTransactionLineThe created credit-side transfer transaction.

Status codes

StatusWhen it happensResponse shape
201The fund transfer was recorded successfully.{ "data": { "debit": { ... }, "credit": { ... } } }
403Demo mode is active or the token user lacks account.access.{ "message": string }
404from_account_id or to_account_id does not exist or is not visible to the token user.{ "message": "Account not found" }
422The request body failed validation, the source and destination accounts are the same, the amount is invalid, an account is closed, or the business currency is not configured.Laravel validation JSON or { "message": string }.
500The fund transfer could not be recorded.{ "message": "Could not record transfer" }