Batch Message

Batch messages are used to group a set of requests into a single call. The only allowed command type is Batch. Unless explicitly requested, all requests in a batch are wrapped in a transaction.

Business Rules

  • All messages in the batch must be valid.
  • Batch commands cannot be nested.
  • A Create request cannot be in a batch.
  • Report requests are only allowed in a batch if the allowReports configuration is set true.
  • The number of requests in a batch may be limited by the configuration.

Revision code processing

If a message in the batch performs a modifying operation on an object that is not fetched by a previous operation in the batch, then the revision code for that object must be provided for all operations in the batch.

If an object is fetched by an operation inside the batch, then subsequent modifying operations in the batch can omit a revision code. Ledger will use the revision code at the time the object is retrieved.

Batch Message Properties

Property Type Description
list array A list of API calls as defined in the table below.
transaction bool Process the batch as a single transaction. Optional. Defaults to true.

The properties of each list element are:

Property Type Description
method string An API entry point and method, eg. "journal/add".
payload object The message data corresponding to the requested method.