List purchase order revisions
curl --request GET \
--url https://api.watchdog.no/v1/purchase-orders/{id}/revisions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/purchase-orders/{id}/revisions', 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/{id}/revisions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"revision": 123,
"recorded_at": "2023-11-07T05:31:56Z",
"actor": {
"type": "user",
"user_id": "<string>",
"api_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"terms": {
"number": "<string>",
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>",
"org_country": "<string>",
"vat_number": "<string>",
"vat_country": "<string>"
},
"buyer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>",
"org_country": "<string>",
"vat_number": "<string>",
"vat_country": "<string>"
},
"currency_code": "<string>",
"commitment_basis": "lines",
"amount_limit": "<string>",
"scope_description": "<string>",
"issued_date": "<string>",
"valid_from": "<string>",
"valid_until": "<string>",
"delivery_date": "<string>",
"delivery": {
"name": "<string>",
"address": {
"street": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country_code": "<string>"
}
},
"buyer_reference": "<string>",
"sales_order_reference": "<string>",
"contract_reference": "<string>",
"project_reference": "<string>",
"note_to_supplier": "<string>",
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_reference": "<string>",
"item": {
"name": "<string>",
"description": "<string>",
"product_code": "<string>",
"buyer_product_code": "<string>"
},
"quantity": "<string>",
"unit": "<string>",
"unit_price": "<string>",
"total_excluding_vat": "<string>",
"vat_rate": "<string>",
"kind": "item",
"status": "active",
"billed_amount": "<string>",
"invoice_summary": {
"invoices": 1,
"unit_price_min": "<string>",
"unit_price_max": "<string>",
"unit_price_difference": "<string>",
"price_difference_invoices": 1,
"grouped_invoice_lines": [
{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_number": 123,
"description": "<string>",
"purchase_order_line_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
},
"invoice_check": "clean",
"billed_quantity": "<string>",
"quantity_complete": true,
"billed_unit": "<string>",
"gross_unit_price": "<string>",
"agreement_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_line_id": "<string>",
"coding": {
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"usable": true,
"number": "<string>"
},
"vat_code": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"usable": true,
"code": "<string>",
"rate": "<string>"
},
"dimension_values": [
{
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_name": "<string>",
"dimension_kind": "department",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"usable": true,
"code": "<string>"
}
]
},
"received": {
"quantity": "<string>",
"unit": "<string>",
"last_received_on": "2023-12-25"
}
}
],
"totals": {
"lines_excluding_vat": "<string>",
"commitment": "<string>"
}
}
}
],
"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 order revisions
Lists the immutable commercial revisions of the order, newest first. Each holds the terms and lines as they were at that revision. Revisions cannot be edited.
List purchase order revisions
curl --request GET \
--url https://api.watchdog.no/v1/purchase-orders/{id}/revisions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/purchase-orders/{id}/revisions', 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/{id}/revisions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"revision": 123,
"recorded_at": "2023-11-07T05:31:56Z",
"actor": {
"type": "user",
"user_id": "<string>",
"api_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"terms": {
"number": "<string>",
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>",
"org_country": "<string>",
"vat_number": "<string>",
"vat_country": "<string>"
},
"buyer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>",
"org_country": "<string>",
"vat_number": "<string>",
"vat_country": "<string>"
},
"currency_code": "<string>",
"commitment_basis": "lines",
"amount_limit": "<string>",
"scope_description": "<string>",
"issued_date": "<string>",
"valid_from": "<string>",
"valid_until": "<string>",
"delivery_date": "<string>",
"delivery": {
"name": "<string>",
"address": {
"street": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country_code": "<string>"
}
},
"buyer_reference": "<string>",
"sales_order_reference": "<string>",
"contract_reference": "<string>",
"project_reference": "<string>",
"note_to_supplier": "<string>",
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_reference": "<string>",
"item": {
"name": "<string>",
"description": "<string>",
"product_code": "<string>",
"buyer_product_code": "<string>"
},
"quantity": "<string>",
"unit": "<string>",
"unit_price": "<string>",
"total_excluding_vat": "<string>",
"vat_rate": "<string>",
"kind": "item",
"status": "active",
"billed_amount": "<string>",
"invoice_summary": {
"invoices": 1,
"unit_price_min": "<string>",
"unit_price_max": "<string>",
"unit_price_difference": "<string>",
"price_difference_invoices": 1,
"grouped_invoice_lines": [
{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_number": 123,
"description": "<string>",
"purchase_order_line_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
},
"invoice_check": "clean",
"billed_quantity": "<string>",
"quantity_complete": true,
"billed_unit": "<string>",
"gross_unit_price": "<string>",
"agreement_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_line_id": "<string>",
"coding": {
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"usable": true,
"number": "<string>"
},
"vat_code": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"usable": true,
"code": "<string>",
"rate": "<string>"
},
"dimension_values": [
{
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_name": "<string>",
"dimension_kind": "department",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"usable": true,
"code": "<string>"
}
]
},
"received": {
"quantity": "<string>",
"unit": "<string>",
"last_received_on": "2023-12-25"
}
}
],
"totals": {
"lines_excluding_vat": "<string>",
"commitment": "<string>"
}
}
}
],
"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"
}
}