Income/expense account

Income account is an account in the business's books that shows how much it has earned while the expense account shows the running costs of the business. Income / expense accounts can be used to manage cash flow in and out of your cash drawer that are not generated by sales. For an example of expense the store manager might need to pay for the window washing. Income/expense accounts are also used to handle the flow of tips or gratuity.

In LS One the income and expense accounts are managed per store and can include information about which account number they post to when posting to an ERP system. Income/expense lines can be added to a transaction in the basket endpoint.

The income-expense-account endpoint in LS One API allows management of the income and expense accounts as well as retrieval of the already defined accounts for a store.

Actions

GET 

Get income/expense account
GET  Get all income/expense accounts
GET  Get a list of income/expense accounts for a specific store

POST 

Create a new income/expense account

PUT 

Update a income/expense account

DELETE 

Delete a income/expense account

Properties

Field Data type Validation Description
id string

-

Unique identifier of the account
accountNum string - Account number
storeID string Required Unique identifier for the store
name string Required

max. length = 30

Name of account
nameAlias string Required

max. length = 20

Name alias of account
accountType int

Required

Type of the account:

  • 0 - income account

  • 1 - expense account

  • 2 - tips-in account

  • 3 - tips-out account

  • 4 - all

ledgerAccount string

-

Ledger account for income/expense

Examples

Get income/expense account

Returns details of a single income/expense account.

GET /api/income-expense-account/{id}

Permissions

  • IncomeExpenseAccount:Read

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/income-expense-account/000000001' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'		
Parameter Data type Validation Description
id string

Required

Unique identifier of the income/expense account

Response

{
	"id": "000000001",
	"accountNum": "000000001",
	"storeID": "S0001",
	"name": "Cash income",
	"nameAlias": "Income account",
	"accountType": 0,
	"ledgerAccount": "3050"
}		

Status codes

Code Text Description
200 Success Success
401 Unauthorized LS One API client did not provide a valid authentication token or it does not have permissions to read income/expense account(s)
404 Not Found The requested income/expense account was not found

Get Income/Expense accounts

Returns a list of all income/expense accounts.

GET /api/income-expense-account

Permissions

  • IncomeExpenseAccount:Read

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'GET' \
  'https://lsoneapi.lsretail.com/api/income-expense-account' \
  -H 'accept: text/plain' \
 -H 'Authorization: Bearer {authentication_token}'

Response

[
	{
		"id": "000000001",
		"accountNum": "000000001",
		"storeID": "S0001",
		"name": "Cash income",
		"nameAlias": "Income account",
		"accountType": 0,
		"ledgerAccount": "3050"
	},	
	{
		"id": "000000002",
		"accountNum": "000000002",
		"storeID": "S0001",
		"name": "Window washing",
		"nameAlias": "Regular Expenses",
		"accountType": 1,
		"ledgerAccount": "5060"
	},
	...
]

Status codes

Code Text Description
200 Success Success
401 Unauthorized LS One API client did not provide a valid authentication token or it does not have permissions to read income/expense account(s)
404 Not Found No income/expense accounts found

Get income/expense accounts for store

Returns a list of all income/expense accounts for a specific store.

GET /api/income-expense-account/store/{storeId}

Permissions

  • IncomeExpenseAccount:Read

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'GET' \
  'https://lsoneapi.lsretail.com/api/income-expense-account/store/S0001' \
  -H 'accept: text/plain' \
 -H 'Authorization: Bearer {authentication_token}'

Response

[
	{
		"id": "000000002",
		"accountNum": "000000002",
		"storeID": "S0001",
		"name": "Window washing",
		"nameAlias": "Regular Expenses",
		"accountType": 1,
		"ledgerAccount": "5060"
	},
	{
		"id": "000000007",
		"accountNum": "000000007",
		"storeID": "S0001",
		"name": "Maintenance and repairs",
		"nameAlias": "Repairs",
		"accountType": 1,
		"ledgerAccount": "5070"
	},
	...
]

Status codes

Code Text Description
200 Success Success
401 Unauthorized LS One API client did not provide a valid authentication token or it does not have permissions to read income/expense account(s)
404 Not Found No income/expense accounts found

Create income/expense account

Create a new income/expense account.

POST /api/income-expense-account

To create a new income/expense account, the following fields are required:

  • StoreID

  • Name

  • NameAlias

  • AccountType

Permissions

  • IncomeExpenseAccount:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'POST' \
  'https://lsoneapi.lsretail.com/api/income-expense-account' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer {authorization_token}' \
  -H 'Content-Type: application/json' \
  -d '{
		"storeID": "S0001",
		"name": "Test income expense account",
		"nameAlias": "Income account",
		"accountType": 1
	}'

Response

{
	"id": null,
	"accountNum": null,
	"storeID": "S0001",
	"name": "Test income expense account",
	"nameAlias": "Income account",
	"accountType": 1,
	"ledgerAccount": null
}	

Status codes

Code Text Description
200 Success Success
401 Unauthorized LS One API client did not provide a valid authentication token or it does not have permissions to read income/expense account(s)
400 Bad Request New income/expense account could not be created

Update income/expense account

Updates an existing income/expense account.

PUT /api/income-expense-account

To update an existing income/expense account, the following fields are required:

  • ID

  • StoreID

  • Name

  • NameAlias

  • AccountType

Permissions

  • IncomeExpenseAccount:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'PUT' \
  'https://lsoneapi.lsretail.com/api/income-expense-account' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer {authentication_token}' \
  -H 'Content-Type: application/json' \
  -d '{
		"id": "0-000000001",
		"storeID": "S0001",
		"name": "Update income expense account",
		"nameAlias": "Income account updated",
		"accountType": 1,
		"ledgerAccount": "3050"
	  }'

Response

{
	"id": "0-000000001",
	"accountNum": null,
	"storeID": "S0001",
	"name": "Update income expense account",
	"nameAlias": "Income acc updated",
	"accountType": 1,
	"ledgerAccount": "3050"
}
Status codes
Code Text Description
200 Success Success
401 Unauthorized LS One API client did not provide a valid authentication token or it does not have permissions to write income/expense account(s)
400 Bad Request Income/Expense account could not be updated
404 Not Found Income/Expense account to be updated was not found

Delete income/expense account

Delete an existing income/expense account.

DELETE /api/income-expense-account/{id}

Permissions

  • IncomeExpenseAccount:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'DELETE' \
  'https://lsoneapi.lsretail.com/api/income-expense-account/0-000000001' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer {authentication_token}'
Parameter Data type Validation Description
id string

Required

Unique identifier of the income/expense account

Response

HTTP/1.1 204 No Content

Status codes

Code Text Description
200 Success Success
401 Unauthorized LS One API client did not provide a valid authentication token or it does not have permissions to read income/expense account(s)
404 Not Found The requested income/expense account was not found