Calculator
Calculate gross to net values
POST
/
calculator
/
grosstonet
Calculate gross to net values
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"taxCode": "1257L",
"gross": 123,
"period": 123,
"niCategory": "A",
"postGradLoanPlan": true,
"grossToDate": 123,
"week1Month1": true,
"taxToDate": 1000
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet"
payload = {
"taxCode": "1257L",
"gross": 123,
"period": 123,
"niCategory": "A",
"postGradLoanPlan": True,
"grossToDate": 123,
"week1Month1": True,
"taxToDate": 1000
}
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-Token': '<api-key>',
'X-Org-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
taxCode: '1257L',
gross: 123,
period: 123,
niCategory: 'A',
postGradLoanPlan: true,
grossToDate: 123,
week1Month1: true,
taxToDate: 1000
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'taxCode' => '1257L',
'gross' => 123,
'period' => 123,
'niCategory' => 'A',
'postGradLoanPlan' => true,
'grossToDate' => 123,
'week1Month1' => true,
'taxToDate' => 1000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>",
"X-Org-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet"
payload := strings.NewReader("{\n \"taxCode\": \"1257L\",\n \"gross\": 123,\n \"period\": 123,\n \"niCategory\": \"A\",\n \"postGradLoanPlan\": true,\n \"grossToDate\": 123,\n \"week1Month1\": true,\n \"taxToDate\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"taxCode\": \"1257L\",\n \"gross\": 123,\n \"period\": 123,\n \"niCategory\": \"A\",\n \"postGradLoanPlan\": true,\n \"grossToDate\": 123,\n \"week1Month1\": true,\n \"taxToDate\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"taxCode\": \"1257L\",\n \"gross\": 123,\n \"period\": 123,\n \"niCategory\": \"A\",\n \"postGradLoanPlan\": true,\n \"grossToDate\": 123,\n \"week1Month1\": true,\n \"taxToDate\": 1000\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"taxForPeriod": 123,
"employeeNi": 123,
"employerNi": 123,
"studentLoan": 123,
"postGradLoan": 123,
"netPay": 123
},
"metadata": {
"dateFormat": "yyyy-MM-dd",
"dateTimeFormat": "yyyy-MM-ddTHH:mm:ss.fffZ",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
}
],
"messageToken": "<string>"
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {},
"metadata": {
"dateFormat": "yyyy-MM-dd",
"dateTimeFormat": "yyyy-MM-ddTHH:mm:ss.fffZ",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
}
],
"messageToken": "<string>"
}Authorizations
Access token obtained from OAuth2 client credentials flow
Organisation to scope the request to. Required when the principal can access more than one organisation; optional for single-organisation principals (the authorizer resolves it automatically).
Body
application/json
Tax code for the calculation
Example:
"1257L"
Gross amount to calculate from
Name of the calculation formula to use
Available options:
2024, 2025 Period for the calculation
Unit of the period
Available options:
Weekly, Fortnightly, FourWeekly, Monthly, Quarterly, Annual National Insurance category
Example:
"A"
Student loan plan type
Available options:
Plan1, Plan2, Plan4, Plan5 Indicates if the employee has a postgraduate loan plan
Gross amount to date
Indicates if the calculation is for Week 1/Month 1
Tax amount to date
Example:
1000
Was this page helpful?
⌘I
Calculate gross to net values
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"taxCode": "1257L",
"gross": 123,
"period": 123,
"niCategory": "A",
"postGradLoanPlan": true,
"grossToDate": 123,
"week1Month1": true,
"taxToDate": 1000
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet"
payload = {
"taxCode": "1257L",
"gross": 123,
"period": 123,
"niCategory": "A",
"postGradLoanPlan": True,
"grossToDate": 123,
"week1Month1": True,
"taxToDate": 1000
}
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-Token': '<api-key>',
'X-Org-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
taxCode: '1257L',
gross: 123,
period: 123,
niCategory: 'A',
postGradLoanPlan: true,
grossToDate: 123,
week1Month1: true,
taxToDate: 1000
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'taxCode' => '1257L',
'gross' => 123,
'period' => 123,
'niCategory' => 'A',
'postGradLoanPlan' => true,
'grossToDate' => 123,
'week1Month1' => true,
'taxToDate' => 1000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>",
"X-Org-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet"
payload := strings.NewReader("{\n \"taxCode\": \"1257L\",\n \"gross\": 123,\n \"period\": 123,\n \"niCategory\": \"A\",\n \"postGradLoanPlan\": true,\n \"grossToDate\": 123,\n \"week1Month1\": true,\n \"taxToDate\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"taxCode\": \"1257L\",\n \"gross\": 123,\n \"period\": 123,\n \"niCategory\": \"A\",\n \"postGradLoanPlan\": true,\n \"grossToDate\": 123,\n \"week1Month1\": true,\n \"taxToDate\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/calculator/grosstonet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"taxCode\": \"1257L\",\n \"gross\": 123,\n \"period\": 123,\n \"niCategory\": \"A\",\n \"postGradLoanPlan\": true,\n \"grossToDate\": 123,\n \"week1Month1\": true,\n \"taxToDate\": 1000\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"taxForPeriod": 123,
"employeeNi": 123,
"employerNi": 123,
"studentLoan": 123,
"postGradLoan": 123,
"netPay": 123
},
"metadata": {
"dateFormat": "yyyy-MM-dd",
"dateTimeFormat": "yyyy-MM-ddTHH:mm:ss.fffZ",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
}
],
"messageToken": "<string>"
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {},
"metadata": {
"dateFormat": "yyyy-MM-dd",
"dateTimeFormat": "yyyy-MM-ddTHH:mm:ss.fffZ",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
}
],
"messageToken": "<string>"
}