Front Accounting Simple API API Reference

This is a simple REST API as a Front Accounting module https://github.com/andresamayadiaz/FrontAccountingSimpleAPI.

API Endpoint
http://demo.saygoweb.com/frontaccounting/modules/api
Version: 2.4-1.7

bankaccounts

List Bank Accounts

GET /bankaccounts
200 OK

successful operation

Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "id": "1",
    "account_code": "1060",
    "account_type": "0",
    "bank_name": "Some Bank",
    "bank_address": "string",
    "bank_account_name": "Anne X Ample",
    "bank_account_number": "12-3456-789123-00",
    "bank_curr_code": "USD",
    "dflt_curr_act": "0",
    "bank_charge_act": "5690",
    "last_reconciled_date": "2017-12-01",
    "ending_reconcile_balance": "12.34",
    "inactive": "0"
  }
]

Add Bank Account

POST /bankaccounts

Bank Account to be added

Request Example
{
  "id": "1",
  "account_code": "1060",
  "account_type": "0",
  "bank_name": "Some Bank",
  "bank_address": "string",
  "bank_account_name": "Anne X Ample",
  "bank_account_number": "12-3456-789123-00",
  "bank_curr_code": "USD",
  "dflt_curr_act": "0",
  "bank_charge_act": "5690",
  "last_reconciled_date": "2017-12-01",
  "ending_reconcile_balance": "12.34",
  "inactive": "0"
}
201 Created

successful operation

type
object
Response Content-Types: application/json
Response Example (201 Created)
{
  "account_code": "string"
}

Get Bank Account by id

GET /bankaccounts/{id}
bankAccountId
in path
string

ID of Bank Account to return

200 OK

successful operation

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1",
  "account_code": "1060",
  "account_type": "0",
  "bank_name": "Some Bank",
  "bank_address": "string",
  "bank_account_name": "Anne X Ample",
  "bank_account_number": "12-3456-789123-00",
  "bank_curr_code": "USD",
  "dflt_curr_act": "0",
  "bank_charge_act": "5690",
  "last_reconciled_date": "2017-12-01",
  "ending_reconcile_balance": "12.34",
  "inactive": "0"
}

Update Bank Account

PUT /bankaccounts/{id}

Bank Account to be updated

bankAccountId
in path
string

ID of Bank Account to update

Request Example
{
  "id": "1",
  "account_code": "1060",
  "account_type": "0",
  "bank_name": "Some Bank",
  "bank_address": "string",
  "bank_account_name": "Anne X Ample",
  "bank_account_number": "12-3456-789123-00",
  "bank_curr_code": "USD",
  "dflt_curr_act": "0",
  "bank_charge_act": "5690",
  "last_reconciled_date": "2017-12-01",
  "ending_reconcile_balance": "12.34",
  "inactive": "0"
}
200 OK

successful operation

type
object
Response Content-Types: application/json
Response Example (200 OK)
{
  "account_code": "string"
}

Delete Bank Account

DELETE /bankaccounts/{id}
bankAccountId
in path
string

ID of Bank Account to delete

200 OK

successful operation

Response Content-Types: application/json

dimensions

List all Dimensions

GET /dimensions
200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "id": "1",
    "reference": "PROJECT1",
    "name": "Project 1: Building buildings",
    "memo": "Some memo"
  }
]

Add Dimension

POST /dimensions

Dimension to be added

Request Example
{
  "id": "1",
  "reference": "PROJECT1",
  "name": "Project 1: Building buildings",
  "memo": "Some memo"
}
201 Created

successful operation

type
object
Response Content-Types: application/json
Response Example (201 Created)
{
  "id": "string"
}

Get Dimension by id

GET /dimensions/{id}
dimensionId
in path
integer (int64)

ID of Dimension to return

200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1",
  "reference": "PROJECT1",
  "name": "Project 1: Building buildings",
  "memo": "Some memo"
}

Update Dimension

PUT /dimensions/{id}

Dimension to be updated

dimensionId
in path
integer (int64)

ID of Dimension to update

Request Example
{
  "id": "1",
  "reference": "PROJECT1",
  "name": "Project 1: Building buildings",
  "memo": "Some memo"
}
200 OK

successful operation

type
object
Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "string"
}

Delete Dimension

DELETE /dimensions/{id}
dimensionId
in path
integer (int64)

ID of Dimension to delete

200 OK

successful operation

Response Content-Types: application/json

exchangerates

List all ExchangeRates for a given currency

GET /exchangerates/{currency}
200 OK

successful operation

412 Precondition Failed

failed precondition

type
Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "id": "1",
    "currency": "USD",
    "rateBuy": "1.12",
    "rateSell": "1.12",
    "date": "2018-06-26"
  }
]
Response Example (412 Precondition Failed)
"object"

Add ExchangeRate

POST /exchangerates/{currency}

ExchangeRate to be added

currency
in path
string

Currency of ExchangeRate to return

Request Example
{
  "id": "1",
  "currency": "USD",
  "rateBuy": "1.12",
  "rateSell": "1.12",
  "date": "2018-06-26"
}
201 Created

successful operation

type
object
Response Content-Types: application/json
Response Example (201 Created)
{
  "id": "string"
}

Get current exchange rate for the given currency

GET /exchangerates/{currency}/current
currency
in path
string

Currency of ExchangeRate to return

200 OK

successful operation

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1",
  "currency": "USD",
  "rateBuy": "1.12",
  "rateSell": "1.12",
  "date": "2018-06-26"
}

Get ExchangeRate by id

GET /exchangerates/{currency}/{id}
currency
in path
string

Currency of ExchangeRate to return

exchangeRateId
in path
integer (int64)

ID of ExchangeRate to return

200 OK

successful operation

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1",
  "currency": "USD",
  "rateBuy": "1.12",
  "rateSell": "1.12",
  "date": "2018-06-26"
}

Update ExchangeRate

PUT /exchangerates/{currency}/{id}

ExchangeRate to be updated

currency
in path
string

Currency of ExchangeRate to return

exchangeRateId
in path
integer (int64)

ID of ExchangeRate to update

Request Example
{
  "id": "1",
  "currency": "USD",
  "rateBuy": "1.12",
  "rateSell": "1.12",
  "date": "2018-06-26"
}
200 OK

successful operation

type
object
Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "string"
}

Delete ExchangeRate

DELETE /exchangerates/{currency}/{id}
currency
in path
string

Currency of ExchangeRate to delete

exchangeRateId
in path
integer (int64)

ID of ExchangeRate to delete

200 OK

successful operation

Response Content-Types: application/json

glaccounts

List all GL Accounts

GET /glaccounts
200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "account_code": "1060",
    "account_code2": "",
    "account_name": "My Bank Savings Account",
    "account_type": "",
    "inactive": "0"
  }
]

Add GL Account

POST /glaccounts

GL Account to be added

Request Example
{
  "account_code": "1060",
  "account_code2": "",
  "account_name": "My Bank Savings Account",
  "account_type": "",
  "inactive": "0"
}
201 Created

successful operation

type
object
Response Content-Types: application/json
Response Example (201 Created)
{
  "account_code": "string"
}

Get GL Account by id

GET /glaccounts/{id}
glAccountId
in path
string

ID of GL Account to return

200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
{
  "account_code": "1060",
  "account_code2": "",
  "account_name": "My Bank Savings Account",
  "account_type": "",
  "inactive": "0"
}

Update GL Account

PUT /glaccounts/{id}

GL Account to be updated

glAccountId
in path
string

ID of GL Account to update

Request Example
{
  "account_code": "1060",
  "account_code2": "",
  "account_name": "My Bank Savings Account",
  "account_type": "",
  "inactive": "0"
}
200 OK

successful operation

type
object
Response Content-Types: application/json
Response Example (200 OK)
{
  "account_code": "string"
}

Delete GL Account

DELETE /glaccounts/{id}
glAccountId
in path
string

ID of GL Account to delete

200 OK

successful operation

Response Content-Types: application/json

journal

List Journal Entries

GET /journal
from
in path
string

filter start date

to
in path
string

filter end date

ref
in path
string

reference to filter by

200 OK

successful operation

Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "id": "1",
    "type": "10",
    "journal_date": "2018-06-21",
    "document_date": "2018-06-21",
    "event_date": "2018-06-21",
    "currency": "USD",
    "document_ref": "INV123456",
    "reference": "18 001"
  }
]

Add Journal Entry

POST /journal

Journal Entry to be added

Request Example
{
  "id": "1",
  "type": "10",
  "journal_date": "2018-06-21",
  "document_date": "2018-06-21",
  "event_date": "2018-06-21",
  "currency": "USD",
  "document_ref": "INV123456",
  "reference": "18 001"
}
201 Created

successful operation

type
object
Response Content-Types: application/json
Response Example (201 Created)
{
  "account_code": "string"
}

Get Journal Entry by type and id

GET /journal/{type}/{id}
journalType
in path
string

Type of Journal Entry to return

journalId
in path
string

ID of Journal Entry to return

200 OK

successful operation

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1",
  "type": "10",
  "journal_date": "2018-06-21",
  "document_date": "2018-06-21",
  "event_date": "2018-06-21",
  "currency": "USD",
  "document_ref": "INV123456",
  "reference": "18 001"
}

Void Journal Entry

DELETE /journal/{type}/{id}
journalType
in path
string

Type of Journal Entry to void

journalId
in path
string

ID of Journal Entry to void

200 OK

successful operation

Response Content-Types: application/json

Update Journal Entry

PUT /journal/{id}

Journal Entry to be updated

journalId
in path
string

ID of Journal Entry to update

Request Example
{
  "id": "1",
  "type": "10",
  "journal_date": "2018-06-21",
  "document_date": "2018-06-21",
  "event_date": "2018-06-21",
  "currency": "USD",
  "document_ref": "INV123456",
  "reference": "18 001"
}
200 OK

successful operation

type
object
Response Content-Types: application/json
Response Example (200 OK)
{
  "account_code": "string"
}

sales

List Sales

GET /sales
200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1"
}

Update Sale

PUT /sales
200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1"
}

Add Sale

POST /sales
200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1"
}

Fetch Sale by id

GET /sales/id
200 OK

successful operation

type
Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "1"
}

Schema Definitions

BankAccount: object

A Bank Account

id: integer

Unique id used to reference a Bank Account

account_code: string

Account GL code

account_type: integer

Type of the account

bank_name: string

Name of the bank at which this account is held

bank_address: string

Address of the Bank

bank_account_name: string

Name of the account

bank_account_number: string

Account number used by the Bank

bank_curr_code: string

Currency of the account

dflt_curr_act: boolean

True (1) if this account is the default account

bank_charge_act: string

GL account to which bank charges are assigned

last_reconciled_date: date

Date up to which this account was reconciled

ending_reconcile_balance: number

Account balance at last reconcile

inactive: boolean

True if this account is not active

Example
{
  "id": "1",
  "account_code": "1060",
  "account_type": "0",
  "bank_name": "Some Bank",
  "bank_address": "string",
  "bank_account_name": "Anne X Ample",
  "bank_account_number": "12-3456-789123-00",
  "bank_curr_code": "USD",
  "dflt_curr_act": "0",
  "bank_charge_act": "5690",
  "last_reconciled_date": "2017-12-01",
  "ending_reconcile_balance": "12.34",
  "inactive": "0"
}

Dimension: object

A Dimension

id: integer

Unique id used to reference a Dimension

reference: string

Unique short human readable reference

name: string

A longer human readable name

memo: string

A longer memo

Example
{
  "id": "1",
  "reference": "PROJECT1",
  "name": "Project 1: Building buildings",
  "memo": "Some memo"
}

ExchangeRate: object

An ExchangeRate

id: integer

Unique id used to reference an ExchangeRate

currency: string

Standard currency code

rateBuy: float

The 'buy' exchange rate

rateSell: float

The 'sell' exchange rate, if not set the 'rateBuy' is used

date: date

The effective date from which to use this exchange rate

Example
{
  "id": "1",
  "currency": "USD",
  "rateBuy": "1.12",
  "rateSell": "1.12",
  "date": "2018-06-26"
}

GLAccount: object

A GLAccount

account_code: string

Unique short human readable id used to reference a GLAccount

account_code2: string

Secondary account code, may be blank

account_name: string

A longer name for the account

account_type: string

Type of the account

inactive: int

Zero if account is active

Example
{
  "account_code": "1060",
  "account_code2": "",
  "account_name": "My Bank Savings Account",
  "account_type": "",
  "inactive": "0"
}

JournalEntry: object

A single Journal Entry

id: integer

Unique id used to reference a Journal Entry

type: integer

Transaction type is the type of document this Journal Entry represents, e.g. Invoice, Delivery, GRN etc.

journal_date: date

Date of Journal Entry

document_date: date

Date of related document

event_date: date

Date of related event

currency: string

Currency

document_ref: string

Reference of the related document

reference: string

Reference for this Journal Entry

Example
{
  "id": "1",
  "type": "10",
  "journal_date": "2018-06-21",
  "document_date": "2018-06-21",
  "event_date": "2018-06-21",
  "currency": "USD",
  "document_ref": "INV123456",
  "reference": "18 001"
}

Sale: object

A Sale

id: integer

Unique id used to reference a Sale

Example
{
  "id": "1"
}