Get the profit and loss account
curl --request GET \
--url https://api.melso.ai/v1/companies/{company_id}/reports/profit-and-loss \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/reports/profit-and-loss"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.melso.ai/v1/companies/{company_id}/reports/profit-and-loss', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"from": "2023-12-25",
"to": "2023-12-25",
"result": "121.00",
"compare_result": "<string>",
"lines": [
{
"key": "<string>",
"label": "<string>",
"level": 123,
"amount": "121.00",
"compare_amount": "<string>",
"accounts": [
{
"account": "<string>",
"name": "<string>",
"amount": "121.00"
}
]
}
]
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "Review and approve in the authenticated web application",
"code": "person_required",
"request_id": "req_01JAB3K9X2"
}Accounting
Get the profit and loss account
The profit and loss account (cuenta de pérdidas y ganancias) between two dates, in the PGC’s model, optionally beside a comparison period.
GET
/
companies
/
{company_id}
/
reports
/
profit-and-loss
Get the profit and loss account
curl --request GET \
--url https://api.melso.ai/v1/companies/{company_id}/reports/profit-and-loss \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/reports/profit-and-loss"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.melso.ai/v1/companies/{company_id}/reports/profit-and-loss', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"from": "2023-12-25",
"to": "2023-12-25",
"result": "121.00",
"compare_result": "<string>",
"lines": [
{
"key": "<string>",
"label": "<string>",
"level": 123,
"amount": "121.00",
"compare_amount": "<string>",
"accounts": [
{
"account": "<string>",
"name": "<string>",
"amount": "121.00"
}
]
}
]
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "Review and approve in the authenticated web application",
"code": "person_required",
"request_id": "req_01JAB3K9X2"
}Live capability. Melso runs this in production today. Partner keys reach it once your partner account is enabled. See Availability.
Authorizations
Your partner secret key, mk_live_… for real companies or mk_test_…
for test companies. Keep it on your servers. See
Authentication.
Path Parameters
The company's ID. Every company-scoped call works in exactly this company.