> This page is for version v2024-01-31.
> 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)
  - Allowed values: `quote`, `invoice`, `credit_note`
- `document_id` (string, optional)
- `document_id__contains` (string, optional)
- `document_id__icontains` (string, optional)
- `issue_date__gt` (datetime, optional)
- `issue_date__lt` (datetime, optional)
- `issue_date__gte` (datetime, optional)
- `issue_date__lte` (datetime, optional)
- `created_at__gt` (datetime, optional)
- `created_at__lt` (datetime, optional)
- `created_at__gte` (datetime, optional)
- `created_at__lte` (datetime, optional)
- `counterpart_id` (string, optional)
- `counterpart_name` (string, optional)
- `counterpart_name__contains` (string, optional)
- `counterpart_name__icontains` (string, optional)
- `total_amount` (integer, optional)
- `total_amount__gt` (integer, optional)
- `total_amount__lt` (integer, optional)
- `total_amount__gte` (integer, optional)
- `total_amount__lte` (integer, optional)
- `discounted_subtotal` (integer, optional)
- `discounted_subtotal__gt` (integer, optional)
- `discounted_subtotal__lt` (integer, optional)
- `discounted_subtotal__gte` (integer, optional)
- `discounted_subtotal__lte` (integer, optional)
- `status` (enum, optional)
  - Allowed values: `draft`, `issuing`, `issued`, `failed`, `accepted`, `expired`, `declined`, `recurring`, `partially_paid`, `paid`, `overdue`, `uncollectible`, `canceled`
- `entity_user_id` (string, optional)
- `based_on` (string, optional)
- `due_date__gt` (string, optional)
- `due_date__lt` (string, optional)
- `due_date__gte` (string, optional)
- `due_date__lte` (string, optional)
- `has_due_date` (boolean, optional)
- `project_id` (string, optional)
- `search_text` (string, optional)

### 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

Unauthorized

- `error` (ErrorSchema, required)

### 403 Get Analytics Receivables Request Forbidden Error

Forbidden

- `error` (ErrorSchema, required)

### 422 Get Analytics Receivables Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Get Analytics Receivables Request Internal Server Error

Internal Server Error

- `error` (ErrorSchema, required)

## 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-01-31",
    "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-01-31',
    '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-01-31")
	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-01-31'
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-01-31")
  .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-01-31',
  ],
]);

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-01-31");
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-01-31",
  "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()
```