TaxHelper Business API
This page introduces the TaxHelper Business API, which enables developers to integrate VAT analysis directly into their own solutions. In your developer account you will find more detailed documentation and can make API calls based on your own accounting data - if you use e-conomic. Please note that the TaxHelper Business API is not limited to e-conomic; you can use the API with other systems as long as your data follows the documentation listed below.
Introduction
All endpoints return a standard JSON object, for example:
{
"note": "Køb af kontorartikler, print, tryksager og elektronik har næsten altid moms på",
"rating": 0.95,
"vat_code": "DK-VAT"
}
| Parameter |
Type |
Mandatory |
Description |
| note | String? | true | An explanation of the conclusion of the analysis. |
| rating | number? | true | Between 0 and 1. The higher the rating, the more certain the conclusion. |
| vat_code | String? | true | VAT code. See explanation of VAT codes below. |
| Mom code |
Explanation |
| DK-VAT | Danish VAT. |
| EU-VAT-GOODS | EU VAT for goods. |
| EU-VAT-SERVICES | EU VAT for services. |
| OTHER-VAT-GOODS | VAT on goods from third countries. |
| OTHER-VAT-SERVICES | VAT on services from third countries. |
| NONE | There is no VAT on the entry. |
| zero | The analysis could not identify a VAT code. |
Please note that 'NONE' means that the analysis indicates that there should not be a VAT code specified on the entry. On the other hand, 'null' means that the analysis could not make a conclusion.
Header
Create Bearer Token in your TaxHelper Business account and then add these headers to your POST requests.
| Header |
Value |
Description |
| Authorization | Bearer XXXXXXX | Replace XXXXXXX with the Bearer Token from your account. |
| Content-Type | application/json | Always include this. |
VAT analysis of entry (/vat/entry)
Use this endpoint to analyze the VAT on an entry that does NOT have an attachment attached (e.g. invoice, receipt).
POST /api/prediction/vat/entry
| Parameter |
Type |
Mandatory |
Description |
| text | String | true | Description of the posting. |
| account_name | String? | false | Account name of the primary account for the posting. |
| contra_account_name | String? | false | Account name of the contra account for the posting. |
| contra_account_is_primary | boolean | true | Must be 'true' if the contra account is to be considered the primary account in the analysis. |
| has_yellow_plate_cars | boolean | true | Must be 'true' if the company has yellow plate cars. Set to 'false' as default. |
| is_restaurant | boolean | true | Must be 'true' if the business operates a restaurant. Set to 'false' as default. |
Example of Body:
{
"text": "Køb fra elgiganten",
"account_name": "3617 - Mindre anskaffelser",
"contra_account_name": "5820 - Danske Bank",
"contra_account_is_primary": false,
"has_yellow_plate_cars": false,
"is_restaurant": false,
}
The cURL will look like this, where you replace the Bearer Token with your own token:
curl -X POST https://business.taxhelper.dk/api/prediction/vat/entry -H 'Authorization: Bearer XXXXXXX' -H 'Content-Type: application/json' -d '{"text":"Køb fra elgiganten","account_name":"3617 - Mindre anskaffelser","contra_account_name":"5820 - Danske Bank","contra_account_is_primary":false,"has_yellow_plate_cars":false,"is_restaurant":false,"file":null}'
Returned from endpoint:
{
"note": "Køb af kontorartikler, print, tryksager og elektronik har næsten altid moms på",
"rating": 0.95,
"vat_code": "DK-VAT"
}
HTTP codes
| Code |
Description |
| 200 | JSON is returned |
| 400 | Data is invalid. POST request body must contain 'text', 'contra_account_is_primary', 'has_yellow_plate_cars' and 'is_restaurant'. |
| 400 | Data is invalid. Request body is missing. |
| 401 | Mangler Bearer token i header. {Authorization: 'Bearer XXXXXXXX'}. |
| 403 | Token does not match your developer account token. |
| 405 | Request method not allowed. Must be POST. |
VAT analysis of entry and vouchers (/vat)
Use this endpoint to analyze the VAT when you have both the posting data and the attached voucher/document. This endpoint gives the most complete result, as we analyze both the entry and its attachment.
POST /api/prediction/vat
| Parameter |
Type |
Mandatory |
Description |
| text | String | true | Description of the posting. |
| account_name | String? | false | Account name of the primary account for the posting. |
| contra_account_name | String? | false | Account name of the contra account for the posting. |
| contra_account_is_primary | boolean | true | Must be 'true' if the contra account is to be considered the primary account in the analysis. |
| has_yellow_plate_cars | boolean | true | Must be 'true' if the company has yellow plate cars. Set to 'false' as default. |
| is_restaurant | boolean | true | Must be 'true' if the business operates a restaurant. Set to 'false' as default. |
| file | String | true | The file is represented in a base64 text format. |
Example of Body:
{
"text": "Køb fra elgiganten",
"account_name": "3617 - Mindre anskaffelser",
"contra_account_name": "5820 - Danske Bank",
"contra_account_is_primary": false,
"has_yellow_plate_cars": false,
"is_restaurant": false,
"file": "JVBERi0yLjAKJeTjz9IKNiAwIG9iag..."
}
The cURL will look like this, where you replace the Bearer Token with your own token:
curl -X POST https://business.taxhelper.dk/api/prediction/vat/entry -H 'Authorization: Bearer XXXXXXX' -H 'Content-Type: application/json' -d '{"text":"Køb fra elgiganten","account_name":"3617 - Mindre anskaffelser","contra_account_name":"5820 - Danske Bank","contra_account_is_primary":false,"has_yellow_plate_cars":false,"is_restaurant":false,"file": "JVBERi0yLjAKJeTjz9IKNiAwIG9iag..."}'
Returned from endpoint:
{
"note": "Køb af kontorartikler, print, tryksager og elektronik har næsten altid moms på",
"rating": 0.95,
"vat_code": "DK-VAT"
}
HTTP codes
| Code |
Description |
| 200 | JSON is returned |
| 400 | Data is invalid. POST request body must contain 'text', 'contra_account_is_primary', 'has_yellow_plate_cars', 'is_restaurant' and 'file'. |
| 400 | Data is invalid. Request body is missing. |
| 401 | Mangler Bearer token i header. {Authorization: 'Bearer XXXXXXXX'}. |
| 403 | Token does not match your developer account token. |
| 405 | Request method not allowed. Must be POST. |
Contact us
If you have any questions regarding the API, you are welcome to contact us at dg@taxhelper.dk.