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,
"grossForEmployeeNi": 2500,
"grossForEmployerNi": 2500,
"netDeductions": 50
}
'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,
"grossForEmployeeNi": 2500,
"grossForEmployerNi": 2500,
"netDeductions": 50
}
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,
grossForEmployeeNi: 2500,
grossForEmployerNi: 2500,
netDeductions: 50
})
};
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,
'grossForEmployeeNi' => 2500,
'grossForEmployerNi' => 2500,
'netDeductions' => 50
]),
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 \"grossForEmployeeNi\": 2500,\n \"grossForEmployerNi\": 2500,\n \"netDeductions\": 50\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 \"grossForEmployeeNi\": 2500,\n \"grossForEmployerNi\": 2500,\n \"netDeductions\": 50\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 \"grossForEmployeeNi\": 2500,\n \"grossForEmployerNi\": 2500,\n \"netDeductions\": 50\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"employeeNiForPeriod": 123,
"employerNiForPeriod": 123,
"studentLoanForPeriod": 123,
"postGradLoanForPeriod": 123,
"netDeductions": 123,
"taxForPeriod": 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>"
}
]
}
]
}{
"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>"
}
]
}
]
}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
Tax code for the calculation
"1257L"
Gross amount to calculate from
Name of the calculation formula to use
2024, 2025 Period for the calculation
Unit of the period
Weekly, Fortnightly, FourWeekly, Monthly, Quarterly, BiAnnually, Annual, Daily National Insurance category
"A"
Student loan plan type
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
1000
Gross to use for the employee National Insurance calculation, when it differs from gross
2500
Gross to use for the employer National Insurance calculation, when it differs from gross
2500
Deductions taken from net pay, after tax and National Insurance
50
Was this page helpful?
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,
"grossForEmployeeNi": 2500,
"grossForEmployerNi": 2500,
"netDeductions": 50
}
'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,
"grossForEmployeeNi": 2500,
"grossForEmployerNi": 2500,
"netDeductions": 50
}
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,
grossForEmployeeNi: 2500,
grossForEmployerNi: 2500,
netDeductions: 50
})
};
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,
'grossForEmployeeNi' => 2500,
'grossForEmployerNi' => 2500,
'netDeductions' => 50
]),
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 \"grossForEmployeeNi\": 2500,\n \"grossForEmployerNi\": 2500,\n \"netDeductions\": 50\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 \"grossForEmployeeNi\": 2500,\n \"grossForEmployerNi\": 2500,\n \"netDeductions\": 50\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 \"grossForEmployeeNi\": 2500,\n \"grossForEmployerNi\": 2500,\n \"netDeductions\": 50\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"employeeNiForPeriod": 123,
"employerNiForPeriod": 123,
"studentLoanForPeriod": 123,
"postGradLoanForPeriod": 123,
"netDeductions": 123,
"taxForPeriod": 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>"
}
]
}
]
}{
"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>"
}
]
}
]
}