Import an original included in a letter PDF
curl --request POST \
--url https://api.watchdog.no/v1/invoices/{id}/letter-claims/{claim_id}/import-original \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_updated_at": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_updated_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.watchdog.no/v1/invoices/{id}/letter-claims/{claim_id}/import-original', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/invoices/{id}/letter-claims/{claim_id}/import-original"
payload = { "expected_updated_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "validation_error",
"message": "The page range is invalid, or the letter's company is not chosen.",
"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, or invoice_processing_capacity_exhausted: the organization has no invoice processing capacity left. Nothing was imported.",
"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 letter changed, or the claim already has an original.",
"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 import could not start.",
"request_id": "req_example"
}
}Invoices
Import an original included in a letter PDF
Imports a page range of the letter’s PDF as the caller’s own invoice, through ordinary intake and duplicate rules, like uploading those pages: each request is a new import, and each uses invoice processing capacity. Its arrival links the letter. Omit pages to use the pages the letter’s reading found. Where the letter’s company has one Tripletex connection and its creditor can be looked up, Tripletex is asked first, and an original it holds is not imported from the pages: the claim’s accounting_lookup says what it found. The letter and its PDF remain unchanged.
Import an original included in a letter PDF
curl --request POST \
--url https://api.watchdog.no/v1/invoices/{id}/letter-claims/{claim_id}/import-original \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_updated_at": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_updated_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.watchdog.no/v1/invoices/{id}/letter-claims/{claim_id}/import-original', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/invoices/{id}/letter-claims/{claim_id}/import-original"
payload = { "expected_updated_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "validation_error",
"message": "The page range is invalid, or the letter's company is not chosen.",
"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, or invoice_processing_capacity_exhausted: the organization has no invoice processing capacity left. Nothing was imported.",
"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 letter changed, or the claim already has an original.",
"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 import could not start.",
"request_id": "req_example"
}
}Authorizations
Headers
Response
The import runs; its invoice links the letter when it arrives.