Ledgers

Create A Ledger

curl-request
$ curl 'http://localhost:8080/ledgers' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "type" : "ASSET",
  "identifier" : "1000",
  "name" : "Cash",
  "description" : "Cash Ledger",
  "showAccountsInChart" : true
}'
http-request
POST /ledgers HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 131

{
  "type" : "ASSET",
  "identifier" : "1000",
  "name" : "Cash",
  "description" : "Cash Ledger",
  "showAccountsInChart" : true
}
httpie-request
$ echo '{
  "type" : "ASSET",
  "identifier" : "1000",
  "name" : "Cash",
  "description" : "Cash Ledger",
  "showAccountsInChart" : true
}' | http POST 'http://localhost:8080/ledgers' 'Content-Type:application/json' 'Accept:application/json'
Table 1. request-fields
Path Type Description

type

String

Type of Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

Account identifier

name

String

Name of account

description

String

Description of account

showAccountsInChart

Boolean

Should account be shown in charts ?

http-response
HTTP/1.1 202 Accepted

Fetch Ledgers

curl-request
$ curl 'http://localhost:8080/ledgers' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /ledgers HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/ledgers' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1188

{
  "ledgers" : [ {
    "type" : "ASSET",
    "identifier" : "1021",
    "name" : "Name of 1021",
    "description" : "Description of 1021",
    "parentLedgerIdentifier" : null,
    "subLedgers" : [ ],
    "totalValue" : 0,
    "createdOn" : "2018-06-13T13:04:58.887Z",
    "createdBy" : "setna",
    "lastModifiedOn" : null,
    "lastModifiedBy" : null,
    "showAccountsInChart" : true
  }, {
    "type" : "ASSET",
    "identifier" : "1022",
    "name" : "Name of 1022",
    "description" : "Description of 1022",
    "parentLedgerIdentifier" : null,
    "subLedgers" : [ ],
    "totalValue" : 0,
    "createdOn" : "2018-06-13T13:04:59.02Z",
    "createdBy" : "setna",
    "lastModifiedOn" : null,
    "lastModifiedBy" : null,
    "showAccountsInChart" : false
  }, {
    "type" : "ASSET",
    "identifier" : "1023",
    "name" : "Name of 1023",
    "description" : "Description of 1023",
    "parentLedgerIdentifier" : null,
    "subLedgers" : [ ],
    "totalValue" : 0,
    "createdOn" : "2018-06-13T13:04:59.076Z",
    "createdBy" : "setna",
    "lastModifiedOn" : null,
    "lastModifiedBy" : null,
    "showAccountsInChart" : true
  } ],
  "totalPages" : 1,
  "totalElements" : 3
}
Table 2. fetch-ledgers-response-fields
Path Type Description

ledgers

List<Ledger>

List of Ledgers

ledgers[].type

String

Type of first ledger

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

ledgers[].identifier

String

first ledger identifier

ledgers[].name

String

first ledger name

ledgers[].description

String

description of first ledger

ledgers[].parentLedgerIdentifier

Null

first ledger’s parent

ledgers[].totalValue

String

Total Value of first ledger

ledgers[].createdOn

String

date first ledger was created

ledgers[].createdBy

String

employee who created first ledger

ledgers[].lastModifiedOn

String

date first ledger was modified

ledgers[].lastModifiedBy

String

employee who last modified first ledger

ledgers[].showAccountsInChart

Boolean

Should ledger be shown in charts ?

ledgers[1].type

String

Type of second ledger

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

ledgers[1].identifier

String

second ledger identifier

ledgers[1].name

String

second ledger name

ledgers[1].description

String

description of second ledger

ledgers[1].parentLedgerIdentifier

Null

second ledger’s parent

ledgers[1].totalValue

String

Total Value of second ledger

ledgers[1].createdOn

String

date second ledger was created

ledgers[1].createdBy

String

employee who created second ledger

ledgers[1].lastModifiedOn

String

date second ledger was modified

ledgers[1].lastModifiedBy

String

employee who last modified second ledger

ledgers[1].showAccountsInChart

Boolean

Should ledger be shown in charts ?

ledgers[2].type

String

Type of third ledger

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

ledgers[2].identifier

String

third ledger identifier

ledgers[2].name

String

third ledger name

ledgers[2].description

String

description of third ledger

ledgers[2].parentLedgerIdentifier

Null

third ledger’s parent

ledgers[2].totalValue

String

Total Value of third ledger

ledgers[2].createdOn

String

date third ledger was created

ledgers[2].createdBy

String

employee who created third ledger

ledgers[2].lastModifiedOn

String

date second ledger was modified

ledgers[2].lastModifiedBy

String

employee who last modified third ledger

ledgers[2].showAccountsInChart

Boolean

Should ledger be shown in charts ?

totalPages

Integer

Total number of pages

totalElements

String

Total number of elements

Fetch Accounts For Ledger

curl-request
$ curl 'http://localhost:8080/ledgers/6100/accounts' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d '{
  "accounts" : [ {
    "type" : "LIABILITY",
    "identifier" : "6100.10",
    "name" : "First Account Of 6100",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 1234.0,
    "ledger" : "6100"
  } ],
  "totalPages" : 1,
  "totalElements" : 1
}'
http-request
GET /ledgers/6100/accounts HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 295

{
  "accounts" : [ {
    "type" : "LIABILITY",
    "identifier" : "6100.10",
    "name" : "First Account Of 6100",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 1234.0,
    "ledger" : "6100"
  } ],
  "totalPages" : 1,
  "totalElements" : 1
}
httpie-request
$ echo '{
  "accounts" : [ {
    "type" : "LIABILITY",
    "identifier" : "6100.10",
    "name" : "First Account Of 6100",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 1234.0,
    "ledger" : "6100"
  } ],
  "totalPages" : 1,
  "totalElements" : 1
}' | http GET 'http://localhost:8080/ledgers/6100/accounts' 'Content-Type:application/json' 'Accept:*/*'
Table 3. fetch-accounts-for-ledgers-response-fields
Path Type Description

accounts

List<Account>

List of Accounts

accounts[].type

String

Type of first Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

accounts[].identifier

String

first account identifier

accounts[].name

String

first account name

accounts[].holders

Set<String>

Set of account holders

accounts[].signatureAuthorities

Set<String>

Set of signatories to account

accounts[].balance

Double

first account’s balance

accounts[].ledger

String

Associated ledger

totalPages

Integer

Total pages

totalElements

Integer

Total accounts in page

http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 518

{
  "accounts" : [ {
    "type" : "LIABILITY",
    "identifier" : "6100.10",
    "name" : "First Account Of 6100",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 1234.0,
    "referenceAccount" : null,
    "ledger" : "6100",
    "state" : "OPEN",
    "alternativeAccountNumber" : null,
    "createdOn" : "2018-06-13T16:02:25.546Z",
    "createdBy" : "setna",
    "lastModifiedOn" : null,
    "lastModifiedBy" : null
  } ],
  "totalPages" : 1,
  "totalElements" : 1
}
Table 4. fetch-accounts-for-ledger-response-fields
Path Type Description

accounts

List<Account>

List of Accounts

totalPages

Integer

Total number of pages

totalElements

String

Total number of elements

Find A Ledger

curl-request
$ curl 'http://localhost:8080/ledgers/7200' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /ledgers/7200 HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/ledgers/7200' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 346

{
  "type" : "ASSET",
  "identifier" : "7200",
  "name" : "Name of7200",
  "description" : "Description of 7200",
  "parentLedgerIdentifier" : null,
  "subLedgers" : [ ],
  "totalValue" : 0,
  "createdOn" : "2018-06-13T14:29:04.63Z",
  "createdBy" : "setna",
  "lastModifiedOn" : null,
  "lastModifiedBy" : null,
  "showAccountsInChart" : false
}
Table 5. find-ledger-response-fields
Path Type Description

type

String

Type of first ledger

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

first ledger identifier

name

String

first ledger name

description

String

description of first ledger

subLedgers

List<Ledger>

list of sub ledgers

.parentLedgerIdentifier

Null

first ledger’s parent

totalValue

String

Total Value of first ledger

createdOn

String

date first ledger was created

createdBy

String

employee who created first ledger

lastModifiedOn

String

date first ledger was modified

lastModifiedBy

String

employee who last modified first ledger

showAccountsInChart

Boolean

Should ledger be shown in charts ?

Add A Sub Ledger

curl-request
$ curl 'http://localhost:8080/ledgers/6200' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "type" : "ASSET",
  "identifier" : "6201",
  "name" : "SubLedger One of 6200",
  "description" : "First Sub Ledger of 6200",
  "showAccountsInChart" : false
}'
http-request
POST /ledgers/6200 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 162

{
  "type" : "ASSET",
  "identifier" : "6201",
  "name" : "SubLedger One of 6200",
  "description" : "First Sub Ledger of 6200",
  "showAccountsInChart" : false
}
httpie-request
$ echo '{
  "type" : "ASSET",
  "identifier" : "6201",
  "name" : "SubLedger One of 6200",
  "description" : "First Sub Ledger of 6200",
  "showAccountsInChart" : false
}' | http POST 'http://localhost:8080/ledgers/6200' 'Content-Type:application/json' 'Accept:application/json'
http-response
HTTP/1.1 202 Accepted
Table 6. add-a-sub-ledger-request-fields
Path Type Description

type

String

Type of Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

Sub Ledger identifier

name

String

Name of sub ledger

description

String

Description of sub ledger

showAccountsInChart

Boolean

Should ledger be shown in charts ?

Update A Ledger

curl-request
$ curl 'http://localhost:8080/ledgers/6200' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "type" : "ASSET",
  "identifier" : "6200",
  "name" : "New Name Of 6200",
  "description" : "New Description Of 6200",
  "showAccountsInChart" : true
}'
http-request
PUT /ledgers/6200 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 155

{
  "type" : "ASSET",
  "identifier" : "6200",
  "name" : "New Name Of 6200",
  "description" : "New Description Of 6200",
  "showAccountsInChart" : true
}
httpie-request
$ echo '{
  "type" : "ASSET",
  "identifier" : "6200",
  "name" : "New Name Of 6200",
  "description" : "New Description Of 6200",
  "showAccountsInChart" : true
}' | http PUT 'http://localhost:8080/ledgers/6200' 'Content-Type:application/json' 'Accept:application/json'
Table 7. request-fields
Path Type Description

type

String

Type of Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

Sub Ledger identifier

name

String

Name of sub ledger

description

String

Description of sub ledger

showAccountsInChart

Boolean

Should ledger be shown in charts ?

http-response
HTTP/1.1 202 Accepted

Delete A Ledger

curl-request
$ curl 'http://localhost:8080/ledgers/6200' -i -X DELETE -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
DELETE /ledgers/6200 HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http DELETE 'http://localhost:8080/ledgers/6200' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 202 Accepted

Accounts

Create An Account

curl-request
$ curl 'http://localhost:8080/accounts' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "type" : "ASSET",
  "identifier" : "10013",
  "name" : "Interest Receivables",
  "holders" : [ "First Holder", "Second Holder" ],
  "signatureAuthorities" : [ "Second To Sign", "First To Sign" ],
  "balance" : 105.0,
  "ledger" : "1001"
}'
http-request
POST /accounts HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 242

{
  "type" : "ASSET",
  "identifier" : "10013",
  "name" : "Interest Receivables",
  "holders" : [ "First Holder", "Second Holder" ],
  "signatureAuthorities" : [ "Second To Sign", "First To Sign" ],
  "balance" : 105.0,
  "ledger" : "1001"
}
httpie-request
$ echo '{
  "type" : "ASSET",
  "identifier" : "10013",
  "name" : "Interest Receivables",
  "holders" : [ "First Holder", "Second Holder" ],
  "signatureAuthorities" : [ "Second To Sign", "First To Sign" ],
  "balance" : 105.0,
  "ledger" : "1001"
}' | http POST 'http://localhost:8080/accounts' 'Content-Type:application/json' 'Accept:application/json'
Table 8. request-fields
Path Type Description

type

String

Type of Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

Account identifier

name

String

Name of account

holders

Set<String>

Account Holders

signatureAuthorities

Set<String>

Account signatories

balance

Double

Account balance

ledger

String

Associated ledger

http-response
HTTP/1.1 202 Accepted

Find An Account

curl-request
$ curl 'http://localhost:8080/accounts/1001' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d '{
  "type" : "ASSET",
  "identifier" : "1001",
  "name" : "Receivables",
  "holders" : [ "Holder One", "Holder Two" ],
  "signatureAuthorities" : [ "Signatory Two", "Signatory One" ],
  "balance" : 906.4,
  "referenceAccount" : "1000",
  "ledger" : "1001"
}'
http-request
GET /accounts/1001 HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 257

{
  "type" : "ASSET",
  "identifier" : "1001",
  "name" : "Receivables",
  "holders" : [ "Holder One", "Holder Two" ],
  "signatureAuthorities" : [ "Signatory Two", "Signatory One" ],
  "balance" : 906.4,
  "referenceAccount" : "1000",
  "ledger" : "1001"
}
httpie-request
$ echo '{
  "type" : "ASSET",
  "identifier" : "1001",
  "name" : "Receivables",
  "holders" : [ "Holder One", "Holder Two" ],
  "signatureAuthorities" : [ "Signatory Two", "Signatory One" ],
  "balance" : 906.4,
  "referenceAccount" : "1000",
  "ledger" : "1001"
}' | http GET 'http://localhost:8080/accounts/1001' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 437

{
  "type" : "ASSET",
  "identifier" : "1001",
  "name" : "Receivables",
  "holders" : [ "Holder One", "Holder Two" ],
  "signatureAuthorities" : [ "Signatory Two", "Signatory One" ],
  "balance" : 906.4,
  "referenceAccount" : "1000",
  "ledger" : "1001",
  "state" : "OPEN",
  "alternativeAccountNumber" : null,
  "createdOn" : "2018-06-12T14:24:24.696Z",
  "createdBy" : "setna",
  "lastModifiedOn" : null,
  "lastModifiedBy" : null
}
Table 9. response-fields
Path Type Description

type

String

Type of Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

Account identifier

name

String

Name of account

holders

Set<String>

Account Holders

signatureAuthorities

Set<String>

Account signatories

balance

Double

Account balance

ledger

String

Associated ledger

referenceAccount

String

Reference Account

state

String

State of account

enum State { OPEN,
LOCKED,
CLOSED
}

alternativeAccountNumber

String

Alternative account

createdOn

String

Date account was created

createdBy

String

Account creator

lastModifiedOn

String

Date when account was last modified

lastModifiedBy

String

Employee who last modified account

Find Account Using Alternative Account Number

curl-request
$ curl 'http://localhost:8080/accounts/7100.10' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /accounts/7100.10 HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/accounts/7100.10' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Disposition: inline;filename=f.txt
Content-Type: application/json;charset=UTF-8
Content-Length: 425

{
  "type" : "REVENUE",
  "identifier" : "7100.10",
  "name" : "Organic Maize",
  "holders" : [ "Only Holder" ],
  "signatureAuthorities" : [ "Only Signatory" ],
  "balance" : 3435.0,
  "referenceAccount" : null,
  "ledger" : "7100",
  "state" : "OPEN",
  "alternativeAccountNumber" : "7-1-0-0-.-1-0",
  "createdOn" : "2018-06-13T10:32:36.343Z",
  "createdBy" : "setna",
  "lastModifiedOn" : null,
  "lastModifiedBy" : null
}
Table 10. response-fields
Path Type Description

type

String

Type of Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

Account identifier

name

String

Account name

holders

Set<String>

Set of account holders

signatureAuthorities

Set<String>

Set of signatories to account

balance

Double

account’s balance

referenceAccount

String

Reference Account

ledger

String

Associated ledger

state

State

State of Account

enum State {
OPEN,
LOCKED,
CLOSED,
}

alternativeAccountNumber

Integer

Total accounts in page

createdOn

List<Account>

List of Accounts

createdBy

Integer

Total number of pages

lastModifiedOn

String

Total number of elements

lastModifiedBy

String

Total number of elements

Update An Account

curl-request
$ curl 'http://localhost:8080/accounts/2001' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "type" : "ASSET",
  "identifier" : "2001",
  "name" : "Payables",
  "holders" : [ "Holder Second", "Holder First" ],
  "signatureAuthorities" : [ "Second Signatory", "First Signatory" ],
  "balance" : 342.0,
  "ledger" : "2000"
}'
http-request
PUT /accounts/2001 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 233

{
  "type" : "ASSET",
  "identifier" : "2001",
  "name" : "Payables",
  "holders" : [ "Holder Second", "Holder First" ],
  "signatureAuthorities" : [ "Second Signatory", "First Signatory" ],
  "balance" : 342.0,
  "ledger" : "2000"
}
httpie-request
$ echo '{
  "type" : "ASSET",
  "identifier" : "2001",
  "name" : "Payables",
  "holders" : [ "Holder Second", "Holder First" ],
  "signatureAuthorities" : [ "Second Signatory", "First Signatory" ],
  "balance" : 342.0,
  "ledger" : "2000"
}' | http PUT 'http://localhost:8080/accounts/2001' 'Content-Type:application/json' 'Accept:application/json'
Table 11. request-fields
Path Type Description

type

String

Type of Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

identifier

String

Account identifier

name

String

Name of account

holders

Set<String>

Account Holders

signatureAuthorities

Set<String>

Account signatories

balance

Double

Account balance

ledger

String

Associated ledger

http-response
HTTP/1.1 202 Accepted

Fetch Accounts

curl-request
$ curl 'http://localhost:8080/accounts' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d '{
  "accounts" : [ {
    "type" : "EXPENSE",
    "identifier" : "1111",
    "name" : "Organic Maize",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 225.0,
    "ledger" : "Organic Sales"
  }, {
    "type" : "EXPENSE",
    "identifier" : "1112",
    "name" : "Organic Beans",
    "holders" : [ "Holder Two" ],
    "signatureAuthorities" : [ "Signatory Two" ],
    "balance" : 895.0,
    "ledger" : "Inorganic Sales"
  } ],
  "totalPages" : 1,
  "totalElements" : 2
}'
http-request
GET /accounts HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 518

{
  "accounts" : [ {
    "type" : "EXPENSE",
    "identifier" : "1111",
    "name" : "Organic Maize",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 225.0,
    "ledger" : "Organic Sales"
  }, {
    "type" : "EXPENSE",
    "identifier" : "1112",
    "name" : "Organic Beans",
    "holders" : [ "Holder Two" ],
    "signatureAuthorities" : [ "Signatory Two" ],
    "balance" : 895.0,
    "ledger" : "Inorganic Sales"
  } ],
  "totalPages" : 1,
  "totalElements" : 2
}
httpie-request
$ echo '{
  "accounts" : [ {
    "type" : "EXPENSE",
    "identifier" : "1111",
    "name" : "Organic Maize",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 225.0,
    "ledger" : "Organic Sales"
  }, {
    "type" : "EXPENSE",
    "identifier" : "1112",
    "name" : "Organic Beans",
    "holders" : [ "Holder Two" ],
    "signatureAuthorities" : [ "Signatory Two" ],
    "balance" : 895.0,
    "ledger" : "Inorganic Sales"
  } ],
  "totalPages" : 1,
  "totalElements" : 2
}' | http GET 'http://localhost:8080/accounts' 'Content-Type:application/json' 'Accept:*/*'
Table 12. fetch-accounts-request-fields
Path Type Description

accounts

List<Account>

List of Accounts

accounts[].type

String

Type of first Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

accounts[].identifier

String

first account identifier

accounts[].name

String

first account name

accounts[].holders

Set<String>

Set of account holders

accounts[].signatureAuthorities

Set<String>

Set of signatories to account

accounts[].balance

Double

first account’s balance

accounts[].ledger

String

Associated ledger

accounts[1].type

String

Type of second Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

accounts[1].identifier

String

second account identifier

accounts[1].name

String

second account’s name

accounts[1].holders

Set<String>

Set of account holders

accounts[1].signatureAuthorities

Set<String>

Set of signatories to account

accounts[1].balance

Double

second account balance

accounts[1].ledger

String

Associated ledger

totalPages

Integer

Total number of pages

totalElements

String

Total number of elements

http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 65

{
  "accounts" : [ ],
  "totalPages" : 0,
  "totalElements" : 0
}
Table 13. response-fields
Path Type Description

accounts

List<Account>

List of Accounts

totalPages

Integer

Total number of pages

totalElements

String

Total number of elements

Fetch Accounts For Term

curl-request
$ curl 'http://localhost:8080/accounts' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d '{
  "accounts" : [ {
    "type" : "REVENUE",
    "identifier" : "2100.1",
    "name" : "Organic Maize",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 225.0,
    "ledger" : "Organic Sales"
  } ],
  "totalPages" : 1,
  "totalElements" : 1
}'
http-request
GET /accounts HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 292

{
  "accounts" : [ {
    "type" : "REVENUE",
    "identifier" : "2100.1",
    "name" : "Organic Maize",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 225.0,
    "ledger" : "Organic Sales"
  } ],
  "totalPages" : 1,
  "totalElements" : 1
}
httpie-request
$ echo '{
  "accounts" : [ {
    "type" : "REVENUE",
    "identifier" : "2100.1",
    "name" : "Organic Maize",
    "holders" : [ "Holder One" ],
    "signatureAuthorities" : [ "Signatory One" ],
    "balance" : 225.0,
    "ledger" : "Organic Sales"
  } ],
  "totalPages" : 1,
  "totalElements" : 1
}' | http GET 'http://localhost:8080/accounts' 'Content-Type:application/json' 'Accept:*/*'
Table 14. fetch-accounts-for-term-request-fields
Path Type Description

accounts

List<Account>

List of Accounts

accounts[].type

String

Type of first Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

accounts[].identifier

String

first account identifier

accounts[].name

String

first account name

accounts[].holders

Set<String>

Set of account holders

accounts[].signatureAuthorities

Set<String>

Set of signatories to account

accounts[].balance

Double

first account’s balance

accounts[].ledger

String

Associated ledger

totalPages

Integer

Total pages

totalElements

Integer

Total accounts in page

http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 65

{
  "accounts" : [ ],
  "totalPages" : 0,
  "totalElements" : 0
}
Table 15. response-fields
Path Type Description

accounts

List<Account>

List of Accounts

totalPages

Integer

Total number of pages

totalElements

String

Total number of elements

Fetch Active Accounts

curl-request
$ curl 'http://localhost:8080/accounts' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d '{
  "accounts" : [ {
    "type" : "REVENUE",
    "identifier" : "3100.20",
    "name" : "Organic Pens",
    "holders" : [ "Holder Two" ],
    "signatureAuthorities" : [ "Signatory Two" ],
    "balance" : 895.0,
    "ledger" : "Inorganic Sales",
    "state" : "OPEN"
  }, {
    "type" : "REVENUE",
    "identifier" : "3100.30",
    "name" : "Organic Peas",
    "holders" : [ "Holder Three" ],
    "signatureAuthorities" : [ "Signatory Three" ],
    "balance" : 953.0,
    "ledger" : "Organic Sales",
    "state" : "OPEN"
  }, {
    "type" : "REVENUE",
    "identifier" : "3100.40",
    "name" : "Organic Pencils",
    "holders" : [ "Holder Four" ],
    "signatureAuthorities" : [ "Signatory Four" ],
    "balance" : 345.0,
    "ledger" : "Inorganic Sales",
    "state" : "OPEN"
  } ],
  "totalPages" : 1,
  "totalElements" : 3
}'
http-request
GET /accounts HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 827

{
  "accounts" : [ {
    "type" : "REVENUE",
    "identifier" : "3100.20",
    "name" : "Organic Pens",
    "holders" : [ "Holder Two" ],
    "signatureAuthorities" : [ "Signatory Two" ],
    "balance" : 895.0,
    "ledger" : "Inorganic Sales",
    "state" : "OPEN"
  }, {
    "type" : "REVENUE",
    "identifier" : "3100.30",
    "name" : "Organic Peas",
    "holders" : [ "Holder Three" ],
    "signatureAuthorities" : [ "Signatory Three" ],
    "balance" : 953.0,
    "ledger" : "Organic Sales",
    "state" : "OPEN"
  }, {
    "type" : "REVENUE",
    "identifier" : "3100.40",
    "name" : "Organic Pencils",
    "holders" : [ "Holder Four" ],
    "signatureAuthorities" : [ "Signatory Four" ],
    "balance" : 345.0,
    "ledger" : "Inorganic Sales",
    "state" : "OPEN"
  } ],
  "totalPages" : 1,
  "totalElements" : 3
}
httpie-request
$ echo '{
  "accounts" : [ {
    "type" : "REVENUE",
    "identifier" : "3100.20",
    "name" : "Organic Pens",
    "holders" : [ "Holder Two" ],
    "signatureAuthorities" : [ "Signatory Two" ],
    "balance" : 895.0,
    "ledger" : "Inorganic Sales",
    "state" : "OPEN"
  }, {
    "type" : "REVENUE",
    "identifier" : "3100.30",
    "name" : "Organic Peas",
    "holders" : [ "Holder Three" ],
    "signatureAuthorities" : [ "Signatory Three" ],
    "balance" : 953.0,
    "ledger" : "Organic Sales",
    "state" : "OPEN"
  }, {
    "type" : "REVENUE",
    "identifier" : "3100.40",
    "name" : "Organic Pencils",
    "holders" : [ "Holder Four" ],
    "signatureAuthorities" : [ "Signatory Four" ],
    "balance" : 345.0,
    "ledger" : "Inorganic Sales",
    "state" : "OPEN"
  } ],
  "totalPages" : 1,
  "totalElements" : 3
}' | http GET 'http://localhost:8080/accounts' 'Content-Type:application/json' 'Accept:*/*'
Table 16. fetch-active-accounts-request-fields
Path Type Description

accounts

List<Account>

List of Accounts

accounts[].type

String

Type of first Account

enum AccountType {
ASSET,
LIABILITY,
EQUITY,
REVENUE,
EXPENSE
}

accounts[].identifier

String

first account identifier

accounts[].name

String

first account name

accounts[].holders

Set<String>

Set of account holders

accounts[].signatureAuthorities

Set<String>

Set of signatories to account

accounts[].balance

Double

first account’s balance

accounts[].ledger

String

Associated ledger

totalPages

Integer

Total pages

totalElements

Integer

Total accounts in page

http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 65

{
  "accounts" : [ ],
  "totalPages" : 0,
  "totalElements" : 0
}
Table 17. response-fields
Path Type Description

accounts

List<Account>

List of Accounts

totalPages

Integer

Total number of pages

totalElements

String

Total number of elements

Close An Account

curl-request
$ curl 'http://localhost:8080/accounts/3001/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "CLOSE",
  "comment" : "Close Account"
}'
http-request
POST /accounts/3001/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 55

{
  "action" : "CLOSE",
  "comment" : "Close Account"
}
httpie-request
$ echo '{
  "action" : "CLOSE",
  "comment" : "Close Account"
}' | http POST 'http://localhost:8080/accounts/3001/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 18. request-fields
Path Type Description

action

String

Action CLOSE
enum Action {
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Close comment

http-response
HTTP/1.1 202 Accepted

Lock An Account

curl-request
$ curl 'http://localhost:8080/accounts/4001/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "LOCK",
  "comment" : "Lock Account"
}'
http-request
POST /accounts/4001/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 53

{
  "action" : "LOCK",
  "comment" : "Lock Account"
}
httpie-request
$ echo '{
  "action" : "LOCK",
  "comment" : "Lock Account"
}' | http POST 'http://localhost:8080/accounts/4001/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 19. request-fields
Path Type Description

action

String

Action LOCK
enum Action {
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Lock comment

http-response
HTTP/1.1 202 Accepted

Unlock An Account

curl-request
$ curl 'http://localhost:8080/accounts/5001/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "UNLOCK",
  "comment" : "Unlock Account"
}'
http-request
POST /accounts/5001/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 57

{
  "action" : "UNLOCK",
  "comment" : "Unlock Account"
}
httpie-request
$ echo '{
  "action" : "UNLOCK",
  "comment" : "Unlock Account"
}' | http POST 'http://localhost:8080/accounts/5001/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 20. request-fields
Path Type Description

action

String

Action UNLOCK
enum Action {
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Unlock comment

http-response
HTTP/1.1 202 Accepted

Delete An Account

curl-request
$ curl 'http://localhost:8080/accounts/5002' -i -X DELETE -H 'Accept: */*' -H 'Content-Type: application/json'
http-request
DELETE /accounts/5002 HTTP/1.1
Accept: */*
Content-Type: application/json
Host: localhost:8080
httpie-request
$ http DELETE 'http://localhost:8080/accounts/5002' 'Accept:*/*' 'Content-Type:application/json'
http-response
HTTP/1.1 202 Accepted

Fetch Action Commands

curl-request
$ curl 'http://localhost:8080/accounts/5002/actions' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /accounts/5002/actions HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/accounts/5002/actions' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 181

[ {
  "action" : "LOCK",
  "comment" : null,
  "createdOn" : null,
  "createdBy" : null
}, {
  "action" : "CLOSE",
  "comment" : null,
  "createdOn" : null,
  "createdBy" : null
} ]

Fetch Account Entries

curl-request
$ curl 'http://localhost:8080/accounts/1601/entries' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /accounts/1601/entries HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/accounts/1601/entries' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 528

{
  "accountEntries" : [ {
    "type" : "CREDIT",
    "transactionDate" : "2018-06-13T09:37:11.508Z",
    "message" : "Message 0",
    "amount" : 5.0,
    "balance" : -5.0
  }, {
    "type" : "CREDIT",
    "transactionDate" : "2018-06-13T09:37:11.508Z",
    "message" : "Message 1",
    "amount" : 5.0,
    "balance" : -10.0
  }, {
    "type" : "CREDIT",
    "transactionDate" : "2018-06-13T09:37:11.509Z",
    "message" : "Message 2",
    "amount" : 5.0,
    "balance" : -15.0
  } ],
  "totalPages" : 1,
  "totalElements" : 3
}

Journal Entries

Create A Journal Entry

curl-request
$ curl 'http://localhost:8080/journal' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "transactionIdentifier" : "F14062018",
  "transactionDate" : "2018-06-14",
  "transactionType" : "ADBT",
  "clerk" : "Boring Clerk",
  "note" : "Account Db",
  "debtors" : [ {
    "accountNumber" : "7100",
    "amount" : "100.0"
  } ],
  "creditors" : [ {
    "accountNumber" : "Uhiquy7GGFvuMTDxHTfp6oOEuMEBQCFt",
    "amount" : "100.0"
  } ],
  "message" : "Account Has Been Debited"
}'
http-request
POST /journal HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 390

{
  "transactionIdentifier" : "F14062018",
  "transactionDate" : "2018-06-14",
  "transactionType" : "ADBT",
  "clerk" : "Boring Clerk",
  "note" : "Account Db",
  "debtors" : [ {
    "accountNumber" : "7100",
    "amount" : "100.0"
  } ],
  "creditors" : [ {
    "accountNumber" : "Uhiquy7GGFvuMTDxHTfp6oOEuMEBQCFt",
    "amount" : "100.0"
  } ],
  "message" : "Account Has Been Debited"
}
httpie-request
$ echo '{
  "transactionIdentifier" : "F14062018",
  "transactionDate" : "2018-06-14",
  "transactionType" : "ADBT",
  "clerk" : "Boring Clerk",
  "note" : "Account Db",
  "debtors" : [ {
    "accountNumber" : "7100",
    "amount" : "100.0"
  } ],
  "creditors" : [ {
    "accountNumber" : "Uhiquy7GGFvuMTDxHTfp6oOEuMEBQCFt",
    "amount" : "100.0"
  } ],
  "message" : "Account Has Been Debited"
}' | http POST 'http://localhost:8080/journal' 'Content-Type:application/json' 'Accept:application/json'
Table 21. request-fields
Path Type Description

transactionIdentifier

String

Transaction ID

transactionDate

String

Account identifier

transactionType

String

Type of transaction

clerk

String

Clerk who initiated transaction

note

String

Transaction note

debtors

Set<Debtors>

Set of debtors

creditors

Set<Creditors>

Set of creditors

message

String

Associated ledger

http-response
HTTP/1.1 202 Accepted

Find A Journal Entry

curl-request
$ curl 'http://localhost:8080/journal/FE136183' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /journal/FE136183 HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/journal/FE136183' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 375

{
  "transactionIdentifier" : "FE136183",
  "transactionDate" : "2017-06-24T01:00:00Z",
  "transactionType" : "ACCO",
  "clerk" : "Mr. Clark",
  "note" : "Noted",
  "debtors" : [ {
    "accountNumber" : "7110",
    "amount" : "50.0"
  } ],
  "creditors" : [ {
    "accountNumber" : "8110",
    "amount" : "50.0"
  } ],
  "state" : "PROCESSED",
  "message" : "Message Noted"
}
Table 22. find-journal-entry-response-fields
Path Type Description

transactionIdentifier

String

Transaction ID

transactionDate

String

Account identifier

transactionType

String

Type of transaction

clerk

String

Clerk who initiated transaction

note

String

Transaction note

debtors

Set<Debtors>

Set of debtors

creditors

Set<Creditors>

Set of creditors

state

State

State of journal entry
enum State {
PENDING,
PROCESSED
}

message

String

Journal Message

Fetch Journal Entries

curl-request
$ curl 'http://localhost:8080/journal' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /journal HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/journal' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3

[ ]

Transaction Types

Create A Transaction Type

curl-request
$ curl 'http://localhost:8080/transactiontypes' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "code" : "ABCD",
  "name" : "Account Starter",
  "description" : "Account Starter"
}'
http-request
POST /transactiontypes HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 88

{
  "code" : "ABCD",
  "name" : "Account Starter",
  "description" : "Account Starter"
}
httpie-request
$ echo '{
  "code" : "ABCD",
  "name" : "Account Starter",
  "description" : "Account Starter"
}' | http POST 'http://localhost:8080/transactiontypes' 'Content-Type:application/json' 'Accept:application/json'
Table 23. create-tx-type-request-fields
Path Type Description

code

String

Transaction Type’s code

name

String

Name of transaction type

description

String

Description of transaction type

http-response
HTTP/1.1 202 Accepted

Find A Transaction Type

curl-request
$ curl 'http://localhost:8080/transactiontypes/AXYZ' -i -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "code" : "AXYZ",
  "name" : "Account Lock",
  "description" : "Lock Account"
}'
http-request
GET /transactiontypes/AXYZ HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 82

{
  "code" : "AXYZ",
  "name" : "Account Lock",
  "description" : "Lock Account"
}
httpie-request
$ echo '{
  "code" : "AXYZ",
  "name" : "Account Lock",
  "description" : "Lock Account"
}' | http GET 'http://localhost:8080/transactiontypes/AXYZ' 'Content-Type:application/json' 'Accept:application/json'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 82

{
  "code" : "AXYZ",
  "name" : "Account Lock",
  "description" : "Lock Account"
}
Table 24. find-tx-type-response-fields
Path Type Description

code

String

Transaction Type’s code

name

String

Name of transaction type

description

String

Description of transaction type

Fetch Transaction Types

curl-request
$ curl 'http://localhost:8080/transactiontypes' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /transactiontypes HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/transactiontypes' 'Content-Type:application/json' 'Accept:*/*'
http-response-fields
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1769

{
  "transactionTypes" : [ {
    "code" : "ACCC",
    "name" : "Account Closing",
    "description" : null
  }, {
    "code" : "ACCO",
    "name" : "Account Opening",
    "description" : null
  }, {
    "code" : "ACCT",
    "name" : "Account Transfer",
    "description" : null
  }, {
    "code" : "ACDT",
    "name" : "ACH Credit",
    "description" : null
  }, {
    "code" : "ADBT",
    "name" : "ACH Debit",
    "description" : null
  }, {
    "code" : "ADJT",
    "name" : "Adjustments",
    "description" : null
  }, {
    "code" : "APAC",
    "name" : "ACH Pre-Authorised",
    "description" : null
  }, {
    "code" : "ARET",
    "name" : "ACH Return",
    "description" : null
  }, {
    "code" : "AREV",
    "name" : "ACH Reversal",
    "description" : null
  }, {
    "code" : "ARPD",
    "name" : "ARP Debit",
    "description" : null
  }, {
    "code" : "ASET",
    "name" : "ACH Settlement",
    "description" : null
  }, {
    "code" : "ATXN",
    "name" : "ACH Transaction",
    "description" : null
  }, {
    "code" : "BACT",
    "name" : "Branch Account Transfer",
    "description" : null
  }, {
    "code" : "BBDD",
    "name" : "SEPA B2B Direct Debit",
    "description" : null
  }, {
    "code" : "BCDP",
    "name" : "Branch Deposit",
    "description" : null
  }, {
    "code" : "BCHQ",
    "name" : "Branch Cheque",
    "description" : null
  }, {
    "code" : "BCWD",
    "name" : "Branch Withdrawal",
    "description" : null
  }, {
    "code" : "CAJT",
    "name" : "Credit Adjustments",
    "description" : null
  }, {
    "code" : "CASH",
    "name" : "Cash Letter",
    "description" : null
  }, {
    "code" : "CCCH",
    "name" : "Certified Customer Cheque",
    "description" : null
  } ],
  "totalPages" : 3,
  "totalElements" : 57
}

Update A Transaction Type

curl-request
$ curl 'http://localhost:8080/transactiontypes/AXYZ' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "code" : "AXYZ",
  "name" : "Account Unveil",
  "description" : "Unveil Account"
}'
http-request
PUT /transactiontypes/AXYZ HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 86

{
  "code" : "AXYZ",
  "name" : "Account Unveil",
  "description" : "Unveil Account"
}
httpie-request
$ echo '{
  "code" : "AXYZ",
  "name" : "Account Unveil",
  "description" : "Unveil Account"
}' | http PUT 'http://localhost:8080/transactiontypes/AXYZ' 'Content-Type:application/json' 'Accept:application/json'
Table 25. change-tx-type-request-fields
Path Type Description

code

String

Transaction Type’s code

name

String

Name of transaction type

description

String

Description of transaction type

http-response
HTTP/1.1 202 Accepted