GET
/
v1
/
businesses
/
{business_id}
/
reports
/
profit-and-loss-details
curl -X GET 'https://sandbox.layerfi.com/v1/businesses/f9baa8fd-9413-4bcf-810b-6d32604de649/reports/profit-and-loss-details?month=3&year=2024&reporting_basis=CASH' \
  -H 'Authorization: Bearer <access_token>'

{
    "data": {
        "type": "Profit_And_Loss_Details",
        "cash_transactions": [
            {
                "transaction": {
                    "id": "0e603dc0-e140-4d7a-8f16-99d1aa5a8ad2",
                    "business_id": "f9baa8fd-9413-4bcf-810b-6d32604de649",
                    "source": "UNIT",
                    "source_transaction_id": "12345-FakeCorp-1234-expense-199",
                    "source_account_id": "1234",
                    "imported_at": "2024-05-23T03:51:15.836137Z",
                    "date": "2024-03-01T20:00:00Z",
                    "direction": "DEBIT",
                    "amount": 250000,
                    "counterparty_name": "WeWork",
                    "description": null,
                    "account_name": "Layer Demo Banking",
                    "categorization_status": "CATEGORIZED"
                },
                "ledger_entries": [
                    {
                        "id": "08bd0b04-89fe-406e-b5f7-6b0fb65cc799",
                        "business_id": "f9baa8fd-9413-4bcf-810b-6d32604de649",
                        "ledger_id": "0f4bb90e-1c43-4994-81e8-aac4dcd6e380",
                        "agent": "LAYER_AUTO",
                        "entry_type": "EXPENSE",
                        "date": "2024-05-23T03:52:54.880652Z",
                        "entry_at": "2024-03-01T20:00:00Z",
                        "reversal_of_id": null,
                        "reversal_id": null,
                        "line_items": [
                            {
                                "id": "079444d8-cf57-49ac-955e-6edc97d746d5",
                                "entry_id": "08bd0b04-89fe-406e-b5f7-6b0fb65cc799",
                                "account": {
                                    "id": "50edc310-66ab-4380-b1de-0d52c24821b2",
                                    "name": "Rent",
                                    "stable_name": "RENT_EXPENSE",
                                    "normality": "DEBIT",
                                    "account_type": {
                                        "value": "EXPENSE",
                                        "display_name": "Expenses"
                                    },
                                    "account_subtype": {
                                        "value": "OPERATING_EXPENSES",
                                        "display_name": "Operating Expenses"
                                    }
                                },
                                "amount": 250000,
                                "direction": "DEBIT",
                                "entry_at": "2024-03-01T20:00:00Z",
                                "createdAt": "2024-05-23T03:52:54.880652Z"
                            },
                            {
                                "id": "8ac6683e-db36-4dd3-a35c-a7adb3e62066",
                                "entry_id": "08bd0b04-89fe-406e-b5f7-6b0fb65cc799",
                                "account": {
                                    "id": "5c114ae2-0e6f-4798-8e9a-f7e1c892e2fa",
                                    "name": "Layer Demo Banking",
                                    "stable_name": null,
                                    "normality": "DEBIT",
                                    "account_type": {
                                        "value": "ASSET",
                                        "display_name": "Assets"
                                    },
                                    "account_subtype": {
                                        "value": "BANK_ACCOUNTS",
                                        "display_name": "Bank Accounts"
                                    }
                                },
                                "amount": 250000,
                                "direction": "CREDIT",
                                "entry_at": "2024-03-01T20:00:00Z",
                                "createdAt": "2024-05-23T03:52:54.880652Z"
                            }
                        ]
                    }
                ],
                "combined_result": [
                    {
                        "account": {
                            "account_id": {
                                "id": "50edc310-66ab-4380-b1de-0d52c24821b2"
                            },
                            "name": "Rent",
                            "stable_name": {
                                "stable_name": "RENT_EXPENSE"
                            },
                            "account_normality": "DEBIT",
                            "account_type": "EXPENSE",
                            "account_subtype": "OPERATING_EXPENSES"
                        },
                        "amount": 250000,
                        "direction": "DEBIT"
                    },
                    {
                        "account": {
                            "account_id": {
                                "id": "5c114ae2-0e6f-4798-8e9a-f7e1c892e2fa"
                            },
                            "name": "Layer Demo Banking",
                            "stable_name": null,
                            "account_normality": "DEBIT",
                            "account_type": "ASSET",
                            "account_subtype": "BANK_ACCOUNTS"
                        },
                        "amount": 250000,
                        "direction": "CREDIT"
                    }
                ]
            },
            // more transactions omitted for brevity
        ],
        "profit_and_loss_details": {
            "business_id": "f9baa8fd-9413-4bcf-810b-6d32604de649",
            "start_date": "2024-03-01T05:00:00Z",
            "end_date": "2024-04-01T04:00:00Z",
            "income": {
                "name": "Revenue",
                "display_name": "Revenue",
                "value": 2730000,
                "line_items": [
                    {
                        "name": "SERVICES_REVENUE",
                        "display_name": "Service Revenue",
                        "value": 2730000,
                        "line_items": [],
                        "is_contra": false,
                        "entries": [
                            {
                                "id": "allocation-f61a2686-2085-4fe1-96a3-2103c93f9074-f61a2686-2085-4fe1-96a3-2103c93f9074-0",
                                "entry_id": "allocation-f61a2686-2085-4fe1-96a3-2103c93f9074-f61a2686-2085-4fe1-96a3-2103c93f9074",
                                "account": {
                                    "id": "59d427f8-4681-4a8c-926e-3c3963b24e8f",
                                    "name": "Service Revenue",
                                    "stable_name": "SERVICES_REVENUE",
                                    "normality": "CREDIT",
                                    "account_type": {
                                        "value": "REVENUE",
                                        "display_name": "Revenue"
                                    },
                                    "account_subtype": {
                                        "value": "SALES",
                                        "display_name": "Sales"
                                    }
                                },
                                "amount": 420000,
                                "direction": "CREDIT",
                                "date": "2024-03-01T20:00:00Z",
                                "source": {
                                    "type": "Invoice_Ledger_Entry_Source",
                                    "invoice_id": "679b689f-0a29-47f1-84cf-c4cef492ef5b",
                                    "external_id": null,
                                    "invoice_number": null,
                                    "recipient_name": "FakeCorp 94720",
                                    "date": "2024-03-01T20:00:00Z",
                                    "amount": 420000,
                                    "entity_name": "Invoice",
                                    "display_description": "Invoice (March 1)"
                                }
                            },
                        ]
                    }
                ],
                "is_contra": false,
                "entries": []
            },
            "cost_of_goods_sold": {
                "name": "Cost of Goods Sold",
                "display_name": "Cost of Goods Sold",
                "value": 428940,
                "line_items": [],
                "is_contra": false,
                "entries": []
            },
            "gross_profit": 2301060,
            "expenses": {
                "name": "Expenses",
                "display_name": "Expenses",
                "value": 560695,
                "line_items": [],
                "is_contra": false,
                "entries": []
            },
            "profit_before_taxes": 1740365,
            "taxes": {
                "name": "Taxes",
                "display_name": "Taxes",
                "value": 0,
                "line_items": [],
                "is_contra": false,
                "entries": []
            },
            "net_profit": 1740365,
            "fully_categorized": true
        },
        "balances": [
            {
                "account": {
                    "account_id": {
                        "id": "50edc310-66ab-4380-b1de-0d52c24821b2"
                    },
                    "name": "Rent",
                    "stable_name": {
                        "stable_name": "RENT_EXPENSE"
                    },
                    "account_normality": "DEBIT",
                    "account_type": "EXPENSE",
                    "account_subtype": "OPERATING_EXPENSES"
                },
                "amount": 250000,
                "direction": "DEBIT"
            },
            {
                "account": {
                    "account_id": {
                        "id": "5c114ae2-0e6f-4798-8e9a-f7e1c892e2fa"
                    },
                    "name": "Layer Demo Banking",
                    "stable_name": null,
                    "account_normality": "DEBIT",
                    "account_type": "ASSET",
                    "account_subtype": "BANK_ACCOUNTS"
                },
                "amount": 1712350,
                "direction": "DEBIT"
            },
        ]
    }
}
business_id
string
required

ID of the Business to generate a Profit and Loss Details report for.

Response

Returns the generated Profit and Loss Details report.

curl -X GET 'https://sandbox.layerfi.com/v1/businesses/f9baa8fd-9413-4bcf-810b-6d32604de649/reports/profit-and-loss-details?month=3&year=2024&reporting_basis=CASH' \
  -H 'Authorization: Bearer <access_token>'

{
    "data": {
        "type": "Profit_And_Loss_Details",
        "cash_transactions": [
            {
                "transaction": {
                    "id": "0e603dc0-e140-4d7a-8f16-99d1aa5a8ad2",
                    "business_id": "f9baa8fd-9413-4bcf-810b-6d32604de649",
                    "source": "UNIT",
                    "source_transaction_id": "12345-FakeCorp-1234-expense-199",
                    "source_account_id": "1234",
                    "imported_at": "2024-05-23T03:51:15.836137Z",
                    "date": "2024-03-01T20:00:00Z",
                    "direction": "DEBIT",
                    "amount": 250000,
                    "counterparty_name": "WeWork",
                    "description": null,
                    "account_name": "Layer Demo Banking",
                    "categorization_status": "CATEGORIZED"
                },
                "ledger_entries": [
                    {
                        "id": "08bd0b04-89fe-406e-b5f7-6b0fb65cc799",
                        "business_id": "f9baa8fd-9413-4bcf-810b-6d32604de649",
                        "ledger_id": "0f4bb90e-1c43-4994-81e8-aac4dcd6e380",
                        "agent": "LAYER_AUTO",
                        "entry_type": "EXPENSE",
                        "date": "2024-05-23T03:52:54.880652Z",
                        "entry_at": "2024-03-01T20:00:00Z",
                        "reversal_of_id": null,
                        "reversal_id": null,
                        "line_items": [
                            {
                                "id": "079444d8-cf57-49ac-955e-6edc97d746d5",
                                "entry_id": "08bd0b04-89fe-406e-b5f7-6b0fb65cc799",
                                "account": {
                                    "id": "50edc310-66ab-4380-b1de-0d52c24821b2",
                                    "name": "Rent",
                                    "stable_name": "RENT_EXPENSE",
                                    "normality": "DEBIT",
                                    "account_type": {
                                        "value": "EXPENSE",
                                        "display_name": "Expenses"
                                    },
                                    "account_subtype": {
                                        "value": "OPERATING_EXPENSES",
                                        "display_name": "Operating Expenses"
                                    }
                                },
                                "amount": 250000,
                                "direction": "DEBIT",
                                "entry_at": "2024-03-01T20:00:00Z",
                                "createdAt": "2024-05-23T03:52:54.880652Z"
                            },
                            {
                                "id": "8ac6683e-db36-4dd3-a35c-a7adb3e62066",
                                "entry_id": "08bd0b04-89fe-406e-b5f7-6b0fb65cc799",
                                "account": {
                                    "id": "5c114ae2-0e6f-4798-8e9a-f7e1c892e2fa",
                                    "name": "Layer Demo Banking",
                                    "stable_name": null,
                                    "normality": "DEBIT",
                                    "account_type": {
                                        "value": "ASSET",
                                        "display_name": "Assets"
                                    },
                                    "account_subtype": {
                                        "value": "BANK_ACCOUNTS",
                                        "display_name": "Bank Accounts"
                                    }
                                },
                                "amount": 250000,
                                "direction": "CREDIT",
                                "entry_at": "2024-03-01T20:00:00Z",
                                "createdAt": "2024-05-23T03:52:54.880652Z"
                            }
                        ]
                    }
                ],
                "combined_result": [
                    {
                        "account": {
                            "account_id": {
                                "id": "50edc310-66ab-4380-b1de-0d52c24821b2"
                            },
                            "name": "Rent",
                            "stable_name": {
                                "stable_name": "RENT_EXPENSE"
                            },
                            "account_normality": "DEBIT",
                            "account_type": "EXPENSE",
                            "account_subtype": "OPERATING_EXPENSES"
                        },
                        "amount": 250000,
                        "direction": "DEBIT"
                    },
                    {
                        "account": {
                            "account_id": {
                                "id": "5c114ae2-0e6f-4798-8e9a-f7e1c892e2fa"
                            },
                            "name": "Layer Demo Banking",
                            "stable_name": null,
                            "account_normality": "DEBIT",
                            "account_type": "ASSET",
                            "account_subtype": "BANK_ACCOUNTS"
                        },
                        "amount": 250000,
                        "direction": "CREDIT"
                    }
                ]
            },
            // more transactions omitted for brevity
        ],
        "profit_and_loss_details": {
            "business_id": "f9baa8fd-9413-4bcf-810b-6d32604de649",
            "start_date": "2024-03-01T05:00:00Z",
            "end_date": "2024-04-01T04:00:00Z",
            "income": {
                "name": "Revenue",
                "display_name": "Revenue",
                "value": 2730000,
                "line_items": [
                    {
                        "name": "SERVICES_REVENUE",
                        "display_name": "Service Revenue",
                        "value": 2730000,
                        "line_items": [],
                        "is_contra": false,
                        "entries": [
                            {
                                "id": "allocation-f61a2686-2085-4fe1-96a3-2103c93f9074-f61a2686-2085-4fe1-96a3-2103c93f9074-0",
                                "entry_id": "allocation-f61a2686-2085-4fe1-96a3-2103c93f9074-f61a2686-2085-4fe1-96a3-2103c93f9074",
                                "account": {
                                    "id": "59d427f8-4681-4a8c-926e-3c3963b24e8f",
                                    "name": "Service Revenue",
                                    "stable_name": "SERVICES_REVENUE",
                                    "normality": "CREDIT",
                                    "account_type": {
                                        "value": "REVENUE",
                                        "display_name": "Revenue"
                                    },
                                    "account_subtype": {
                                        "value": "SALES",
                                        "display_name": "Sales"
                                    }
                                },
                                "amount": 420000,
                                "direction": "CREDIT",
                                "date": "2024-03-01T20:00:00Z",
                                "source": {
                                    "type": "Invoice_Ledger_Entry_Source",
                                    "invoice_id": "679b689f-0a29-47f1-84cf-c4cef492ef5b",
                                    "external_id": null,
                                    "invoice_number": null,
                                    "recipient_name": "FakeCorp 94720",
                                    "date": "2024-03-01T20:00:00Z",
                                    "amount": 420000,
                                    "entity_name": "Invoice",
                                    "display_description": "Invoice (March 1)"
                                }
                            },
                        ]
                    }
                ],
                "is_contra": false,
                "entries": []
            },
            "cost_of_goods_sold": {
                "name": "Cost of Goods Sold",
                "display_name": "Cost of Goods Sold",
                "value": 428940,
                "line_items": [],
                "is_contra": false,
                "entries": []
            },
            "gross_profit": 2301060,
            "expenses": {
                "name": "Expenses",
                "display_name": "Expenses",
                "value": 560695,
                "line_items": [],
                "is_contra": false,
                "entries": []
            },
            "profit_before_taxes": 1740365,
            "taxes": {
                "name": "Taxes",
                "display_name": "Taxes",
                "value": 0,
                "line_items": [],
                "is_contra": false,
                "entries": []
            },
            "net_profit": 1740365,
            "fully_categorized": true
        },
        "balances": [
            {
                "account": {
                    "account_id": {
                        "id": "50edc310-66ab-4380-b1de-0d52c24821b2"
                    },
                    "name": "Rent",
                    "stable_name": {
                        "stable_name": "RENT_EXPENSE"
                    },
                    "account_normality": "DEBIT",
                    "account_type": "EXPENSE",
                    "account_subtype": "OPERATING_EXPENSES"
                },
                "amount": 250000,
                "direction": "DEBIT"
            },
            {
                "account": {
                    "account_id": {
                        "id": "5c114ae2-0e6f-4798-8e9a-f7e1c892e2fa"
                    },
                    "name": "Layer Demo Banking",
                    "stable_name": null,
                    "account_normality": "DEBIT",
                    "account_type": "ASSET",
                    "account_subtype": "BANK_ACCOUNTS"
                },
                "amount": 1712350,
                "direction": "DEBIT"
            },
        ]
    }
}