Count active invoices in each lifecycle phase and status
curl --request GET \
--url https://api.watchdog.no/v1/invoices/lifecycle-counts \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/invoices/lifecycle-counts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/invoices/lifecycle-counts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"active": 9,
"inbox": 3,
"approval": 4,
"payment": 2,
"statuses": {
"reading": 0,
"missing_info": 1,
"ready_for_approval": 2,
"no_new_charges": 0,
"sent_back": 0,
"awaiting_approval": 3,
"on_hold": 1,
"not_ready_to_send": 0,
"ready_to_send": 1,
"send_failed": 0,
"rejected_in_accounting": 0,
"sent": 0,
"awaiting_payment": 1
}
}{
"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"
}
}Invoices
Count active invoices in each lifecycle phase and status
Counts the invoices in Inbox, Approval and Payment (lifecycle.phase), and each active lifecycle.status, under the same filters and access as listInvoices, ignoring phase and lifecycle_statuses so every phase is counted. Done invoices are not counted. Calculates no monetary totals. Searches matching more than 1,000 invoices must be narrowed.
Count active invoices in each lifecycle phase and status
curl --request GET \
--url https://api.watchdog.no/v1/invoices/lifecycle-counts \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/invoices/lifecycle-counts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/invoices/lifecycle-counts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"active": 9,
"inbox": 3,
"approval": 4,
"payment": 2,
"statuses": {
"reading": 0,
"missing_info": 1,
"ready_for_approval": 2,
"no_new_charges": 0,
"sent_back": 0,
"awaiting_approval": 3,
"on_hold": 1,
"not_ready_to_send": 0,
"ready_to_send": 1,
"send_failed": 0,
"rejected_in_accounting": 0,
"sent": 0,
"awaiting_payment": 1
}
}{
"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).
Available options:
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
Exact counts for each active phase and status, and all active invoices.