Dansk
English

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
noteString?trueAn explanation of the conclusion of the analysis.
ratingnumber?trueBetween 0 and 1. The higher the rating, the more certain the conclusion.
vat_codeString?trueVAT code. See explanation of VAT codes below.
Mom code Explanation
DK-VATDanish VAT.
EU-VAT-GOODSEU VAT for goods.
EU-VAT-SERVICESEU VAT for services.
OTHER-VAT-GOODSVAT on goods from third countries.
OTHER-VAT-SERVICESVAT on services from third countries.
NONEThere is no VAT on the entry.
zeroThe 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
AuthorizationBearer XXXXXXXReplace XXXXXXX with the Bearer Token from your account.
Content-Typeapplication/jsonAlways 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
textStringtrueDescription of the posting.
account_nameString?falseAccount name of the primary account for the posting.
contra_account_nameString?falseAccount name of the contra account for the posting.
contra_account_is_primarybooleantrueMust be 'true' if the contra account is to be considered the primary account in the analysis.
has_yellow_plate_carsbooleantrueMust be 'true' if the company has yellow plate cars. Set to 'false' as default.
is_restaurantbooleantrueMust 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
200JSON is returned
400Data is invalid. POST request body must contain 'text', 'contra_account_is_primary', 'has_yellow_plate_cars' and 'is_restaurant'.
400Data is invalid. Request body is missing.
401Mangler Bearer token i header. {Authorization: 'Bearer XXXXXXXX'}.
403Token does not match your developer account token.
405Request 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
textStringtrueDescription of the posting.
account_nameString?falseAccount name of the primary account for the posting.
contra_account_nameString?falseAccount name of the contra account for the posting.
contra_account_is_primarybooleantrueMust be 'true' if the contra account is to be considered the primary account in the analysis.
has_yellow_plate_carsbooleantrueMust be 'true' if the company has yellow plate cars. Set to 'false' as default.
is_restaurantbooleantrueMust be 'true' if the business operates a restaurant. Set to 'false' as default.
fileStringtrueThe 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
200JSON is returned
400Data is invalid. POST request body must contain 'text', 'contra_account_is_primary', 'has_yellow_plate_cars', 'is_restaurant' and 'file'.
400Data is invalid. Request body is missing.
401Mangler Bearer token i header. {Authorization: 'Bearer XXXXXXXX'}.
403Token does not match your developer account token.
405Request 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.