JSON API

This section is being revised and not all routes are complete.

The JSON API provides a stateless HTTP interface to the general ledger. JSON requests are validated at the API level and transformed into messages which ar then passed to the relevant controller. Results are converted to JSON and returned to the client.

Concurrent Transaction Locking

Most add, get, and update requests return a response that contains a revision hash code. The application must provide this code when performing an update operation. If a change has been made by another process between the get and the update, the revision code will not be valid and the update will be rejected. This ensures that the application is always updating the current record.

Security

Access to the API is controlled by settings in config/ledger.php.

Setting Type Description
api bool Enables or disables the API entirely.
middleware array A list of middleware to apply.
prefix string Change the pat to the API (default is 'api/ledger')