curl --request POST \
--url https://api.watchdog.no/v1/purchase-orders/{id}/pushes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({integration_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.watchdog.no/v1/purchase-orders/{id}/pushes', 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}/pushes"
payload = { "integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"workflow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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": "The accounting system already holds the current revision, the order is in another accounting system, the connection writes for another company than the order's, or the connection is disabled or needs attention.",
"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": "The push could not be confirmed as started. Follow Location to check the workflow run before retrying.",
"request_id": "req_example"
}
}Push a purchase order to an accounting system
Creates an open order made in Watchdog, with its lines, in the connection’s accounting system (Tripletex), or brings the order it already holds up to the current revision: delivery date, delivery address and lines, which are added, changed or deleted to match. The order stays Watchdog’s and is edited here. Before it writes anything, a push reconciles with what the accounting system already holds, so retrying after a failure never creates a second order or duplicate lines. Lines carry their name, quantity and net unit price; units, product codes and VAT are not sent. If someone changed or deleted the order in the accounting system since the last push, the push stops (changed_in_erp, deleted_in_erp) until it is sent again with overwrite. Imported orders, blanket orders and orders without a delivery date return 400; an order whose current revision the accounting system already holds returns 409. A request while a push is running joins it.
curl --request POST \
--url https://api.watchdog.no/v1/purchase-orders/{id}/pushes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({integration_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.watchdog.no/v1/purchase-orders/{id}/pushes', 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}/pushes"
payload = { "integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"workflow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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": "The accounting system already holds the current revision, the order is in another accounting system, the connection writes for another company than the order's, or the connection is disabled or needs attention.",
"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": "The push could not be confirmed as started. Follow Location to check the workflow run before retrying.",
"request_id": "req_example"
}
}