API: FRENCH INCOME TAX The system for calculating the income tax is complex and is different country to another.
The purpose of this page is to provide an API of the French income tax.
The calculation is reliable but can't face every single case of the French tax system (widow, half tax share...) .
The hope is to be able to open this calculation to all countries in order to compare INCOME TAX
API: PARAMETER >FRENCH INCOME TAX
Address
You can work with API register on : http://fraisreels.fr/API/API_prod.php


PARAMETTERS:
YEAR: IS the reporting year; The income is from the year before. We have 2016,2015,2014 and 2013; Mandatory parameter
INCOME: Net Salary before INCOME; Mandatory parameter
STATUS: single:1 /married:2; Mandatory parameter
CHILDREN: number of CHILDREN

Exemple:
http://fraisreels.fr/API/API_prod.php?STATUS=1&YEAR=2016&INCOME=30000
API: RESPONSE >FRENCH INCOME TAX

RESPONSE

The response will be a XML file

PHP: you can easely use the "simplexml_load_file" function to tack back the result.
JS: You also can use a javascript function with XMLHttpRequest() to proceed an AJAX calculation. In this case, please contact us to insert the IP adress of your serveur in our serveur script, otherwise the methode will not run

Structure


The Income Tax is on the filed < Result > --> <INCOMETAXE >
You can tack it with Result[0]->INCOMETAXE

Other parameter are given in response including error log
So you can easily break you script in case of error

Exemple:

< FRAISREELS >
< ERROR >NON </ERROR >

< Result >
< INCOMETAXE >7889.2 </INCOMETAXE>
< TAX_RATE >0.157784 %</TAX_RATE>
< /Result >

<PARAM_ >
< CUNTRY >FRANCE </CUNTRY>
< INCOME >50000 </INCOME>
< TAX_ALLOWANCE >5000 </ TAX_ALLOWANCE >
< INCOME_after_TA >45000 < /INCOME_after_TA >
< STATUS > SINGLE </STATUS >
< CHILDREN />
< TAX_SHARE >1 </TAX_SHARE >
< /PARAM_ >

< /FRAISREELS >

API: EXEMPLE in PHP $INCOME="20000";
$STATUS="1";
$YEAR= "2015";
$CHILDREN="";

$mysongs = simplexml_load_file('http://localhost/API.php?YEAR='.$YEAR.'&STATUS='.$STATUS.'&INCOME='.$INCOME.'&CHILDREN='.$CHILDREN.'');

//DISPLAY RESULT & MANAGE ERROR
$error= $mysongs->ERROR;

// if there is no errors
if ($error=="NON")
{ echo "INCOME TAX:" .$mysongs->Result[0]->INCOMETAXE;
echo "Parameter:";
echo "TAX ALLOWANCE:" .$mysongs->PARAM[0]->TAX_ALLOWANCE;
echo "CHILDREN:" .$mysongs->PARAM[0]->CHILDREN ;

}
//ELSE we display error log
ELSE
{
echo $error;
}