curl --request GET \
--url https://api.watchdog.no/v1/invoices/metrics \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/invoices/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/invoices/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"alert_scope": {
"type": "invoice",
"agreement_ids": null
},
"document_count": 2,
"total_count": 2,
"financially_invalid_count": 0,
"alert_checked_count": 0,
"alert_checkable_count": 2,
"organization_currency": {
"currency_code": "NOK",
"total_amount_excluding_vat": "2400.00",
"total_amount_including_vat": "3000.00",
"alert_checked_amount": "0",
"alert_checkable_amount": "3000.00",
"alert_checked_amount_excluding_vat": "0",
"alert_checkable_amount_excluding_vat": "2400.00"
},
"currencies": [
{
"currency_code": "NOK",
"invoice_count": 1,
"alert_checked_count": 0,
"alert_checkable_count": 1,
"alert_checked_amount": "0",
"alert_checkable_amount": "125.00",
"alert_checked_amount_excluding_vat": "0",
"alert_checkable_amount_excluding_vat": "100.00",
"total_amount_excluding_vat": "100.00",
"total_amount_including_vat": "125.00"
},
{
"currency_code": "EUR",
"invoice_count": 1,
"alert_checked_count": 0,
"alert_checkable_count": 1,
"alert_checked_amount": "0",
"alert_checkable_amount": "250.00",
"alert_checked_amount_excluding_vat": "0",
"alert_checkable_amount_excluding_vat": "200.00",
"total_amount_excluding_vat": "200.00",
"total_amount_including_vat": "250.00"
}
]
}{
"error": {
"code": "validation_error",
"message": "The request is invalid. details lists up to 20 field errors. Request bodies are limited to 2 MiB.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "The bearer token is missing or invalid.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied. The error code says why: forbidden, token_disabled, organization_required, insufficient_role or mfa_required.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "One or more selected Views have invalid saved filter rules. Update the View filters before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "search_too_broad",
"message": "More than 1,000 invoices match search or invoice_number. Narrow the search or use other filters.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Wait for the Retry-After delay before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Temporarily unavailable. Retry after the Retry-After delay, when provided.",
"request_id": "req_example"
}
}Total invoice spend, overall or per supplier, recipient or month
Counts invoices and totals their amounts (spend) per currency and in the organization currency, using the same filters as listInvoices; filter by supplier_ids for one supplier’s spend. Totals are exact decimal strings and plain sums: an invoice without an amount adds nothing, and credit notes reduce spend. Use issued_from and issued_through to report a period. organization_currency converts amounts at each invoice’s date; an invoice without an exchange rate for that date adds nothing there, though the per-currency totals include it. Add group_by to also get spend per supplier, recipient or issue month, for example the top suppliers by spend over a period or one supplier’s spend per month (supplier_ids, group_by=month). Pass a group’s key to supplier_ids or recipient_ids to list its invoices; for a month key (YYYY-MM), set issued_from and issued_through to the first and last day of that month.
curl --request GET \
--url https://api.watchdog.no/v1/invoices/metrics \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/invoices/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/invoices/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"alert_scope": {
"type": "invoice",
"agreement_ids": null
},
"document_count": 2,
"total_count": 2,
"financially_invalid_count": 0,
"alert_checked_count": 0,
"alert_checkable_count": 2,
"organization_currency": {
"currency_code": "NOK",
"total_amount_excluding_vat": "2400.00",
"total_amount_including_vat": "3000.00",
"alert_checked_amount": "0",
"alert_checkable_amount": "3000.00",
"alert_checked_amount_excluding_vat": "0",
"alert_checkable_amount_excluding_vat": "2400.00"
},
"currencies": [
{
"currency_code": "NOK",
"invoice_count": 1,
"alert_checked_count": 0,
"alert_checkable_count": 1,
"alert_checked_amount": "0",
"alert_checkable_amount": "125.00",
"alert_checked_amount_excluding_vat": "0",
"alert_checkable_amount_excluding_vat": "100.00",
"total_amount_excluding_vat": "100.00",
"total_amount_including_vat": "125.00"
},
{
"currency_code": "EUR",
"invoice_count": 1,
"alert_checked_count": 0,
"alert_checkable_count": 1,
"alert_checked_amount": "0",
"alert_checkable_amount": "250.00",
"alert_checked_amount_excluding_vat": "0",
"alert_checkable_amount_excluding_vat": "200.00",
"total_amount_excluding_vat": "200.00",
"total_amount_including_vat": "250.00"
}
]
}{
"error": {
"code": "validation_error",
"message": "The request is invalid. details lists up to 20 field errors. Request bodies are limited to 2 MiB.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "The bearer token is missing or invalid.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied. The error code says why: forbidden, token_disabled, organization_required, insufficient_role or mfa_required.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "One or more selected Views have invalid saved filter rules. Update the View filters before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "search_too_broad",
"message": "More than 1,000 invoices match search or invoice_number. Narrow the search or use other filters.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Wait for the Retry-After delay before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Temporarily unavailable. Retry after the Retry-After delay, when provided.",
"request_id": "req_example"
}
}Authorizations
Headers
Query Parameters
Last send to the accounting system failed with any of these (transfer.failure.code).
unsupported_category, no_connection, connection_disabled, invoice_incomplete, not_coded, coding_from_other_connection, amounts_mismatch, company_mismatch, supplier_not_in_erp, supplier_link_unavailable, supplier_ambiguous, supplier_same_name, currency_unsupported, nothing_to_post, too_many_lines, dimension_unsupported, rounding_account_missing, sign_in_missing, sign_in_expired, sender_permission_missing, supplier_invoice_flow_off, duplicate_in_erp, ambiguous, changed_after_transfer, not_supplier_invoice, registered_differs, not_bookable, permission_missing, credentials_rejected, rejected, documents_rejected, documents_missing, reply_unreadable, provider_changed, unavailable, transfer_error Response
Invoice counts and totals by currency, and with group_by a page of groups.