> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.monite.com/v2024-01-31/api/analytics/get-analytics-credit-notes/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server. # Get credit notes analytics GET https://api.sandbox.monite.com/v1/analytics/credit_notes Retrieve aggregated statistics for payables with different breakdowns. Reference: https://docs.monite.com/api/analytics/get-analytics-credit-notes ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, 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`, `issued_at`, `project_id` - `metric` (enum, required) - Allowed values: `id`, `total_amount` - `aggregation_function` (enum, required) - Allowed values: `count`, `average`, `summary`, `min`, `max` - `date_dimension_breakdown` (enum, optional) - Allowed values: `daily`, `weekly`, `monthly`, `quarterly`, `yearly` - `limit` (integer, optional, default: 100) — The number of items (0 .. 400) to return in a single page of the response. The response may contain fewer items if it is the last or only page. - `created_at__gt` (datetime, optional) - `created_at__lt` (datetime, optional) - `created_at__gte` (datetime, optional) - `created_at__lte` (datetime, optional) - `issued_at` (string, optional) - `issued_at__gt` (string, optional) - `issued_at__lt` (string, optional) - `issued_at__gte` (string, optional) - `issued_at__lte` (string, optional) - `document_id` (string, optional) - `document_id__iexact` (string, optional) - `document_id__contains` (string, optional) - `document_id__icontains` (string, optional) - `has_file` (boolean, optional) - `total_amount__gt` (integer, optional) - `total_amount__lt` (integer, optional) - `total_amount__gte` (integer, optional) - `total_amount__lte` (integer, optional) - `subtotal__gt` (integer, optional) - `subtotal__lt` (integer, optional) - `subtotal__gte` (integer, optional) - `subtotal__lte` (integer, optional) - `based_on` (string, optional) - `counterpart_id` (string, optional) - `created_by_entity_user_id` (string, optional) - `status` (enum, optional) - Allowed values: `new`, `draft`, `applied`, `approved`, `rejected`, `canceled`, `submitted_for_approval` - `status__in` (enum, optional) - Allowed values: `new`, `draft`, `applied`, `approved`, `rejected`, `canceled`, `submitted_for_approval` - `status__not_in` (enum, optional) - Allowed values: `new`, `draft`, `applied`, `approved`, `rejected`, `canceled`, `submitted_for_approval` - `origin` (enum, optional) - Allowed values: `upload`, `einvoicing` - `currency` (enum, optional) - Allowed values: `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BRL`, `BSD`, `BTN`, `BWP`, `BYN`, `BZD`, `CAD`, `CDF`, `CHF`, `CLP`, `CNY`, `COP`, `CRC`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MUR`, `MVR`, `MWK`, `MXN`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SEK`, `SGD`, `SHP`, `SLE`, `SOS`, `SRD`, `SSP`, `SVC`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `UYU`, `UZS`, `VND`, `VUV`, `WST`, `XAF`, `XCD`, `XOF`, `XPF`, `YER`, `ZAR`, `ZMW` - `project_id` (string, optional) - `project_id__in` (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 AnalyticsDataPoint, required) ## Errors ### 401 Get Analytics Credit Notes Request Unauthorized Error Unauthorized - `error` (ErrorSchema2, required) ### 403 Get Analytics Credit Notes Request Forbidden Error Forbidden - `error` (ErrorSchema2, required) ### 422 Get Analytics Credit Notes Request Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ### 500 Get Analytics Credit Notes Request Internal Server Error Internal Server Error - `error` (ErrorSchema2, required) ## Types ### AnalyticsDataPoint - `metric_value` (double, required) - `dimension_value` (string, optional) ### ErrorSchema2 - `message` (string, required) ### ValidationError - `loc` (list of ValidationErrorLocItem, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItem ## Examples **Response** ```json { "data": [ { "metric_value": 1.1, "dimension_value": "dimension_value" } ] } ``` **SDK Code** ```python import requests url = "https://api.sandbox.monite.com/v1/analytics/credit_notes" querystring = {"metric":"id","aggregation_function":"count"} headers = { "x-monite-version": "2024-01-31", "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4", "Authorization": "Bearer " } response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript const url = 'https://api.sandbox.monite.com/v1/analytics/credit_notes?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 ' } }; 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/credit_notes?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 ") 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/credit_notes?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 ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.sandbox.monite.com/v1/analytics/credit_notes?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 ") .asString(); ``` ```php request('GET', 'https://api.sandbox.monite.com/v1/analytics/credit_notes?metric=id&aggregation_function=count', [ 'headers' => [ 'Authorization' => 'Bearer ', '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/credit_notes?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 "); 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 " ] let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.monite.com/v1/analytics/credit_notes?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() ```