List purchase orders
curl --request GET \
--url https://api.watchdog.no/v1/purchase-orders \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/purchase-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/purchase-orders"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"title": "<string>",
"status": "draft",
"awaiting_approval": true,
"approvers": [
{
"user_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
}
],
"archived": true,
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>"
},
"buyer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>"
},
"owner_user_id": "<string>",
"agreement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"origin": "manual",
"restricted": true
},
"currency_code": "<string>",
"commitment_basis": "lines",
"totals": {
"lines_excluding_vat": "<string>",
"commitment": "<string>",
"expected": "<string>"
},
"billing": {
"linked_invoices": 1,
"billed": "<string>",
"remaining": "<string>",
"excess": "<string>",
"authoritative": true,
"coverage": {
"pending_suggestions": 1,
"unsupported_credits": 1,
"incompatible_invoices": 1,
"invalid_invoices": 1,
"unassigned_invoices": 1,
"reconciliation_pending": true
},
"untied": {
"lines": 1,
"amount": "<string>"
}
},
"revision": 123,
"open_alert_count": 1,
"valid_until": "<string>",
"origin": "native",
"source": {
"system": "<string>",
"id": "<string>",
"number": "<string>",
"channel": "integration",
"status": "<string>",
"refreshed_at": "2023-11-07T05:31:56Z",
"synced_revision": 123,
"pending": true
},
"from_import": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<string>"
}{
"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": "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"
}
}Purchase orders
List purchase orders
Lists purchase orders, standalone or linked to an agreement. Archived orders are left out unless archived=true. Totals exclude VAT.
List purchase orders
curl --request GET \
--url https://api.watchdog.no/v1/purchase-orders \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/purchase-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/purchase-orders"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"title": "<string>",
"status": "draft",
"awaiting_approval": true,
"approvers": [
{
"user_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
}
],
"archived": true,
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>"
},
"buyer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>"
},
"owner_user_id": "<string>",
"agreement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"origin": "manual",
"restricted": true
},
"currency_code": "<string>",
"commitment_basis": "lines",
"totals": {
"lines_excluding_vat": "<string>",
"commitment": "<string>",
"expected": "<string>"
},
"billing": {
"linked_invoices": 1,
"billed": "<string>",
"remaining": "<string>",
"excess": "<string>",
"authoritative": true,
"coverage": {
"pending_suggestions": 1,
"unsupported_credits": 1,
"incompatible_invoices": 1,
"invalid_invoices": 1,
"unassigned_invoices": 1,
"reconciliation_pending": true
},
"untied": {
"lines": 1,
"amount": "<string>"
}
},
"revision": 123,
"open_alert_count": 1,
"valid_until": "<string>",
"origin": "native",
"source": {
"system": "<string>",
"id": "<string>",
"number": "<string>",
"channel": "integration",
"status": "<string>",
"refreshed_at": "2023-11-07T05:31:56Z",
"synced_revision": 123,
"pending": true
},
"from_import": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<string>"
}{
"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": "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
Return only these fields of each row; use dots for nested fields, such as approvers.user_id. id is always returned. Fields: company_id, id, number, title, status, awaiting_approval, approvers, archived, supplier, buyer, owner_user_id, agreement, currency_code, commitment_basis, totals, billing, revision, open_alert_count, valid_until, origin, source, from_import, created_at, updated_at.
company sorts by company name; checks by open_alert_count; billed by billing.billed over totals.commitment. Drafts sort last by checks and billed, as do orders without an accepted invoice or a commitment by billed.
Available options:
created_at, updated_at, number, supplier, buyer, company, status, commitment, checks, billed