Skip to Content
DevelopersAPI referenceExpenses

Profit loss

GET
/v1/reports/profit-loss

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (blk_…) from Settings → API keys.

Query Parameters

from*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
to*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate

Response Body

application/json
  1. response
from*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
to*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
months*array<>
totals*array<>
byCategory*array<>
tax*array<>
Example Request
curl -X GET 'https://your-billleaf-api/v1/reports/profit-loss?from=2019-08-24&to=2019-08-24'
Example Response200
{  "from": "2019-08-24",  "to": "2019-08-24",  "months": [    {      "month": "string",      "currency": "string",      "income": -9007199254740991,      "expenses": -9007199254740991,      "profit": -9007199254740991    }  ],  "totals": [    {      "currency": "string",      "amount": -9007199254740991,      "income": -9007199254740991,      "expenses": -9007199254740991    }  ],  "byCategory": [    {      "categoryId": "string",      "name": "string",      "currency": "string",      "amount": -9007199254740991    }  ],  "tax": [    {      "currency": "string",      "collected": -9007199254740991,      "paid": -9007199254740991    }  ]}