# Accounting API — Profit and Loss

> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Profit-and-Loss

This document contains every operation on the `Profit and Loss` resource.

---

# Get Profit and Loss

> **Accounting API** · `GET /accounting/profit-and-loss`
> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Profit-and-Loss/operation/profitAndLossOne

Get Profit and Loss

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `raw` | query | `boolean` | No | Include raw response. Mostly used for debugging purposes |
| `x-apideck-consumer-id` | header | `string` | Yes | ID of the consumer which you want to get or push data from |
| `x-apideck-app-id` | header | `string` | Yes | The ID of your Unify application |
| `x-apideck-service-id` | header | `string` | No | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. |
| `x-apideck-company-id` | header | `string` | No | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. |
| `filter` | query | `object` | No | Apply filters |
| `pass_through` | query | `object` | No | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads |
| `fields` | query | `string` | No | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |

### Responses

#### 200 — Profit & Loss Report

- `status_code` `integer` **required** — HTTP Response Status Code — example: `200`
- `status` `string` **required** — HTTP Response Status — example: `OK`
- `service` `string` **required** — Apideck ID of service provider — example: `quickbooks`
- `resource` `string` **required** — Unified API resource name — example: `ProfitAndLosses`
- `operation` `string` **required** — Operation performed — example: `one`
- `data` `object` **required**
  - `id` `string` — A unique identifier for an object. — example: `12345`
  - `report_name` `string` **required** — The name of the report — example: `ProfitAndLoss`
  - `start_date` `string` — The start date of the report — example: `2017-01-01`
  - `end_date` `string` — The end date of the report — example: `2017-01-31`
  - `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
  - `income` `object` **required** — The operating income accounts
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `code` `string` — The account code of the account — example: `1100`
    - `title` `string` — The name of the account. — example: `Current assets`
    - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
    - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
    - `records` `array of object | object` **required**
      - One of:
        - Option 1: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
          - `records` `array of object | object`
            - _(schema continues — truncated at depth 6)_

        - Option 2: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `value` `number` — example: `23992.34`
          - `total` `number` **required** — The total amount of the transaction or record — example: `49.99`
  - `cost_of_goods_sold` `object` — The cost of goods sold accounts
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `code` `string` — The account code of the account — example: `1100`
    - `title` `string` — The name of the account. — example: `Current assets`
    - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
    - `total` `number` — The aggregated total of all accounts within this category. — example: `1000`
    - `records` `array of object | object` **required**
      - One of:
        - Option 1: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
          - `records` `array of object | object`
            - _(schema continues — truncated at depth 6)_

        - Option 2: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `value` `number` — example: `23992.34`
          - `total` `number` **required** — The total amount of the transaction or record — example: `49.99`
  - `expenses` `object` **required** — The operating expenses accounts
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `code` `string` — The account code of the account — example: `1100`
    - `title` `string` — The name of the account. — example: `Current assets`
    - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
    - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
    - `records` `array of object | object` **required**
      - One of:
        - Option 1: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
          - `records` `array of object | object`
            - _(schema continues — truncated at depth 6)_

        - Option 2: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `value` `number` — example: `23992.34`
          - `total` `number` **required** — The total amount of the transaction or record — example: `49.99`
  - `other_income` `object` — The other income accounts
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `code` `string` — The account code of the account — example: `1100`
    - `title` `string` — The name of the account. — example: `Current assets`
    - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
    - `total` `number` — The aggregated total of all accounts within this category. — example: `1000`
    - `records` `array of object | object` **required**
      - One of:
        - Option 1: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
          - `records` `array of object | object`
            - _(schema continues — truncated at depth 6)_

        - Option 2: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `value` `number` — example: `23992.34`
          - `total` `number` **required** — The total amount of the transaction or record — example: `49.99`
  - `other_expenses` `object` — The other expenses accounts
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `code` `string` — The account code of the account — example: `1100`
    - `title` `string` — The name of the account. — example: `Current assets`
    - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
    - `total` `number` — The aggregated total of all accounts within this category. — example: `1000`
    - `records` `array of object | object` **required**
      - One of:
        - Option 1: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
          - `records` `array of object | object`
            - _(schema continues — truncated at depth 6)_

        - Option 2: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `value` `number` — example: `23992.34`
          - `total` `number` **required** — The total amount of the transaction or record — example: `49.99`
  - `uncategorized_accounts` `object` — The accounts not categorized in the other sections
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `code` `string` — The account code of the account — example: `1100`
    - `title` `string` — The name of the account. — example: `Current assets`
    - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
    - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
    - `records` `array of object | object` **required**
      - One of:
        - Option 1: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `total` `number` **required** — The aggregated total of all accounts within this category. — example: `1000`
          - `records` `array of object | object`
            - _(schema continues — truncated at depth 6)_

        - Option 2: object
          - `id` `string` — A unique identifier for an object. — example: `12345`
          - `code` `string` — The account code of the account — example: `1100`
          - `title` `string` — The name of the account. — example: `Current assets`
          - `type` `string` — The type of profit and loss — enum: `Section`, `Record` — example: `Section`
          - `value` `number` — example: `23992.34`
          - `total` `number` **required** — The total amount of the transaction or record — example: `49.99`
  - `gross_profit` `object`
    - `total` `number` — The total amount of the transaction or record — example: `49.99`
  - `net_operating_income` `object`
    - `total` `number` — The total amount of the transaction or record — example: `49.99`
  - `net_income` `object`
    - `total` `number` — The total amount of the transaction or record — example: `49.99`
  - `custom_mappings` `object` — When custom mappings are configured on the resource, the result is included here.
  - `customer` `string` — The customer id — example: `123`
- `_raw` `object` — Raw response from the integration when raw=true query param is provided

#### 400 — Bad Request

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 401 — Unauthorized

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 402 — Payment Required

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 404 — The specified resource was not found

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 422 — Unprocessable

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### default — Unexpected error

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

---
