Update the approval policy
curl --request PATCH \
--url https://api.watchdog.no/v1/approval-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auto_approve_enabled": true,
"settings": {
"max_amount": "<string>",
"required_approvals": 25,
"single_rule": true,
"same_as_always": {
"enabled": true,
"amount_tolerance_pct": 50,
"history_count": 6
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auto_approve_enabled: true,
settings: {
max_amount: '<string>',
required_approvals: 25,
single_rule: true,
same_as_always: {enabled: true, amount_tolerance_pct: 50, history_count: 6}
}
})
};
fetch('https://api.watchdog.no/v1/approval-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/approval-policy"
payload = {
"auto_approve_enabled": True,
"settings": {
"max_amount": "<string>",
"required_approvals": 25,
"single_rule": True,
"same_as_always": {
"enabled": True,
"amount_tolerance_pct": 50,
"history_count": 6
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"auto_approve_enabled": true,
"settings": {
"max_amount": "<string>",
"required_approvals": 25,
"single_rule": true,
"same_as_always": {
"enabled": true,
"amount_tolerance_pct": 50,
"history_count": 6
}
},
"conditions": [
{
"key": "<string>",
"kind": "trust",
"locked": true
}
],
"updated_at": "2023-11-07T05:31:56Z"
}{
"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"
}
}Approval policy
Update the approval policy
Saves the given parts of the approval policy; omitted fields are unchanged. Applies to invoices evaluated from then on. A changed settings.required_approvals also approves pending invoices that already have that many approvals. Every invoice is evaluated once its checks and coding have settled, and the result is shown on the invoice as approval_evaluation. The trust conditions always apply; the amount limit is set in settings. With automatic rejection on, an invoice read with confidence whose payment terms are too short is rejected by Watchdog. With automatic approval on, a trusted invoice that is the same as the supplier’s last invoices is approved by Watchdog. Rejection runs first.
Update the approval policy
curl --request PATCH \
--url https://api.watchdog.no/v1/approval-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auto_approve_enabled": true,
"settings": {
"max_amount": "<string>",
"required_approvals": 25,
"single_rule": true,
"same_as_always": {
"enabled": true,
"amount_tolerance_pct": 50,
"history_count": 6
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auto_approve_enabled: true,
settings: {
max_amount: '<string>',
required_approvals: 25,
single_rule: true,
same_as_always: {enabled: true, amount_tolerance_pct: 50, history_count: 6}
}
})
};
fetch('https://api.watchdog.no/v1/approval-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/approval-policy"
payload = {
"auto_approve_enabled": True,
"settings": {
"max_amount": "<string>",
"required_approvals": 25,
"single_rule": True,
"same_as_always": {
"enabled": True,
"amount_tolerance_pct": 50,
"history_count": 6
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"auto_approve_enabled": true,
"settings": {
"max_amount": "<string>",
"required_approvals": 25,
"single_rule": true,
"same_as_always": {
"enabled": true,
"amount_tolerance_pct": 50,
"history_count": 6
}
},
"conditions": [
{
"key": "<string>",
"kind": "trust",
"locked": true
}
],
"updated_at": "2023-11-07T05:31:56Z"
}{
"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
Body
application/json
Response
The saved policy.