RESTful API

Estimated reading: 2 minutes

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

Authentication

The Akaunting API uses the HTTP Basic authentication. Any user with 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.

Postman Collections

https://postman.com/akaunting/workspace/akaunting

Routes

The full list of API endpoints/routes is 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 () {
     Route::get('posts/{post}/enable', 'Posts@enable')->name('.posts.enable');
     Route::get('posts/{post}/disable', 'Posts@disable')->name('.posts.disable');
     Route::resource('posts', 'Posts');
     Route::resource('comments', 'Comments');
 });

Check out the My Blog module as an example.

API Resources

API Resources allow you to easily and consistently transform models into an array. You can find the API Resources of Akaunting in the following directory:

app/Http/Resources

Feel free to read the documentation of Laravel for further details on API Resources.

Share this Doc

RESTful API

Or copy link

CONTENTS