WEB API User Manual
Last update: December 31, 2021
Withholding32 API
The Withholding32 API lets you dynamically calculate Federal, State and Local withholding with any device which has web access. The Withholding32 API returns calculated taxes in response to a URL GET request. You can send the URL request using a web page, smart phone app, or any other device which can access the Internet.
You can try it right now using your browser. Copy the following line into your computers clipboard
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fdy=2024&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&st=0
Then Paste it into the URL line of your browser and press Enter. You will get a page with tax withholding information for Married person, with 2 allowances and an income of $6000.
You can see that your app builders task is to put required information into a url (like that above) and then parse the returned page to pull out the required tax information. The rest of this manual tells how to do this.
- Using Withholding32 API(sample)
- List of API Parameters
- Federal Parameters
- Supplemental Calculations of FICA/Medicare
- 2020 W4 parameters
- FICA and Medicare Parameters
- State Parameters
- Local Taxing Names and Calculation Numbers(sample)
- Alabama(sample)
- Arizona
- Arkansas
- California
- Colorado
- Connecticut
- Delaware
- District of Columbia
- Georgia
- Hawaii
- Idaho
- Illinois
- Indiana
- Iowa
- Kansas
- Kentucky
- Louisiana
- Maine
- Maryland
- Massachusetts
- Michigan
- Minnesota
- Mississippi
- Missouri
- Montana
- Nebraska
- New Jersey
- New Mexico
- New York(sample)
- North Carolina
- North Dakota
- Ohio
- Oklahoma
- Oregon
- Pennsylvania
- Rhode Island
- South Carolina
- Utah
- Vermont
- Virginia
- West Virginia
- Wisconsin
- State Unemployment Insurance (SUI)
- Federal Unemployment Insurance (FUTA)
- Family Leave
- Oregon Transit Taxes
- Returned Data Format
- PHP Example
- AJAX Example
- AJAX Example
Using Withholding32 API
Using the Withholding API involves 3 steps.- Send request to Withholding32 API
- Receive Data Back from Call
- Process Received Data
You call the Withholding32 API by sending an URL with a string of parameters attached. These parameters are used to pass things like number of pay periods per year, gross pay, state, filing status and many more.
You can use any programming language used to program a mobile device. Examples for a variety of languages are given at the end of this document.
Note 1: In this document we show all URL's in plain text format for ease of reading. In reality URL's must be sent in URL-format. E.G. "Head of Household" would be sent as "Head%20of%20Household". Almost all smart phone programming languages and general programming languages have functions to perform this conversion for you. For example the Javascript function encodeURIComponent does this. In most cases our interface is designed so you don't have to worry about this.
Note 2: This page is automatically updated to show a valid TEST user id. This user id may change periodically. Always refer to this document to find the current test user id.
Here are some examples showing parameters you will typically send.
Federal ONly Example
This example illustrates the URL required to calculate Federal Withholding. Parameters are 12 pay periods per year, pretax cafeteria contribution of $200.00, pretax retirement contribution of $100.00,Federal filing status of Single, 2 allowancees, gross pay of 6000.00,FICA income of $6000.00,$0.00 previous fica contribution,supplemental pay of $1000.00,no state calculation
http://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fdy=2024&fpp=12&fpr=100.00&fpc=200.00&ffs=Single&fa=2&fgp=6000.00&figp=6000.00&fiytd=0&fsam=1000.00&st=0
HTML returned will be similar to this. Your program will have to parse the returned page to extract the information you are interested in. If you wanted Federal withholding amount in the example output below you would parse for the text "Federal withhold=" and then exactract the numeric portion after the equal sign. Each line ends with a carriage return character.
Error=0,0
Federal withhold=891.06
FICA=285.60
Medicare=98.60
Federal Supplemental withhold=250.00
State withhold=0.00
State Supplemental withhold=0.00
City withhold=0.00
City Supplemental withhold=0.00
City Resident withhold=0.00
City Resident Supplemental withhold=0.00
County withhold=0.00
County Supplemental withhold=0.00
School withhold=0.00
School Supplemental withhold=0.00
SDI withhold=0.00
Version=2012.09,1.02
No messages
In our examples throughout this manual we usually only show the output lines we are interested in, not the entire output.
Federal and State Example
This example illustrates the URL required to calculate Federal and California Withholding.
http://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fdy=2024&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&fiytd=0&st=6&stp=6000&ss=Married&sa=2&sad=50&stca=1
HTML returned will be
Error=0,0
Federal withhold=631.25
FICA=252.00
Medicare=87.00
Federal Supplemental withhold=0.00
State withhold=202.92
State Supplemental withhold=0.00
City withhold=0.00
City Supplemental withhold=0.00
City Resident withhold=0.00
City Resident Supplemental withhold=0.00
County withhold=0.00
County Supplemental withhold=0.00
School withhold=0.00
School Supplemental withhold=0.00
SDI withhold=0.00
Version=2012.09,1.02
No messages
Your app would have to search for the desired tax information (i.e. search for "Federal withhold=" and then use the number that follows)
List of API Parameters
This section is divided into the following sections
Federal Tax Parameters
parameter | you supply |
---|---|
userid | string which contains your unique API code. You received 3 of these when you set up your account. A temporary API code is available on the Withholding32 website for development purposes |
ffs | filing status (from w4). Options are 'Single' or 'Married' |
fa | allowances (from w4). |
fad | additional withholding (from w4) decimal |
fpp | pay periods per year |
fgp | federal gross pay for pay period decimal |
fpr | Decimal with amount of pretax contribution for this paycheck |
fpc | Decimal with amount of cafeteria plan contribution for this paycheck |
fsam | Decimal with supplemental amount |
fsytd | Decimal year to date supplemental amount (do not include this pay period) |
fsct | Supplemental tax type (0 = flat rate, 1=add to salary) |
fdy | year of calculation |
fdm | month of calculation |
fdd | day of calculation |
Supplemental and FICA/Medicare Calculations
FICA and Medicare tax will automatically be calculated for supplemental income. Care must be taken in the case where pretax retirement is greater than regular pay and less than supplemental payment. In this situation FICA and Medicare could be calculated incorrectly. The safest thing to do in this situation is to calculate FICA/Medicare in a separate call the the engine and then perform the regular calculation but using the FICA/Medicare amount returned in the first calculation.FICA and Medicare Tax Parameters
parameter | you supply |
---|---|
figp | fica gross pay for pay period |
fiytd | Decimal with employee gross year to date FICA wages. Do not include current paycheck |
fsam | federal supplemental amount |
fsct | Supplemental calc type (0 = flat rate, 1=add to salary) |
Supplemental and FICA/Medicare Calculations
FICA and Medicare tax will automatically be calculated for supplemental income. Care must be taken in the case where pretax retirement is greater than regular pay and less than supplemental payment. In this situation FICA and Medicare could be calculated incorrectly. The safest thing to do in this situation is to calculate FICA/Medicare in a separate call the the engine and then perform the regular calculation but using the FICA/Medicare amount returned in the first calculation.Federal 2020 W4 parameters
The Federal W-4 for year 2020 was completely redesigned. You can pass the new W4 parameters using these value.parameter | you supply |
---|---|
fw42020 | Set to 1 if employee has filled out new 2020 w4, 0 else |
fw4step2 | Set to 1 if employee has checked step 2 box on new W4, 0 else |
fw4step3 | From employ 2020 W4 |
fw4step4a | From employ 2020 W4 |
fw4step4b | From employ 2020 W4 |
(w4 step4c | This additional withholding should be placed in existing parameter 'fad' |
fw4nra | Set to 1 if nonresident alien, 0 else |
2020 Federal Only Example New W4 Step 2 NOT checked
This example illustrates the URL required to calculate Federal Withholding. Parameters are 12 pay periods per year, pretax cafeteria contribution of $200.00, pretax retirement contribution of $100.00,Federal filing status of Single, 2 allowancees, gross pay of 6000.00,FICA income of $6000.00,$0.00 previous fica contribution,supplemental pay of $1000.00,no state calculation. Also the flag for the employee filling out the 2020 W4 is set, but NOT the flag for W4 Step 2 check box.
http://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fdy=2024&fpp=12&fpr=100.00&fpc=200.00&ffs=Single&fa=2&fgp=6000.00&figp=6000.00&fiytd=0&fsam=1000.00&st=0&fw42020=1&fw4step2=0
HTML returned will be
Error=0,0
Federal withhold=891.06
FICA=285.60
Medicare=98.60
Federal Supplemental withhold=250.00
2020 Federal Only Example New W4 Step 2 checked
This example illustrates the URL required to calculate Federal Withholding. Parameters are 12 pay periods per year, pretax cafeteria contribution of $200.00, pretax retirement contribution of $100.00,Federal filing status of Single, 2 allowancees, gross pay of 6000.00,FICA income of $6000.00,$0.00 previous fica contribution,supplemental pay of $1000.00,no state calculation. Also the flag for the employee filling out the 2020 W4 is set, and the flag for W4 Step 2 check box is set.
http://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fdy=2024&fpp=12&fpr=100.00&fpc=200.00&ffs=Single&fa=2&fgp=6000.00&figp=6000.00&fiytd=0&fsam=1000.00&st=0&fw42020=1&fw4step2=1
HTML returned will be
Error=0,0
Federal withhold=891.06
FICA=285.60
Medicare=98.60
Federal Supplemental withhold=250.00
State Specific Parameters
Local Withholding Information
State parameters include local parameters for states to which this applies. In order to calculate local withholding you will need the calculation number. for each local taxing body. We provide a way to get the calculation id as-well-as the actual name of each taxing body. You can use the name to setup a combo box or other method to prompt a user to select what taxing body they are under. Before we get to state parameters let's see how to get the local calcution id. If you are only interested in states who do not have local withholding then you can skip this section.
Local Taxing Names and Calculation Numbers
We support county, city and school district withholding for a number of states. To calculate local withholding you have to pass the calculation API a calculation number which identifies the local taxing body. You also have to prompt the end user to select the local taxing body. We provide an API which equates the calculation number to local taxing body name. You can use the name information in user prompts. You MUST use the calculation number when calling the calculation api. As in the calculation api, you use a URL GET request to retrieve a page of information. Calls this this api do not count against your limit.
Example
This example illustrates the URL required to request Kentucky city taxing names and the corresponding calculation number you would use when calling the calculation api..
https://www.withholding32.com/api/wh32prompts.php?state=21&muni=1
The return will be a page with each line containing the calculation number, a comma, and then the taxing body name. In the above example the return would be
2061,Adairville
1004,Ashland
2062,Auburn
...etc
Short Cut
The list of local taxing districts can be lengthy. It is better if you only request the list when it changes. As illustrated in the first examples 'version number' is the last line returned by most url calls.
http://www.withholding32.com/api/wh32prompts.php?state=21&muni=0&returndate=Yes
You can save the returned version number along with the list of calculation numbers and names. Then the next time you need the prompts request version number first and only retrieve the complete list if required.
State-by-state Instructions for returning Local Taxing Body information
Alabama
parameter | you supply |
---|---|
state | state(1=Alabama) |
muni | not used |
Returned is a list of Cities
Colorado
parameter | you supply |
---|---|
state | state(7=Colorado) |
muni | not used |
Returned is a list of Cities
Delaware
parameter | you supply |
---|---|
state | state(9=Delaware) |
muni | not used |
Returned is a list of Cities
Indiana
parameter | you supply |
---|---|
state | state(18=Indiana) |
muni | not used |
Returned is a list of Counties
Kentucky
parameter | you supply |
---|---|
state | state(21=Kentucky) |
muni |
0=school district 1=city 2=county |
Returned is a list of either school districts, cities or counties
Maryland
parameter | you supply |
---|---|
state | state(25=Maryland) |
muni | not used |
Returned is a list of Counties
Michigan
parameter | you supply |
---|---|
state | state(27=Michigan) |
muni | not used |
Returned is a list of Cities
Missouri
parameter | you supply |
---|---|
state | state(30=Missouri) |
muni | not used |
Returned is a list of Cities
New York
parameter | you supply |
---|---|
state | state(37=New York) |
muni | not used |
Returned is a list of Cities
Ohio
parameter | you supply |
---|---|
state | state(41=Ohio) |
muni |
0=school district 1=city |
Returned is a list of either school districts or cities
Pennsylvania
parameter | you supply |
---|---|
state | state(45=Pennsylvania) |
muni |
0=school district 1=city |
Returned is a list of either school districts or cities
In addition to the Federal and Fica parameters each state requires the additional parameters shown in the state sections that follow.
Alabama
parameter | you supply |
---|---|
st | state number (1 = Alabama) |
stp | state taxable pay |
ss |
state filing status Alabama options are 'Single' 'Married' 'Married filing Separately' 'Head of Household' ( from state w4) |
stal | number of Alabama dependents (from state w4) |
stal2 | number indicating if employee wants to claim personal exemption (0=no, 1=yes) (from state w4) |
stall | calculation number of local taxing body |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
This example illustrates the URL required to calculate Federal, Alabama, and Local Withholding.
in this example "stall=2" is the calculation id for Auburn
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&fiytd=0&st=1&stp=6000&ss=Married&sa=2&sad=50&stall=2
HTML returned will be
...
State withhold=296.02
State Supplemental withhold=0.00
City withhold=120.00
City Supplemental withhold=0.00
...
Arizona
parameter | you supply |
---|---|
st | state number (4 = Arizona) |
stp | state taxable pay |
staz |
decimal for Arizona withholding rate (from state w4) as of 2020 options are 0, 0.008, 0.013, 0.018, 0.027, 0.036, 0.042, 0.051 |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Arkansas
parameter | you supply |
---|---|
st | state number (5 = Arkansas) |
stp | state taxable pay |
sa | number of exemptions (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
California
parameter | you supply |
---|---|
st | state number (6=California) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household ( from state w4) |
sa | number of allowances (from state w4) |
stca | number of state estimated deductions (de4 line 2) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
sdip | state sdi gross pay for pay period |
sdiytd | state sdi gross pay year-to-date (not including this pay period) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Colorado
parameter | you supply |
---|---|
st | state number (7=Colorado) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' ( from state w4) |
sa | number of allowances (from state w4) |
stco | calculation number of local taxing body (See section on Local Taxing Names and Calculation Numbers) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
City withhold=2.00
...
Connecticut
parameter | you supply |
---|---|
st | state number (8=Connecticut) |
stp | state taxable pay |
ss |
state filing status options are 'Table A' 'Table B' 'Table C' 'Table D' 'Table E' 'Table F' ( from state w4) |
stct | Decimal for Connecticut Reductional Amount (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Delaware
parameter | you supply |
---|---|
st | state number (9=Delaware) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married filing Separately' ( from state w4) |
sa | number of Claimed Credits |
stde | calculation number of local taxing body (See section on Local Taxing Names and Calculation Numbers) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
City withhold=2.00
...
District of Columbia
parameter | you supply |
---|---|
st | state number (10=District of Columbia) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household' 'Married filing Separately' ( from state w4) |
sa | number of exemptions (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Georgia
parameter | you supply |
---|---|
st | state number (13=Georgia) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married one Working' 'Married both Working' 'Married Filing Separate' 'Head of Household' ( from state w4) |
sa | number of allowances (from state w4) |
stga | number of dependents (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Hawaii
parameter | you supply |
---|---|
st | state number (15=Hawaii) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' ( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
sdip | state sdi gross pay for pay period |
sdiytd | state sdi gross pay year-to-date (not including this pay period) |
sdipp | Number of Payperiods in year |
...
State withhold=296.02
State Supplemental withhold=0.00
SDI Withhold=4.50
...
Example
This example illustrates Hawaii including SDI
http://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fdy=2024&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&fiytd=0&st=15&stp=6000&ss=Married&sa=2&sad=0&sdip=2000&sdipp=52
Idaho
parameter | you supply |
---|---|
st | state number (16=Idaho) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married Withhold Single'( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
SDI Withhold=4.50
...
Illinois
parameter | you supply |
---|---|
st | state number (17=Illinois) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
stil | Illinois additional allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Indiana
parameter | you supply |
---|---|
st | state number (18=Indiana) |
stp | state taxable pay |
sa | number of exemptions (from state w4) |
stin | number of dependents (from state w4) |
stinl | calculation number of local taxing body (See section on Local Taxing Names and Calculation Numbers) |
stinr | Residency (0 = Nonresident, 1 = Resident) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
County Withhold=2.22
...
Iowa
parameter | you supply |
---|---|
st | state number (19=Iowa) |
stp | Decimal state taxable pay |
sa | number of allowances (from state w4) |
sad | Decimal state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | Decimial state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Kansas
parameter | you supply |
---|---|
st | state number (20=Kansas) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married', 'Married Filing Separate', 'Head of Household' |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Kentucky
parameter | you supply |
---|---|
st | state number (21=Kentucky) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
stkycnty | calculation number of county (See section on Local Taxing Names and Calculation Numbers) |
stkycntyr | residency (0 = nonresident of county, 1=resident of county) |
stkycnty | calculation number of county (See section on Local Taxing Names and Calculation Numbers) |
stkycityr | residency (0 = nonresident of city, 1=resident of city) |
stkysch | calculation number of school (See section on Local Taxing Names and Calculation Numbers) |
stkyschr | residency (0 = nonresident of school, 1=resident of school) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
County Withhold=2.22
City Withhold=3.33
School Withhold=4.44
...
Example
This example illustrates Kentucky and County, City, School withholding
http://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fdy=2024&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&fiytd=0&st=15&stp=6000&ss=Married&sa=2&sad=0&sdip=2000&sdipp=52&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&fiytd=0&st=21&stp=6000&ss=Married&sa=2&sad=50&stkycnty=10&stkycity=2062&stkysch=10000
Louisiana
parameter | you supply |
---|---|
st | state number (22=Louisiana) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married', 'No Exemption' |
sa | number of personal exemptions (from state w4) |
stla | number of dependent exemptions (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
Maine
parameter | you supply |
---|---|
st | state number (23=Maine) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married Withhold Single'( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
Maryland
parameter | you supply |
---|---|
st | state number (25=Maryland) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married Filing Separate', 'Head of Household'( from state w4) |
sa | number of exemptions (from state w4) |
stmd | calculation number of local taxing body (See section on Local Taxing Names and Calculation Numbers) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
Massachusetts
parameter | you supply |
---|---|
st | state number (26=Massachusetts) |
stp | state taxable pay |
sa | number of exemptions and dependents (from state w4) |
stmahoh | number of head of household allowances(from state w4) |
stmabl | blind allowances (from state w4) |
stmast | set to 1 if student making less than $8000 annualy, else set to 0 (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Michigan
parameter | you supply |
---|---|
st | state number (27=Michigan) |
stp | state taxable pay |
sa | number of personal and dependency exemptions (from state w4) |
stmiwork | calculation number of local taxing body where employee works (See section on Local Taxing Names and Calculation Numbers) |
stmilive | calculation number of local taxing body where employee lives (See section on Local Taxing Names and Calculation Numbers) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
Note: Michigan has both a tax for the location you work and the location you live. There will be an additional line output for Michigan e.g. city of residence withhold=
...
State withhold=296.02
State Supplemental withhold=0.00
City withhold=2.00
City of residence withhold=1.00
...
Minnesota
parameter | you supply |
---|---|
st | state number (28=Minnesota) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married Withhold Single' ( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Mississippi
parameter | you supply |
---|---|
st | state number (29=Mississippi) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household' 'Married both Working'( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Missouri
parameter | you supply |
---|---|
st | state number (30=Missouri) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household' 'Married both Working' ( from state w4) |
stmo | calculation number of local taxing body (link to be provided) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
City withhold=2.00
...
Montana
parameter | you supply |
---|---|
st | state number (31=Montana) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Nebraska
parameter | you supply |
---|---|
st | state number (32=Nebraska) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' ( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
New Jersey
parameter | you supply |
---|---|
st | state number (35=New Jersey) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married filing Separate' 'Head of Household' 'Qualifying Widow' 'Table A' 'Table B' 'Table C' 'Table D' 'Table E'( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
sdip | state sdi gross pay for pay period |
sdiytd | state sdi gross pay year-to-date (not including this pay period) |
sdier | employer congtibution percentage (i.e. .005 is 1/2 of 1%) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
New Mexico
parameter | you supply |
---|---|
st | state number (36=New Mexico) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household' 'Married Withhold Single' ( from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
New York
parameter | you supply |
---|---|
st | state number (37 = New York) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household' 'Married Withhold Single'( from state w4) |
sa | number of exemptions (from state w4) |
sta | number of new york claimed allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
stnylocal | Local Taxing Body |
stnyla | local allowances |
stnyyr | Yonkers Resident(1=yes, 0=no)(starting in year 2018) |
stnylad | decimal local additional withholding |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
sdip | state sdi gross pay for pay period |
sdiytd | state sdi gross pay year-to-date (not including this pay period) |
sdipp | Number of Payperiods in year |
This example illustrates the URL required to calculate New York Withholding. It calculates Yonkers Non-resident. The returned line City Resident withhold is not used. Whether resident or non-resident the city value is returned in City withhold.
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&fiytd=0&st=37&stp=6000&ss=Married&sa=2&sad=50&stnylocal=1&stnyyr=0
HTML returned will be
Error=0,0
Federal withhold=612.90
FICA=372.00
Medicare=87.00
Federal Supplemental withhold=0.00
State withhold=351.28
State Supplemental withhold=0.00
City withhold=30.00
City Supplemental withhold=0.00
City Resident withhold=0.00
City Resident Supplemental withhold=0.00
County withhold=0.00
County Supplemental withhold=0.00
School withhold=0.00
School Supplemental withhold=0.00
SDI withhold=0.00
SDI employer withhold=0.00
SUI employer withhold=0.00
SUI employee withhold=0.00
FUTA employer withhold=0.00
Version=2017.11,1.02
No messages
North Carolina
parameter | you supply |
---|---|
st | state number (38=North Carolina) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household' 'Qualifying Widower' ( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
North Dakota
parameter | you supply |
---|---|
st | state number (39=North Dakota) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Head of Household'(2020 or above) 'Married Withhold Single'(2020 or above) ( from state w4) |
sa | number of allowances (from w4) |
stw4l1 | set to 1 if using new 2020 w4 or later, else set to 0(from w4) |
stw4d1 | 2020 w4 step 4a (from w4) |
stw4d2 | 2020 w4 step 4b (from w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Ohio
parameter | you supply |
---|---|
st | state number (41=Ohio) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
stohsc | calculation number of school district (See section on Local Taxing Names and Calculation Numbers) |
stohmu | calculation number of municipality (See section on Local Taxing Names and Calculation Numbers) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
City Withhold=20.00
School Withhold=10.00
...
Oklahoma
parameter | you supply |
---|---|
st | state number (42 = Oklahoma) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married withhold Single' |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Oregon
parameter | you supply |
---|---|
st | state number (43 = Oregon) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married single Rate' ( from state w4) |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Pennsylvania
parameter | you supply |
---|---|
st | state number (45 = Pennsylvania) |
stp | state taxable pay |
stpasc | calculation number of school district (See section on Local Taxing Names and Calculation Numbers) |
stpamu | calculation number of municipality (See section on Local Taxing Names and Calculation Numbers) |
stpamur | municipal residency (0=nonresident, 1=resident) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
City Withhold=20.00
School Withhold=10.00
...
Rhode Island
parameter | you supply |
---|---|
st | state number (47 = Rhode Island) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
sdip | state sdi gross pay for pay period |
sdiytd | state sdi gross pay year-to-date (not including this pay period) |
...
State withhold=296.02
State Supplemental withhold=0.00
City Withhold=20.00
School Withhold=10.00
...
South Carolina
parameter | you supply |
---|---|
st | state number (48 = South Carolina) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Utah
parameter | you supply |
---|---|
st | state number (52 = Utah) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' |
sa | number of allowances (only used before May 1, 2018) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
City Withhold=20.00
School Withhold=10.00
...
Vermont
parameter | you supply |
---|---|
st | state number (53 = Vermont) |
stp | state taxable pay |
ss |
state filing status options are 'Single' 'Married' 'Married Withhold Single' |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Virginia
parameter | you supply |
---|---|
st | state number (55 = Virginia) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
star | number of elderly/blind exemptions (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
West Virginia
parameter | you supply |
---|---|
st | state number (57 = West Virginia) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
stwv | optional spouse not working withholding (from state w4) (1 = regular, 0=use lower rate since spouse doesn't work) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
Wisconsin
parameter | you supply |
---|---|
st | state number (58 Wisconsin) |
stp | state taxable pay |
sa | number of allowances (from state w4) |
sad | state additional withholding amount per pay period (from state w4) |
ssam | Decimal for state supplemental pay amount |
ssytd | state supplemental pay amount year -to-date |
ssct | supplemental tax type (0=flat, 1=add to regular pay) |
...
State withhold=296.02
State Supplemental withhold=0.00
...
State Unemployment Insurance
SUI
parameter | you supply |
---|---|
st | state |
fdy | year |
fdm | month (base 1) |
fdd | day of month |
suip | state taxable pay |
suiytd | Year to date taxable pay not including this paycheck |
suier | Employer withholding percentage (1/2 % would be .005 |
suiee | Employee withholding percentage (1/2 % would be .005 |
Alabama SUI Example
This example illustrates the URL required to calculate Alabama SUI.
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&suip=6000&st=1&fdy=2019&fdm=11&suier=.005
In this example suier is the employer rate of 1/2 of 1%.
Returned Data Format
Data will be returned in the general format shown below. Your app can search for the text to the left of the equal (=) sign and then retrieve the number to the right. Each line ends with a "<br>" html command. You should not assume that lines will necessarily be in the order shown.
Error=0,0
Federal withhold=631.25
FICA=252.00
Medicare=87.00
State withhold=0.00
State withhold=202.92
State Supplemental withhold=0.00
City withhold=0.00
City Supplemental withhold=0.00
City Resident withhold=0.00
City Resident Supplemental withhold=0.00
County withhold=0.00
County Supplemental withhold=0.00
School withhold=0.00
School Supplemental withhold=0.00
SDI withhold=0.00
SUI employer withhold=
SUI employee withhold=
Version=2012.09,1.02
No messages
Error codes
Two error codes are returned. The first is the Withholding32 DLL error code and the 2nd is the WEB API error code
Federal Unemployment Insurance
Withholding for Federal Unemployment Insurance(FUTA) is supported for all states. The parameters below can be included in the regular calculation list parameters. You have to pass the employer withholding rate since this varies with employer. Our database will test against the annual maximum.
FUTA
parameter | you supply |
---|---|
futap | federal taxable pay |
futaytd | Year to date taxable pay not including this paycheck |
futaer | Employer withholding percentage (1/2 % would be .005 |
This example illustrates the URL required to calculate FUTA.
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&futap=5000&futaytd=0&futaer=.005
In this example rate of 1/2 of 1%.
Returned Data Format
Data will be returned in the general format shown below. Your app can search for the text to the left of the equal (=) sign and then retrieve the number to the right. Each line ends with a "<br>" html command. You should not assume that lines will necessarily be in the order shown.
Error=0,0
Federal withhold=631.25
FICA=252.00
Medicare=87.00
State withhold=0.00
State withhold=202.92
State Supplemental withhold=0.00
City withhold=0.00
City Supplemental withhold=0.00
City Resident withhold=0.00
City Resident Supplemental withhold=0.00
County withhold=0.00
County Supplemental withhold=0.00
School withhold=0.00
School Supplemental withhold=0.00
FUTA employer Withhold=
Version=2012.09,1.02
No messages
Family Leave
Family Leave Insurance is supported in Connecticut, District of Columbia, Massachusetts, New Jersey, New York, Washington State. A separate call should be made to the calculation api using the parameters below. Our database will test against the annual maximum.
Family Leave
parameter | you supply |
---|---|
fls | State number (35 is New Jersey and 37 is New York) |
fly | year |
flm | month |
fld | day |
flgp | gross pay |
flgpytd | gross pay year-to-date (non including flgp) |
Family Leave Example
This example illustrates the URL required to calculate Family Leave.
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fls=35&fly=2019&flm=11&fld=12&flgp=5000&flgpytd=0
Oregon Transit
There are two type of transit tax. There are several local taxes which are paid by employer. Since the rate varies we provide a variable to send the withholding percentage to our transit calculation function.
In addition, effective July 1, 2018 there is a statewide transit tax paid by almost all employees. On after this date we return the tax amount based on the percentage in our database and the amount of pay you pass.
We then return the local employer tax and the employee tax.
Transit Tax
parameter | you supply |
---|---|
st | State number (43 is Oregon) |
ortti | Pay subject to tax |
ortty | year |
orttm | month |
orttd | day |
orttytd | gross pay year to date |
orttrate | Employer withholding percentage for optional local employer paid tax. .005 would be 1/2 of 1% |
Oregon Transit Tax Example
This example illustrates the URL required to calculate Oregon Transit Tax.
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&st=43&ortti=6000&ortty=2019&orttm=11&orttd=12&orttrate=.005&orttytd=0
In this example orttrate rate of 1/2 of 1%.
Optional employer tax withholding amount is returned in line: Oregon employer transit tax=
Statewide employee withholding amount is returned in line: Oregon statewide employee transit tax=
Employer tax is returned in line: Oregon employer transit tax=
Returned Data Format
Data will be returned in the general format shown below. Your app can search for the text to the left of the equal (=) sign and then retrieve the number to the right. Each line ends with a "<br>" html command. You should not assume that lines will necessarily be in the order shown.
Family Leave Error=0
Family Leave Withholding=2.70
Error codes
Two error codes are returned. The first is the Withholding32 DLL error code and the 2nd is the WEB API error code
Family Leave Example
This example illustrates the URL required to calculate New Jersey Family Leave.
https://www.withholding32.com/api/wh32calc.php?userid=T14X55734&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&fiytd=0&st=37&stp=6000&ss=Married&sa=2&sad=50&stnylocal=1&stnyyr=0
HTML returned will be
Family Leave Error=0 Family Leave Withholding=1.80
Withholding32 DLL error codes
One or more of the following bits may be set. If the returned code is 0 then no error occurred.
- bit 0: Federal Error
- bit 1: FICA Error
- bit 2: Medicare Error
- bit 3: State Error
- bit 4: Local Error
Web API error codes
- 0: no error
- 1: invalid user id
PHP Example
Here is a code snipped demonstrating php use of this api.
//
// set up url to get withholding data from web api
//
$thedate=getdate();
$themonth=$thedate['mon'];
$theyear=$thedate['year'];
$theday=$thedate['mday'];
$surl="http://www.withholding32.com/api/wh32calc.php";
$surl=$surl."?userid=xxxx";
// correct userid must be supplied
$surl=$surl."&fpp=".$pcpperyear;
// $pcpperyear has been initialized with number of pay periods/year
$surl=$surl."&fpr=".$pcpretax;
// $pcpretax has been initialized with pretax contribution
$surl=$surl."&fss=Married";
// Federal status of Married
$surl=$surl."&fa=2";
// 2 allowances
$surl=$surl."&fgp=".$pcgross;
// $pcgross has been initialized with gross pay for pay period
$surl=$surl."&figp=".$pcgross;
$surl=$surl."&fiytd=0";
// first paycheck of year so no previous fica
$surl=$surl."&st=1"; // alabama
$surl=$surl."&stp=".$pcgross;
$surl=$surl."&ss=".urlencode($ss);
// save way to put text in a url
$surl=$surl."&stal=".$sa;
// state allowances
$surl=$surl."&stal2=0";
// state optional value
$surl=$surl."&fdy=".$theyear;
$surl=$surl."&fdm=".$themonth;
$surl=$surl."&fdd=".$theday;
$surl=$surl."&debug99=99";
$thedata=file_get_contents($surl);
// call to get withholding data from url
//
//call function to extract values we want from data returned by url
//
list($errordis,$resultdis,$federal,$state,$local)= get_withhold_value($thedata);
//
// Return partial withholding data from string returned from web api
//
//Note this function does not return ALL withholding values, just a few to give the idea
function get_withhold_value($thedata){
$local=0;
$thelines=explode("
",$thedata);
$rows=count($thelines);
for($i=0;$i<$rows;$i++){
$mes=strpos($thelines[$i],"Error=",0);
if($mes!==false){
$errordis="";
$resultdis="";
}
$mes=strpos($thelines[$i],"Federal withhold=",0);
if($mes!==false){
$thesize=strlen($thelines[$i])-17;
$federal=substr($thelines[$i],17,$thesize);
}
$mes=strpos($thelines[$i],"State withhold=",0);
if($mes!==false){
$thesize=strlen($thelines[$i])-15;
$state=substr($thelines[$i],15,$thesize);
}
}
return array($errordis,$resultdis,$federal,$state,$local);
}
Asynchronous JavaScript and XML (AJAX)
Our API is totally usable using AJAX. Since most browsers limit cross platform scripting you will have to call our API through a link on your own server. Below is an example of a PHP program which will accept an AJAX request and pass it on to our API.
This code would recide on YOUR server.
Our API is totally usable using AJAX. Since most browsers limit cross platform scripting you will have to call our API through a link on your own server. Below is an example of a PHP program which will accept an AJAX request and pass it on to our API. This code would recide on YOUR server.
Here is a code snipped demonstrating php use of this api.
$sstatus=session_start();
$all=$_SERVER['QUERY_STRING']; // get all arguments
//
// redirect to withholding32 api
//
$location="https://www.withholding32.com/api/wh32calc.php?".$all;
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$location);
curl_setopt($ch,CURLOPT_HEADER,0);
$content=curl_exec($ch);
curl_close($ch);
JAVA Example
Our API is totally usable using AJAX. Since most browsers limit cross platform scripting you will have to call our API through a link on your own server. Below is an example of a PHP program which will accept an AJAX request and pass it on to our API.
This code would recide on YOUR server.
Our API is totally usable using AJAX. Since most browsers limit cross platform scripting you will have to call our API through a link on your own server. Below is an example of a PHP program which will accept an AJAX request and pass it on to our API. This code would recide on YOUR server.
- Send Request
- Receive Data
String inputLine;
String allLines;
while ((inputLine = in.readLine()) != null){
allLines[index++]=inputLine;
}
in.close();
- Process Data
for(index i=0; index<allLines.length; index++){
if(allLines[index].contains("Medicare=")){
String medicarewithholdamount=allLines[index].substring(9,allLines[index].length);
}
else if(allLines[index].contains("Federal withhold=")){
// extract Federal withholding from string would go here
}
else if(allLines[index].contains("more search fields=")){
//...
}
String surl="https://www.withholding32.com/api/wh32calc.php?
userid=T14X55734&fdy=2024&fpp=12&ffs=Married&fa=2&fgp=6000&figp=6000&st=0";
surl=URLEncoder.encode(surl,"utf-8");
URL url = new URL(surl);
InputStream stream=url.openStream();