POST /NP
Returns the tax calculation for Natural persons. Returns a string describing the failure condition when unsuccessful.
Sending an empty request will return an HTTP 415 error (Unsupported Media Type). Failure to provide any of the required parameters will result in an HTTP 400 error (Bad Request).
Resource URL
https://api.drtax.ch/TaxCalculator/NP
Resource Information
-
Response formats
JSON
-
Requires authentication?
Yes (
HMAC-SHA256based authentication) -
Rate limited?
Yes
Parameters
-
key Required
API key which was given to you after registering for access to the Tax calculator API.
-
language Optional
Language in which the descriptions of tax calculation are returned. If not provided, the default language is set to English.Example Values:
de, fr, it, en -
basic-data Required
Contains basic data for a tax calculation. Either both
cantonandmunicipality-of-taxation, or either fromzipanddomicilemust be provided in order for a request to succeed.-
tax-year Optional
Tax year for which the request is issued. If not provided, a year preeceding the current calendar year will be used.Example Value:
2014 -
marital-status Required
Marital status of the taxable person. This value corresponds to an index in a list returned by the /MaritalStatusList service.Example Values:
0-8 -
canton Semi-optional
Canton of Switzerland to which a taxable person's domicile belongs to. This value corresponds to an index in a list returned by the /CantonList service.Example Values:
0-25 -
municipality-of-taxation Semi-optional
Municipality of taxation.Example Value:
Zug -
zip Semi-optional
Postal code of the taxable person's residence.Example Value:
6300 -
domicile Semi-optional
Place name of the taxable person's residence.Example Value:
Zug -
religious-affiliation Semi-optional
Taxable person's religious affiliation, if taxable person has any. This value corresponds to an index in a list returned by the /ReligiousAffiliationList service.Example Values:
0-4 -
partner-religious-affiliation Semi-optional
If taxable person has a partner, this parameter represents the partner's religious affiliation, if partner any. This value corresponds to an index in a list returned by the /ReligiousAffiliationList service.Example Values:
0-4 -
church-community Semi-optional
If taxable person's domicile belongs to canton Appenzell Innerrhoden, this parameter represents the taxable person's church community, and it has to be one of the values in the list returned by the /ChurchCommunityList service.Example Value:
Kath. Appenzell -
partner-church-community Semi-optional
If taxable person has a partner, and its domicile belongs to canton Appenzell Innerrhoden, this parameter represents the partner's church community, and it has to be one of the values in the list returned by the /ChurchCommunityList service.Example Value:
Kath. Gonten -
childrenOptional
How many children does the taxable person have. Value can be integer or non-integer. If not provided, the default value is
0. Example Value: 1.5 -
concubinageOptional
If relationship with partner involve concubinage then value should be set to 'true'. By default value is assumed to be false. This is important parameter for the Canton VD.
-
tax-liability-fromOptional
Start of the taxation period. This value has to be in the following format:
YYYY-MM-DD. If not provided, the default value is the first day of the tax year.Example Value:2014-01-01 -
tax-liability-tillOptional
End of the taxation period. This value has to be in the following format:
YYYY-MM-DD. If not provided, the default value is the last day of the tax year.Example Values:2014-12-31
-
-
fiscal factors Required
Contains fiscal factors for the tax calculation.
-
taxable-amounts Required
Contains amounts that are a subject for taxation.
-
cantonal-incomeRequired
Cantonal income.Example Value:
1588422.20 -
cantonal-wealthRequired
Cantonal wealth.Example Value:
537264.51 -
confederation-incomeOptional
Confederation income.Example Value:
4926153.14
-
-
qualified-participation Optional
Contains qualified participation parameters.
-
private-assetsSemi-optional
Contains private assets parameters.
-
cantonal-incomeSemi-optional
Cantonal income.Example Value:
482716.18 -
cantonal-wealthSemi-optional
Cantonal wealth.Example Value:
537684.86 -
confederation-incomeSemi-optional
Confederation income.Example Value:
583725.40
-
-
commercial-assetsSemi-optional
Contains commercial assets parameters.
-
cantonal-incomeSemi-optional
Cantonal income.Example Value:
426195.74 -
cantonal-wealthSemi-optional
Cantonal wealth.Example Value:
5837164.50 -
confederation-incomeSemi-optional
Confederation income.Example Value:
126472.57
-
-
-
tax-determinating-income-and-wealth Optional
Contains tax determining income and wealth parameters.
-
cantonal-incomeSemi-optional
Cantonal income.Example Value:
38274.57 -
cantonal-wealthSemi-optional
Cantonal wealth.Example Value:
74621.14 -
confederation-incomeSemi-optional
Confederation income.Example Value:
482762.17
-
-
net-income-according-to-salary-certificate Optional
If taxable person's domicile belongs to canton Vaud, this parameter represents net income according to salary certificate.Example Value:
38271.17 -
revenue-from-assets Optional
If taxable person's domicile belongs to canton Bern, Basel-Stadt, Vaud or Valais, this parameter represents revenue from assets.Example Value:
84263.80 -
total-assetsOptional
If taxable person's domicile belongs to canton Appenzell Innerrhoden, this parameter represents total assets.Example Value:
34726.99
-
Authentication
Tax Calculator API uses Hash-based message authentication code (HMAC-SHA256) to authenticate your request.
Each request to Tax Calculator API must contain:
- API Key - used to identify your account,
HMAC-SHA256signature inserted in'X-Signature'HTTP header - used to verify your request.
To create an HMAC-SHA256 signature you perform hashing of your request with API Secret as the hashing key.
In-detail information on what API Key and API Secret are, where to find them, and how to create a request signature and put it in the request can be found here.
If either of API Key or HMAC-SHA256 signature is not present in the request, the request will be rejected.
Example Request
POST
https://api.drtax.ch/TaxCalculator/NP
{
"basic-data": {
"zip": 3368,
"tax-year": 2014,
"municipality-of-taxation": "Bleienbach",
"children": 1,
"domicile": "Bleienbach",
"canton": 3,
"tax-liability-from": "2014-01-01",
"religious-affiliation": 3,
"marital-status": 2,
"tax-liability-till": "2014-12-31"
},
"fiscal-factors": {
"tax-determinating-income-and-wealth": {
"cantonal-wealth": 87687,
"cantonal-income": 489789,
"confederation-income": 487978
},
"revenue-from-assets": 2.41564456E8,
"qualified-participation": {
"private-assets": {
"cantonal-wealth": 8.67487878E8,
"cantonal-income": 89778,
"confederation-income": 1.4564654E7
},
"commercial-assets": {
"cantonal-wealth": 487987,
"cantonal-income": 56454,
"confederation-income": 4654
}
},
"taxable-amounts": {
"cantonal-wealth": 242122,
"cantonal-income": 8.9789798E7,
"confederation-income": 879
}
},
"language": "it",
"key": "55c35523dc19e8.64742828"
}Example Result
{
"data": {
"id": "8738bd39-abf9-4016-a54d-b373d795e591",
"request-date-time": "2015-08-31T09:26:33.997+0200",
"attributes": {
"number-of-days": 365,
"cantonal-and-municipal-taxes": {
"total": 2.4362914E7,
"canton-taxes": {
"total": 1.541574E7,
"income": 1.541574E7,
"wealth": 0,
"canton": {
"total": 1.541574E7,
"description": "Cantone",
"income": 1.541574E7,
"wealth": 0
}
},
"description": "Imposte cantonali e comunali",
"income": 2.4362914E7,
"community-taxes": {
"total": 7556735,
"income": 7556735,
"community": {
"total": 7556735,
"description": "Comune",
"income": 7556735,
"wealth": 0
},
"wealth": 0
},
"wealth": 0,
"church-taxes": {
"total": 1390439,
"church-christ-catholic": {
"total": 1390439,
"description": "Chiesa christ catholic",
"income": 1390439,
"wealth": 0
},
"income": 1390439,
"wealth": 0
}
},
"total-taxes": {
"total": 2.4362914E7,
"description": "Totale imposte",
"income": 2.4362914E7,
"wealth": 0
},
"community-tax-rate": "1.5",
"marginal-tax-rate": {
"description": "Aliquota fiscale marginale",
"income": "306.6%",
"wealth": "0.0\u2030"
},
"canton-tax-rate": "3.06",
"direct-federal-tax": {
"total": 0,
"description": "Imposta federale diretta",
"income": 0
}
},
"type": "calculation-results"
}
}