Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The aggregation is done on a selected set of IDs provided, and grouped by Currency and VAT

URL

Code Block
(POST) /api/invoices/aggregationitems/new/aggregation

PARAMETERS

The URL takes no parameters

...

ids

An array of integer ids, each belonging to an Invoice

For example:

Code Block
languagejson
[1, 23, 456]

See detailed description further downYou can include up to 20,000 elements.

object[], Mandatory

periodFrom

Start date of the financial period for invoice aggregation.

Only invoices with an EffectiveDate on or after this date will be included.

Example (ISO date strings):

Code Block
"2024-07-14"
"2024-07-14T15:30:00"
"2024-07-14T15:30:00Z"

DateTime, Mandatory

periodTo

End date of the financial period for invoice aggregation.

Only invoices with an EffectiveDate on or before this date will be included.

Example (ISO date strings):

Code Block
"2024-11-14"
"2024-11-14T15:30:00"
"2024-11-14T15:30:00Z"

DateTime, Mandatory

isClientInvoices

Determines whether to aggregate client invoices or supplier invoices.

  • true: Aggregates client invoices only, and ignores supplier invoices

  • false: Aggregates supplier invoices only, and ignores client invoices

bool, Optional

doNotAggregateSingle

Controls whether to skip aggregation of single invoices. Defaults to true

Single invoices can result from sending a single invoice id, or from a group of company+currency+vat

bool, Optional

...

  • have a status of InvoiceDraft, invoices with other statuses will be ignored

  • have an Effective Date between the periodFrom and periodTo mandatory properties

  • be either Client or Supplier invoices (matching isClientInvoices property)

RESULTS

This method is an asynchronous operation: Your request is queued and will execute as soon as possible.

...

The node custom/ids returns the list of IDs of the newly created invoices resulting from the aggregation of the given invoice IDs. If no invoices were aggregated, the list will be empty

ERROR HANDLING

Effective error handling involves careful consideration and effort. Let’s break it down into three levels of errors:

...