Skip to main content
POST
/
v5
/
reports
/
profitAndLoss
Profit and Loss
curl --request POST \
  --url https://sandbox.hurdlr.com/rest/v5/reports/profitAndLoss \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: */*' \
  --data '
{
  "beginDate": "2023-01-01",
  "endDate": "2023-12-31",
  "exportType": "HTML",
  "grouping": "DAILY",
  "businessIds": [
    123
  ],
  "clientIds": [
    123
  ],
  "emails": [
    "<string>"
  ],
  "ccEmails": [
    "<string>"
  ],
  "bccEmails": [
    "<string>"
  ],
  "date": "2023-01-01",
  "projection": true,
  "accountingMethod": "ACCRUAL"
}
'
{
  "result": "SUCCESS",
  "errors": {
    "fieldErrors": {},
    "globalErrors": [
      {
        "type": "DUPLICATE",
        "errorMessage": "<string>"
      }
    ]
  },
  "meta": {
    "title": "<string>",
    "businesses": [
      "<string>"
    ],
    "generatedOn": "2023-11-07T05:31:56Z",
    "generatedBy": "<string>",
    "footerLine": "<string>",
    "params": {
      "beginDate": "2023-01-01",
      "endDate": "2023-12-31",
      "exportType": "HTML",
      "grouping": "DAILY",
      "businessIds": [
        123
      ],
      "clientIds": [
        123
      ],
      "emails": [
        "<string>"
      ],
      "ccEmails": [
        "<string>"
      ],
      "bccEmails": [
        "<string>"
      ],
      "date": "2023-01-01",
      "projection": true,
      "accountingMethod": "ACCRUAL"
    }
  },
  "html": "<string>",
  "json": {
    "data": [
      {
        "name": "<string>",
        "period": {
          "beginDate": "2023-11-07T05:31:56Z",
          "endDate": "2023-11-07T05:31:56Z"
        },
        "netIncome": 123,
        "income": {
          "name": "<string>",
          "accountId": 123,
          "accountNo": "<string>",
          "total": 123,
          "children": [
            {}
          ]
        },
        "cogs": {
          "name": "<string>",
          "accountId": 123,
          "accountNo": "<string>",
          "total": 123,
          "children": [
            {}
          ]
        },
        "grossProfit": 123,
        "profitMargin": 123,
        "expenses": {
          "name": "<string>",
          "accountId": 123,
          "accountNo": "<string>",
          "total": 123,
          "children": [
            {}
          ]
        },
        "netOperatingIncome": 123,
        "operatingMargin": 123,
        "otherIncome": {
          "name": "<string>",
          "accountId": 123,
          "accountNo": "<string>",
          "total": 123,
          "children": [
            {}
          ]
        },
        "otherExpenses": {
          "name": "<string>",
          "accountId": 123,
          "accountNo": "<string>",
          "total": 123,
          "children": [
            {}
          ]
        }
      }
    ]
  },
  "url": "<string>"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

*/*
beginDate
string<date>
required

Begin date for the report

Example:

"2023-01-01"

endDate
string<date>
required

End date for the report

Example:

"2023-12-31"

exportType
enum<string>
required

Export type for this report

Available options:
HTML,
PDF,
JSON,
XLSX
grouping
enum<string>

Time period grouping for the report data, defaults to no grouping

Available options:
DAILY,
MONTHLY,
QUARTERLY,
YEARLY
businessIds
integer<int64>[]

List of businesses to include in this report, defaults to all businesses

List of businesses to include in this report, defaults to all businesses

clientIds
integer<int64>[]

List of clients to include in this report, defaults to all clients

List of clients to include in this report, defaults to all clients

emails
string[]

List of emails to which to send the report. Only valid for PDF and XLSX exportTypes.

List of emails to which to send the report. Only valid for PDF and XLSX exportTypes.

ccEmails
string[]

List of emails to be CC'ed on the report email. Only valid for PDF and XLSX exportTypes.

List of emails to be CC'ed on the report email. Only valid for PDF and XLSX exportTypes.

bccEmails
string[]

List of emails to be BCC'ed on the report email. Only valid for PDF and XLSX exportTypes.

List of emails to be BCC'ed on the report email. Only valid for PDF and XLSX exportTypes.

date
string<date>

Date the report was generated on (displayed in the footer of the PDF report)

Example:

"2023-01-01"

projection
boolean

Whether to project report data using the trailing twelve months of data tracked. Only valid for reports without groupings. Defaults to false.

accountingMethod
enum<string>
Available options:
ACCRUAL,
CASH,
EITHER

Response

200 - application/json

Successful operation

result
enum<string>

Result of the action performed

Available options:
SUCCESS,
FAILURE_VALIDATION_ERROR,
FAILURE_NO_DATA,
FAILURE_UNKNOWN_ERROR
errors
object

Error object containing details errors incurred, if any

meta
object

Metadata associated with the report generated

html
string

HTML of the report

json
object
url
string

Url at which the downloadable report is located