RESTful API

Akaunting provides a RESTful API to create, read, update and delete (CRUD) all entities of Akaunting.

The API of Akaunting is built on top of the Dingo API package for Laravel. It provides amazing tools such as Content Negotiation, API Versioning, Rate Limiting, Response Transformers, Internal Requests, and a lot more.

Authentication

The HTTP Basic authentication is used by the Akaunting API. Any user that has read-api permission may access the API using their email and password. By default, Akaunting gives read-api permission to admin role.

Permissions for CRUD actions are based on default ACL.

Routes

The API endpoints/routes of Akaunting are located in the following file:

routes/api.php

You may also add API endpoints to your module:

<?php

 use Illuminate\Support\Facades\Route;

 /**
 * 'api' middleware and 'api/my-blog' prefix applied to all routes (including names)
 *
 * @see \App\Providers\Route::register
 */

 Route::api('my-blog', function ($api) {
     $api->get('posts/{post}/enable', '[email protected]')->name('.posts.enable');
     $api->get('posts/{post}/disable', '[email protected]')->name('.posts.disable');
     $api->resource('posts', 'Posts');
     $api->resource('comments', 'Comments');
 });

Check out the My Blog module as an example and the documentation of Dingo API for further details on API endpoints.

Transformers

Transformers allow you to easily and consistently transform objects into an array. You can find the transformers of Akaunting in the following directory:

app/Transformers
Scroll to top