Profit And Loss
Overview
The Profit And Loss endpoint returns financial data used to review profit and loss information for the selected company and reporting period. The response includes tax and service totals for the current period and year, together with income accounts and their related account details.
Each income account provides debit, credit, yearly totals, account hierarchy information, and budget values. This endpoint is commonly used to review income performance, compare current and yearly financial values, and support profit and loss reporting.
Request Endpoint
- Method:
POST - Path:
{{base_url}}/api/reports/profit-and-loss
Payload Construction and Schema Definition
The request payload is submitted as form-data fields.
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | Company identifier. |
eom_id | string | Yes | End-of-month period identifier. |
pl_setting_department_header_id | string | yes | Profit and loss department setting header identifier. |
Response Body Fields
| Field | Type | Always present | Description |
|---|---|---|---|
error | boolean | Yes | Indicates whether the request failed. false means success. |
status | string | Yes | Status string. On success the example returns "ok". |
message | string | Yes | Human-readable message. Often empty on success. |
data | array of object | Yes (on success) | Profit and loss report data. |
Response data Fields
| Field | Type | Description | Example |
|---|---|---|---|
taxes_service | object | Tax and service totals for the current period and year ( see below ). | { ... } |
list_income | array of objects | List of income accounts and their financial details ( see below ). | [ ... ] |
Response data.taxes_service Fields
| Field | Type | Description | Example |
|---|---|---|---|
total_taxes | number | Total tax amount for the current period. | 1803636.3636363621 |
total_services | number | Total service charge amount for the current period. | 1639669.4214876022 |
total_taxes_year | number | Total tax amount for the current year. | 5008723.303030295 |
total_services_year | number | Total service charge amount for the current year. | 4543350.193821323 |
Response data.list_income Fields
| Field | Type | Description | Example |
|---|---|---|---|
id | string | Income account group identifier. | 4.1.01 |
level1 | string | Level 1 parent account identifier. | 4.0.00 |
name | string | Income account group name. | 4.1.01 - Income |
account_detail | array of objects | List of accounts included in the income group ( see below ). | [ ... ] |
Response data.list_income.account_detail Fields
| Field | Type | Description | Example |
|---|---|---|---|
id | string | Income account identifier. | 890bb240-b33f-... |
debit | number | Debit amount for the current period. | 0 |
credit | number | Credit amount for the current period. | 1128099.1735537054 |
total_credit | number | Total credit value for the current period. | 1128099.1735537054 |
total_debit | number | Total debit value for the current period. | -1128099.1735537054 |
debit_year | number | Debit amount for the current year. | 0 |
credit_year | number | Credit amount for the current year. | 4566042.994883824 |
total_credit_year | number | Total credit value for the current year. | 4566042.994883824 |
total_debit_year | number | Total debit value for the current year. | -4566042.994883824 |
name | string | Name of the income account. | 3.1 - Restaurant Revenue |
label | string | Display label of the income account. | 3.1 - Restaurant Revenue |
level3 | string | Level 3 parent account identifier. | 4.1.01 |
level1 | string | Level 1 parent account identifier. | 4.0.00 |
code | string | Income account code. | 3.1 |
budget | number | Budget value for the current period. | 0 |
budget_year | number | Budget value for the current year. | 0 |
Expected System Responses
The system responds with HTTP 200 OK.
{
"error": false,
"status": "ok",
"message": "",
"data": {
"taxes_service": {
"total_taxes": 1803636.3636363621,
"total_services": 1639669.4214876022,
"total_taxes_year": 5008723.303030295,
"total_services_year": 4543350.193821323
},
"list_income": [
{
"id": "4.1.01",
"level1": "4.0.00",
"name": "4.1.01 - Income",
"account_detail": [
{
"id": "890bb240-b33f-11ed",
"debit": 0,
"credit": 1128099.1735537054,
"total_credit": 1128099.1735537054,
"total_debit": -1128099.1735537054,
"debit_year": 0,
"credit_year": 4566042.994883824,
"total_credit_year": 4566042.994883824,
"total_debit_year": -4566042.994883824,
"name": "3.1 - Restaurant Revenue",
"label": "3.1 - Restaurant Revenue",
"level3": "4.1.01",
"level1": "4.0.00",
"code": "3.1",
"budget": 0,
"budget_year": 0
},
]
},
]
}
}