POST
/
v1
/
businesses
/
{businessId}
/
reports
/
profit-and-loss
/
exports
/
comparison-csv
Export P&L comparison as CSV
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "periods": {
    "type": "Comparison_Months",
    "months": [
      {
        "year": 2024,
        "month": 12
      }
    ]
  },
  "tag_filters": [
    {
      "required_tags": [
        {
          "key": "Location",
          "value": "MainStreet"
        }
      ]
    }
  ],
  "reporting_basis": "ACCRUAL",
  "structure": "DEFAULT"
}'
{
  "type": "S3_Presigned_Url",
  "presignedUrl": "https://example-bucket.s3.amazonaws.com/example-object?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=FAKEAWSACCESSKEY%2F20240710%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=FAKESIGNATURE1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\n",
  "fileType": "csv"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json

Path Parameters

businessId
string
required

The UUID of the business to export the P&L comparison for

Query Parameters

money_format
enum<string>

Format for monetary values in the export

Available options:
DOLLAR_STRING,
CENTS_INTEGER

Body

application/json
periods
object
tag_filters
object[] | null
reporting_basis
enum<string>
Available options:
ACCRUAL,
CASH
structure
enum<string>
Available options:
DEFAULT,
TRUCKING,
MEDSPA,
MEDSPA_NO_LICENSING,
CITRUS,
CITRUS_NO_LICENSING,
FLORIST

Response

Pre-signed URL for downloading the CSV export

A pre-signed URL to download a document

type
string

Resource type. Value will be 'S3_Presigned_Url'.

Example:

"S3_Presigned_Url"

presignedUrl
string

Pre-signed URL to download a document

Example:

"https://example-bucket.s3.amazonaws.com/example-object?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=FAKEAWSACCESSKEY%2F20240710%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=FAKESIGNATURE1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\n"

fileType
string

The file type of the document

Example:

"csv"