# Fetch entity summary

```
GET https://api.bookkeep.com/v1/entities/:entity_id/summary
```

A dictionary with a data property that contains an array of summaries broken down by report and currency. Each entry in the array is a separate report-summary object. If no reports are available, the resulting array will be empty.

## Date range behavior

- If `from_date` and `to_date` are missing, the default is to return the previous 30 days.
- If `from_date` is present but `to_date` is not, `to_date` is set to `from_date+30.days`.
- If `to_date` is present but `from_date` is not, `from_date` is set to `to_date-30.days`.

## Request

### Path Parameters

**entity_id** string required

Unique identifier for the entity.

### Query Parameters

**from_date** string

Beginning of date range in format `YYYY-MM-DD`.

**to_date** string

End of date range in format `YYYY-MM-DD`.

**currency** string

Three-letter ISO currency code. ex: `USD`.

**report** string

Report name. ex: `shopify_summary`.

**state** string

Filter by state. ex: `posted`, `unposted`, `ignore`.

## Responses

- 200
- 401
- 404

- application/json

- Schema
- Example (auto)

**Schema**

**object** string

**Default value:** `list`

**Example:** `list`

**data** object[]

Array [

**report** string

**Example:** `shopify_ecommerce`

**connection_ids** string[]

Array of Unique identifier for each connected app.

**Example:** `[
  "d58AGp7e1jVK"
]`

**lines** object[]

Array [

**description** string

**Example:** `Square Sales`

**account_type** string

**Example:** `Income`

**posting_type** string

**Example:** `Credit`

**total** number<double>

**Example:** `50424.75`

**subcategories** object

**property name*** number<double>

**currency** string

**Example:** `USD`

]

**metadata** object

**from_date** string<date>

**Example:** `2024-05-17`

**to_date** string<date>

**Example:** `2024-06-16`

**day_count** integer

**Example:** `31`

**record_count** integer

**Example:** `30`

**posted** integer

**Example:** `30`

**unposted** integer

**Example:** `0`

**failed** integer

**Example:** `0`

**missing** object

**count** integer

**Example:** `6`

**dates** string<date>[]

**Example:** `[
  "2024-05-22",
  "2024-05-23",
  "2024-05-24",
  "2024-05-25",
  "2024-06-11",
  "2024-06-12"
]`

]

```json
{
  "object": "list",
  "data": [
    {
      "report": "shopify_ecommerce",
      "connection_ids": [
        "d58AGp7e1jVK"
      ],
      "lines": [
        {
          "description": "Square Sales",
          "account_type": "Income",
          "posting_type": "Credit",
          "total": 50424.75,
          "subcategories": {
            "Cash": 2513.7,
            "Credit Card": 47911.05,
            "JT-Red Wine": 1024.7,
            "JT-Spirits": 487.78
          },
          "currency": "USD"
        }
      ],
      "metadata": {
        "from_date": "2024-05-17",
        "to_date": "2024-06-16",
        "day_count": 31,
        "record_count": 30,
        "posted": 30,
        "unposted": 0,
        "failed": 0,
        "missing": {
          "count": 6,
          "dates": [
            "2024-05-22",
            "2024-05-23",
            "2024-05-24",
            "2024-05-25",
            "2024-06-11",
            "2024-06-12"
          ]
        }
      }
    }
  ]
}
```

Returns an error if an invalid entity was provided.

- application/json

- Schema
- Example (auto)

**Schema**

**error** object

**message** string

**Example:** `Unrecognized request URL`

**type** string

**Example:** `invalid_request_error`

```json
{
  "error": {
    "message": "Unrecognized request URL",
    "type": "invalid_request_error"
  }
}
```

#### Authorization: http

```yaml
name: basic_auth
type: http
description: The Bookkeep API uses API keys to authenticate requests. You can view and manage your API keys in the [Bookkeep Developer Dashboard](https://app.bookkeep.com/developers/api_keys).
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Basic Auth. Provide your Publishable key as the basic auth username value and your Secret key as the basic auth password value.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
```

```curl
curl -L -X GET 'https://api.bookkeep.com/v1/entities' \
  -H 'Authorization: Basic ZGlsaXAuYmFpcmFnaUBib29ra2VlcC5jbzpXLlM4NVZGbkJyeEY2QmI='
```

- curl
- nodejs
- python
- ruby
- csharp
- php

- CURL

```bash
curl -L 'https://api.bookkeep.com/v1/entities/:entity_id/summary' \
-H 'Accept: application/json' \
-H 'Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+'
```

## Request Endpoints and Authentication Notes
  
Base URL

Edit

https://api.bookkeep.com

Auth

Username

Password

Parameters

entity_id — path required

Show optional parameters

from_date — query

to_date — query

currency — query

report — query

state — query

Send API Request

ResponseClear

Click the `Send API Request` button above and see the response here!
