curl --request GET \
--url https://api.watchdog.no/v1/overview/ap-flow \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/overview/ap-flow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/overview/ap-flow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"computed_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"organization_currency": "<string>",
"period": "7d",
"from": "<string>",
"through": "<string>",
"previous_from": "<string>",
"previous_through": "<string>",
"bucket_days": 123,
"headline": {
"untouched_until_approval": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
},
"no_touch": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
},
"decision_time": {
"current": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"previous": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"median_change_seconds": 123
},
"received": {
"current": 1,
"previous": 1,
"change": 123
},
"paid_on_time": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"funnel": [
{
"stage": "intake",
"passed": {
"count": 1,
"of": 1,
"share": 0.5
},
"remaining": {
"count": 1,
"of": 1,
"share": 0.5
},
"first_touched": {
"count": 1,
"of": 1,
"share": 0.5
},
"top_touch": {
"key": "<string>",
"label": "<string>",
"invoices": 1
}
}
],
"top_first_touch_stage": "intake",
"stages": {
"intake": {
"channels": [
{
"channel": "upload",
"received": {
"count": 1,
"of": 1,
"share": 0.5
}
}
],
"stopped": [
{
"outcome": "duplicate",
"documents": 1
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
},
"touches": [
{
"key": "<string>",
"label": "<string>",
"invoices": 1
}
]
},
"reading": {
"graded": {
"snapshot": 1,
"log": 1
},
"lines": {
"changed": 1,
"added": 1,
"removed": 1
},
"fields": [
{
"field": "<string>",
"part": "header",
"invoices": 1,
"per_thousand": 123
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"match": {
"party_changed": 1,
"recorded": 1,
"links": [
{
"kind": "agreement",
"proposed": 1,
"removed": 1,
"added": 1,
"kept": {
"count": 1,
"of": 1,
"share": 0.5
}
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"checks": {
"types": [
{
"check_type": "agreement",
"raised": 1,
"pending": 1,
"accepted": 1,
"dismissed": 1,
"skipped": 1,
"confirmed": {
"count": 1,
"of": 1,
"share": 0.5
},
"accepted_amount": "<string>",
"dismissed_as": [
{
"category": "misread",
"alerts": 1
}
]
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"coding": {
"fields": [
{
"field": "account",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"suggested": 1,
"confirmed": 1,
"changed": 1,
"manual": 1,
"kept": {
"count": 1,
"of": 1,
"share": 0.5
}
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"validation": {
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"approval": {
"approved": 1,
"rejected": 1,
"decided_by": {
"person": 1,
"not_recorded": 1
},
"wait": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"approvers": {
"added_by_rule": 1,
"added_by_hand": 1,
"removed_by_hand": 1
},
"held": 1,
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"transfer": {
"approved": 1,
"outcomes": {
"sent": {
"count": 1,
"of": 1,
"share": 0.5
},
"in_accounting_system": {
"count": 1,
"of": 1,
"share": 0.5
},
"not_sent": {
"count": 1,
"of": 1,
"share": 0.5
}
},
"retried": 1,
"failures": [
{
"code": "<string>",
"invoices": 1
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
}
},
"trend": [
{
"from": "<string>",
"through": "<string>",
"received": 1,
"untouched_until_approval": {
"count": 1,
"of": 1,
"share": 0.5
},
"no_touch": {
"count": 1,
"of": 1,
"share": 0.5
},
"decision_time": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"paid_on_time": {
"count": 1,
"of": 1,
"share": 0.5
},
"passed": {
"intake": {
"count": 1,
"of": 1,
"share": 0.5
},
"reading": {
"count": 1,
"of": 1,
"share": 0.5
},
"match": {
"count": 1,
"of": 1,
"share": 0.5
},
"checks": {
"count": 1,
"of": 1,
"share": 0.5
},
"coding": {
"count": 1,
"of": 1,
"share": 0.5
},
"validation": {
"count": 1,
"of": 1,
"share": 0.5
},
"approval": {
"count": 1,
"of": 1,
"share": 0.5
},
"transfer": {
"count": 1,
"of": 1,
"share": 0.5
}
},
"remaining": {
"intake": {
"count": 1,
"of": 1,
"share": 0.5
},
"reading": {
"count": 1,
"of": 1,
"share": 0.5
},
"match": {
"count": 1,
"of": 1,
"share": 0.5
},
"checks": {
"count": 1,
"of": 1,
"share": 0.5
},
"coding": {
"count": 1,
"of": 1,
"share": 0.5
},
"validation": {
"count": 1,
"of": 1,
"share": 0.5
},
"approval": {
"count": 1,
"of": 1,
"share": 0.5
},
"transfer": {
"count": 1,
"of": 1,
"share": 0.5
}
}
}
]
}{
"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": "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"
}
}Get the AP flow statistics
How the organization’s invoices moved through the eight stages of the accounts payable flow, in order: intake, reading, match, checks, coding, validation, approval and transfer to the accounting system. Each figure covers the period and, where it has previous, the period of the same length right before it. Rebuilt every night (computed_at); each period ends on the last whole day before that. A stage is touched when a person changed or overrode something in it before the decision (comments, the approval click and the send are not touches); a stage that cannot be measured for an invoice counts as neither. Rates, the funnel, times and stage figures count invoices decided (approved or rejected) in the period; received and intake.channels count invoices received in it, intake.stopped documents that arrived in it. Every share is : share is count / of, and null when of is 0, which means not measured; change is current.share − previous.share. untouched_until_approval: decided invoices no stage before approval touched. no_touch: decided invoices untouched in every measured stage, approval included. Durations are in seconds. Every figure counts whole invoices, so a caller whose access is limited by supplier, recipient or the invoices they approve gets 403 forbidden, as do organizations without accounts payable. A member with access to some companies sees those companies’ invoices.
curl --request GET \
--url https://api.watchdog.no/v1/overview/ap-flow \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/overview/ap-flow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/overview/ap-flow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"computed_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"organization_currency": "<string>",
"period": "7d",
"from": "<string>",
"through": "<string>",
"previous_from": "<string>",
"previous_through": "<string>",
"bucket_days": 123,
"headline": {
"untouched_until_approval": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
},
"no_touch": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
},
"decision_time": {
"current": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"previous": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"median_change_seconds": 123
},
"received": {
"current": 1,
"previous": 1,
"change": 123
},
"paid_on_time": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"funnel": [
{
"stage": "intake",
"passed": {
"count": 1,
"of": 1,
"share": 0.5
},
"remaining": {
"count": 1,
"of": 1,
"share": 0.5
},
"first_touched": {
"count": 1,
"of": 1,
"share": 0.5
},
"top_touch": {
"key": "<string>",
"label": "<string>",
"invoices": 1
}
}
],
"top_first_touch_stage": "intake",
"stages": {
"intake": {
"channels": [
{
"channel": "upload",
"received": {
"count": 1,
"of": 1,
"share": 0.5
}
}
],
"stopped": [
{
"outcome": "duplicate",
"documents": 1
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
},
"touches": [
{
"key": "<string>",
"label": "<string>",
"invoices": 1
}
]
},
"reading": {
"graded": {
"snapshot": 1,
"log": 1
},
"lines": {
"changed": 1,
"added": 1,
"removed": 1
},
"fields": [
{
"field": "<string>",
"part": "header",
"invoices": 1,
"per_thousand": 123
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"match": {
"party_changed": 1,
"recorded": 1,
"links": [
{
"kind": "agreement",
"proposed": 1,
"removed": 1,
"added": 1,
"kept": {
"count": 1,
"of": 1,
"share": 0.5
}
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"checks": {
"types": [
{
"check_type": "agreement",
"raised": 1,
"pending": 1,
"accepted": 1,
"dismissed": 1,
"skipped": 1,
"confirmed": {
"count": 1,
"of": 1,
"share": 0.5
},
"accepted_amount": "<string>",
"dismissed_as": [
{
"category": "misread",
"alerts": 1
}
]
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"coding": {
"fields": [
{
"field": "account",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"suggested": 1,
"confirmed": 1,
"changed": 1,
"manual": 1,
"kept": {
"count": 1,
"of": 1,
"share": 0.5
}
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"validation": {
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"approval": {
"approved": 1,
"rejected": 1,
"decided_by": {
"person": 1,
"not_recorded": 1
},
"wait": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"approvers": {
"added_by_rule": 1,
"added_by_hand": 1,
"removed_by_hand": 1
},
"held": 1,
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
},
"transfer": {
"approved": 1,
"outcomes": {
"sent": {
"count": 1,
"of": 1,
"share": 0.5
},
"in_accounting_system": {
"count": 1,
"of": 1,
"share": 0.5
},
"not_sent": {
"count": 1,
"of": 1,
"share": 0.5
}
},
"retried": 1,
"failures": [
{
"code": "<string>",
"invoices": 1
}
],
"passed": {
"current": {
"count": 1,
"of": 1,
"share": 0.5
},
"previous": {
"count": 1,
"of": 1,
"share": 0.5
},
"change": 0
}
}
},
"trend": [
{
"from": "<string>",
"through": "<string>",
"received": 1,
"untouched_until_approval": {
"count": 1,
"of": 1,
"share": 0.5
},
"no_touch": {
"count": 1,
"of": 1,
"share": 0.5
},
"decision_time": {
"median_seconds": 123,
"p90_seconds": 123,
"invoices": 1
},
"paid_on_time": {
"count": 1,
"of": 1,
"share": 0.5
},
"passed": {
"intake": {
"count": 1,
"of": 1,
"share": 0.5
},
"reading": {
"count": 1,
"of": 1,
"share": 0.5
},
"match": {
"count": 1,
"of": 1,
"share": 0.5
},
"checks": {
"count": 1,
"of": 1,
"share": 0.5
},
"coding": {
"count": 1,
"of": 1,
"share": 0.5
},
"validation": {
"count": 1,
"of": 1,
"share": 0.5
},
"approval": {
"count": 1,
"of": 1,
"share": 0.5
},
"transfer": {
"count": 1,
"of": 1,
"share": 0.5
}
},
"remaining": {
"intake": {
"count": 1,
"of": 1,
"share": 0.5
},
"reading": {
"count": 1,
"of": 1,
"share": 0.5
},
"match": {
"count": 1,
"of": 1,
"share": 0.5
},
"checks": {
"count": 1,
"of": 1,
"share": 0.5
},
"coding": {
"count": 1,
"of": 1,
"share": 0.5
},
"validation": {
"count": 1,
"of": 1,
"share": 0.5
},
"approval": {
"count": 1,
"of": 1,
"share": 0.5
},
"transfer": {
"count": 1,
"of": 1,
"share": 0.5
}
}
}
]
}{
"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": "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
Only the invoices of these workspace companies. intake.stopped stays the whole workspace’s: a stopped document never became an invoice, so it has no company. Omit for every company the caller can access. An unknown or inaccessible company is 404.
1 - 1000 elementsResponse
How the invoices moved through the AP flow in the period.
The stage before approval where the most decided invoices got their first touch, the earliest on a tie; null when no stage before approval touched one. Approval is left out: a person decides every invoice until the approval policy decides some.
intake, reading, match, checks, coding, validation, null