> This page is for version v2024-05-25 (default).
> For other versions, use one of these documentation indexes:
> - v2024-05-25 (default): https://docs.monite.com/v-2024-05-25/llms.txt
> - v2024-01-31: https://docs.monite.com/v2024-01-31/llms.txt
> - v2023-09-01: https://docs.monite.com/v2023-09-01/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.monite.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server.

# Get receivables analytics

GET https://api.sandbox.monite.com/v1/analytics/receivables

Retrieve aggregated statistics for receivables with different breakdowns.

Reference: https://docs.monite.com/api/analytics/get-analytics-receivables

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.sandbox.monite.com/v1` (sandbox, default)
- `https://api.monite.com/v1` (eu_production)
- `https://us.api.monite.com/v1` (na_production)

## Request

### Query parameters

- `dimension` (enum, optional)
  - Allowed values: `created_at`, `status`, `counterpart_id`, `currency`, `issue_date`, `due_date`, `project_id`, `product_id`
- `metric` (enum, required)
  - Allowed values: `id`, `total_amount`, `product_amount`, `product_quantity`
- `aggregation_function` (enum, required)
  - Allowed values: `count`, `average`, `summary`, `min`, `max`
- `date_dimension_breakdown` (enum, optional)
  - Allowed values: `daily`, `weekly`, `monthly`, `quarterly`, `yearly`
- `order` (enum, optional) — Sort order (ascending by default). Typically used together with the `sort` parameter.
  - Allowed values: `asc`, `desc`
- `limit` (integer, optional, default: 100) — The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`.
- `pagination_token` (string, optional) — A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned.
- `id__in` (string, optional) — Return only receivables with the specified IDs. Valid but nonexistent IDs do not raise errors but produce no results. To specify multiple IDs, repeat this parameter for each value: `id__in=<id1>&id__in=<id2>`
- `status__in` (enum, optional) — Return only receivables that have the specified statuses. See the applicable [invoice statuses](https://docs.monite.com/accounts-receivable/invoices/index), [quote statuses](https://docs.monite.com/accounts-receivable/quotes/index), and [credit note statuses](https://docs.monite.com/accounts-receivable/credit-notes#credit-note-lifecycle). To specify multiple statuses, repeat this parameter for each value: `status__in=draft&status__in=issued`
  - Allowed values: `draft`, `issuing`, `issued`, `failed`, `accepted`, `expired`, `declined`, `recurring`, `partially_paid`, `paid`, `overdue`, `uncollectible`, `canceled`
- `entity_user_id__in` (string, optional) — Return only receivables created by the entity users with the specified IDs.To specify multiple user IDs, repeat this parameter for each ID: `entity_user_id__in=<user1>&entity_user_id__in=<user2>` If the request is authenticated using an entity user token, this user must have the `receivable.read.allowed` (rather than `allowed_for_own`) permission to be able to query receivables created by other users. IDs of deleted users will still produce results here if those users had associated receivables. Valid but nonexistent user IDs do not raise errors but produce no results.
- `sort` (enum, optional) — The field to sort the results by. Typically used together with the `order` parameter.
  - Allowed values: `counterpart_name`, `counterpart_id`, `amount`, `total_amount`, `discounted_subtotal`, `status`, `due_date`, `issue_date`, `document_id`, `created_at`, `project_id`
- `tag_ids__in` (string, optional) — Return only receivables whose [tags](https://docs.monite.com/common/tags) include at least one of the tags with the specified IDs. For example, given receivables with the following tags: 1. tagA 2. tagB 3. tagA, tagB 4. tagC 5. tagB, tagC `tag_ids__in=<tagA>&tag_ids__in=<tagB>` will return receivables 1, 2, 3, and 5. Valid but nonexistent tag IDs do not raise errors but produce no results.
- `tag_ids` (string, optional) — Return only receivables whose [tags](https://docs.monite.com/common/tags) include all of the tags with the specified IDs and optionally other tags that are not specified. For example, given receivables with the following tags: 1. tagA 2. tagB 3. tagA, tagB 4. tagC 5. tagA, tagB, tagC `tag_ids=<tagA>&tag_ids=<tagB>` will return receivables 3 and 5.
- `product_ids__in` (string, optional) — Return only receivables whose line items include at least one of the product IDs with the specified IDs. To specify multiple product IDs, repeat this parameter for each ID: `product_ids__in=<product1>&product_ids__in=<product2>` For example, given receivables with the following product IDs: 1. productA 2. productB 3. productA, productB 4. productC 5. productB, productC `product_ids__in=<productA>&product_ids__in=<productB>` will return receivables 1, 2, 3, and 5.Valid but nonexistent product IDs do not raise errors but produce no results.
- `product_ids` (string, optional) — Return only receivables whose line items include all of the product IDs with the specified IDs and optionally other products that are not specified. To specify multiple product IDs, repeat this parameter for each ID: `product_ids=<product1>&product_ids=<product2>` For example, given receivables with the following product IDs: 1. productA 2. productB 3. productA, productB 4. productC 5. productA, productB, productC `product_ids=<productA>&product_ids=<productB>` will return receivables 3 and 5.
- `project_id__in` (string, optional) — Return only receivables whose `project_id` include at least one of the project_id with the specified IDs. Valid but nonexistent project IDs do not raise errors but produce no results.
- `type` (enum, optional) — Return only receivables of the specified type. Use this parameter to get only invoices, or only quotes, or only credit notes.
  - Allowed values: `quote`, `invoice`, `credit_note`
- `document_id` (string, optional) — Return a receivable with the exact specified document number (case-sensitive). The `document_id` is the user-facing document number such as INV-00042, not to be confused with Monite resource IDs (`id`).
- `document_id__contains` (string, optional) — Return only receivables whose document number (`document_id`) contains the specified string (case-sensitive).
- `document_id__icontains` (string, optional) — Return only receivables whose document number (`document_id`) contains the specified string (case-insensitive).
- `issue_date__gt` (datetime, optional) — Return only non-draft receivables that were issued after the specified date and time. The value must be in the ISO 8601 format `YYYY-MM-DDThh:mm[:ss][Z|±hh:mm]`. The milliseconds part of the value is ignored.
- `issue_date__lt` (datetime, optional) — Return only non-draft receivables that were issued before the specified date and time. The milliseconds part of the value is ignored.
- `issue_date__gte` (datetime, optional) — Return only non-draft receivables that were issued on or after the specified date and time. The milliseconds part of the value is ignored.
- `issue_date__lte` (datetime, optional) — Return only non-draft receivables that were issued before or on the specified date and time. The milliseconds part of the value is ignored.
- `created_at__gt` (datetime, optional) — Return only receivables created after the specified date and time. The value must be in the ISO 8601 format `YYYY-MM-DDThh:mm[:ss][Z|±hh:mm]`. The milliseconds part of the value is ignored.
- `created_at__lt` (datetime, optional) — Return only receivables created before the specified date and time. The milliseconds part of the value is ignored.
- `created_at__gte` (datetime, optional) — Return only receivables created on or after the specified date and time. The milliseconds part of the value is ignored.
- `created_at__lte` (datetime, optional) — Return only receivables created before or on the specified date and time. The milliseconds part of the value is ignored.
- `counterpart_id` (string, optional) — Return only receivables created for the counterpart with the specified ID. Counterparts that have been deleted but have associated receivables will still return results here because the receivables contain a frozen copy of the counterpart data. If the specified counterpart ID does not exist and never existed, no results are returned.
- `counterpart_name` (string, optional) — Return only receivables created for counterparts with the specified name (exact match, case-sensitive). For counterparts of `type` = `individual`, the full name is formatted as `first_name last_name`.
- `counterpart_name__contains` (string, optional) — Return only receivables created for counterparts whose name contains the specified string (case-sensitive).
- `counterpart_name__icontains` (string, optional) — Return only receivables created for counterparts whose name contains the specified string (case-insensitive).
- `total_amount` (integer, optional) — Return only receivables with the exact specified total amount. The amount must be specified in the [minor units](https://docs.monite.com/references/currencies#minor-units) of currency. For example, $12.5 is represented as 1250."
- `total_amount__gt` (integer, optional) — Return only receivables whose total amount (in minor units) exceeds the specified value.
- `total_amount__lt` (integer, optional) — Return only receivables whose total amount (in minor units) is less than the specified value.
- `total_amount__gte` (integer, optional) — Return only receivables whose total amount (in minor units) is greater than or equal to the specified value.
- `total_amount__lte` (integer, optional) — Return only receivables whose total amount (in minor units) is less than or equal to the specified value.
- `discounted_subtotal` (integer, optional) — Return only receivables with the exact specified discounted subtotal. The amount must be specified in the [minor units](https://docs.monite.com/references/currencies#minor-units) of currency. For example, $12.5 is represented as 1250.
- `discounted_subtotal__gt` (integer, optional) — Return only receivables whose discounted subtotal (in minor units) is greater than the specified value.
- `discounted_subtotal__lt` (integer, optional) — Return only receivables whose discounted subtotal (in minor units) is less than the specified value.
- `discounted_subtotal__gte` (integer, optional) — Return only receivables whose discounted subtotal (in minor units) is greater than or equal to the specified value.
- `discounted_subtotal__lte` (integer, optional) — Return only receivables whose discounted subtotal (in minor units) is less than or equal to the specified value.
- `status` (enum, optional) — Return only receivables that have the specified status. See the applicable [invoice statuses](https://docs.monite.com/accounts-receivable/invoices/index), [quote statuses](https://docs.monite.com/accounts-receivable/quotes/index), and [credit note statuses](https://docs.monite.com/accounts-receivable/credit-notes#credit-note-lifecycle). To query multiple statuses at once, use the `status__in` parameter instead.
  - Allowed values: `draft`, `issuing`, `issued`, `failed`, `accepted`, `expired`, `declined`, `recurring`, `partially_paid`, `paid`, `overdue`, `uncollectible`, `canceled`
- `entity_user_id` (string, optional) — Return only receivables created by the entity users with the specified IDs. To specify multiple user IDs, repeat this parameter for each ID: `entity_user_id__in=<user1>&entity_user_id__in=<user2>` If the request is authenticated using an entity user token, this user must have the `receivable.read.allowed` (rather than `allowed_for_own`) permission to be able to query receivables created by other users. IDs of deleted users will still produce results here if those users had associated receivables. Valid but nonexistent user IDs do not raise errors but produce no results.
- `based_on` (string, optional) — This parameter accepts a quote ID or an invoice ID. * Specify a quote ID to find invoices created from this quote. * Specify an invoice ID to find credit notes created for this invoice or find recurring invoices created from a base invoice. Valid but nonexistent IDs do not raise errors but produce no results.
- `due_date__gt` (string, optional) — Return receivables whose due date is after the specified date (exclusive, `YYYY-MM-DD`). This filter includes invoices and credit notes (only those with a due date) and excludes quotes.
- `due_date__lt` (string, optional) — Return receivables whose due date is before the specified date (exclusive, `YYYY-MM-DD`). This filter includes invoices and credit notes (only those with a due date) and excludes quotes.
- `due_date__gte` (string, optional) — Return receivables whose due date is on or after the specified date (`YYYY-MM-DD`). This filter includes invoices and credit notes (only those with a due date) and excludes quotes.
- `due_date__lte` (string, optional) — Return receivables whose due date is before or on the specified date (`YYYY-MM-DD`). This filter includes invoices and credit notes (only those with a due date) and excludes quotes.
- `has_due_date` (boolean, optional) — If `true`, returns only invoices and credit notes that have the `due_date` defined. If `false`, returns receivables (invoices, quotes, credit notes) without a `due_date`. If omitted (default), all receivables are included.
- `project_id` (string, optional) — Return only receivables assigned to the project with the specified ID. Valid but nonexistent project IDs do not raise errors but return no results.
- `search_text` (string, optional) — Searches for the specified substring in the `counterpart_name` and `document_id` fields in receivables. The search is case-insensitive and allows partial matches. For example, `abc` will match `12-ABCD`.

### Headers

- `x-monite-version` (string, required)
- `x-monite-entity-id` (string, required) — The ID of the entity that owns the requested resource.

## Response

### 200

Successful Response

- `data` (list of ReceivablesAnalyticsDataPoint, required)

## Errors

### 400 Get Analytics Receivables Request Bad Request Error

Bad Request

- `error` (ErrorSchema, required)

### 401 Get Analytics Receivables Request Unauthorized Error

The `Authorization` header is missing or contains an invalid or expired access token. See [Authentication](https://docs.monite.com/api/concepts/authentication) to learn how to authenticate API calls.

- `error` (ErrorSchema, required)

### 403 Get Analytics Receivables Request Forbidden Error

The specified access token does not have permissions to perform this operation.

- `error` (ErrorSchema, required)

### 422 Get Analytics Receivables Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 429 Get Analytics Receivables Request Too Many Requests Error

API rate limit has been exceeded. Check the response headers for the rate limit information.

- `any`

## Types

### ReceivablesAnalyticsDataPoint

- `metric_value` (integer, required)
- `dimension_value` (string, optional)

### ErrorSchema

- `message` (string, required)

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItem

## Examples

**Response**

```json
{
  "data": [
    {
      "metric_value": 1,
      "dimension_value": "dimension_value"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.sandbox.monite.com/v1/analytics/receivables"

querystring = {"metric":"id","aggregation_function":"count"}

headers = {
    "x-monite-version": "2024-05-25",
    "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.sandbox.monite.com/v1/analytics/receivables?metric=id&aggregation_function=count';
const options = {
  method: 'GET',
  headers: {
    'x-monite-version': '2024-05-25',
    'x-monite-entity-id': '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    Authorization: 'Bearer <token>'
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sandbox.monite.com/v1/analytics/receivables?metric=id&aggregation_function=count"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-monite-version", "2024-05-25")
	req.Header.Add("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.monite.com/v1/analytics/receivables?metric=id&aggregation_function=count")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-monite-version"] = '2024-05-25'
request["x-monite-entity-id"] = '9d2b4c8f-2087-4738-ba91-7359683c49a4'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sandbox.monite.com/v1/analytics/receivables?metric=id&aggregation_function=count")
  .header("x-monite-version", "2024-05-25")
  .header("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sandbox.monite.com/v1/analytics/receivables?metric=id&aggregation_function=count', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'x-monite-entity-id' => '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    'x-monite-version' => '2024-05-25',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sandbox.monite.com/v1/analytics/receivables?metric=id&aggregation_function=count");
var request = new RestRequest(Method.GET);
request.AddHeader("x-monite-version", "2024-05-25");
request.AddHeader("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-monite-version": "2024-05-25",
  "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.monite.com/v1/analytics/receivables?metric=id&aggregation_function=count")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```