curl --request GET \
--url https://api.example.com/v1/payroll/calculations/{calculation_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/payroll/calculations/{calculation_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/payroll/calculations/{calculation_id}', 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.example.com/v1/payroll/calculations/{calculation_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payroll/calculations/{calculation_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/payroll/calculations/{calculation_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payroll/calculations/{calculation_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employee_id": "<string>",
"summary": {
"gross_salary": "<string>",
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"perceptions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"taxable": true,
"imss_base": true,
"tags": [
"<string>"
]
}
],
"deductions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"tags": [
"<string>"
],
"bracket_applied": {}
}
],
"taxable_bases": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"formula": "<string>"
}
],
"employer_contributions": [
{
"table_id": "<string>",
"label": "<string>",
"total": "<string>",
"components": [
{
"id": "<string>",
"label": "<string>",
"base": "<string>",
"rate": "<string>",
"amount": "<string>"
}
]
}
],
"dsl_version": "2024.2",
"computed_at": "2023-11-07T05:31:56Z",
"status": "success",
"audit_trail": [
{}
],
"period_basis": {
"type": "biweekly",
"sequence": 1,
"periods_in_month": 2,
"factor": "0.5",
"absorbs_residual": false,
"monthly_equivalent": {
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"proration": "native"
},
"record": {
"rule_fingerprint": "sha256:b90834cebdc4224c3...",
"engine_version": "<string>",
"schema_version": 123,
"content_digest": "<string>",
"stored": true,
"batch_id": "<string>",
"supersedes_id": "<string>",
"metadata": {}
},
"warnings": [
{
"code": "FLAG_THRESHOLD_MISMATCH",
"field": "overrides.aplica_auxilio_transporte",
"message": "<string>",
"severity": "warning"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Retrieve a stored calculation
Returns the calculation exactly as it was answered, including the rules that produced it (record.rule_fingerprint). Nothing is recomputed: payroll rules change, and a past payslip must not.
Add ?include=audit_trail for the step-by-step trace. The trace is always stored, whatever options.include_audit_trail asked to be shown when the calculation ran.
curl --request GET \
--url https://api.example.com/v1/payroll/calculations/{calculation_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/payroll/calculations/{calculation_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/payroll/calculations/{calculation_id}', 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.example.com/v1/payroll/calculations/{calculation_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payroll/calculations/{calculation_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/payroll/calculations/{calculation_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payroll/calculations/{calculation_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "01HX9B2KM3V4W5X6Y7Z8A9B0CD",
"country": "<string>",
"scheme": "<string>",
"year": 123,
"period": {
"type": "monthly",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
"days": 30
},
"employee_id": "<string>",
"summary": {
"gross_salary": "<string>",
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"perceptions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"taxable": true,
"imss_base": true,
"tags": [
"<string>"
]
}
],
"deductions": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"tags": [
"<string>"
],
"bracket_applied": {}
}
],
"taxable_bases": [
{
"id": "<string>",
"label": "<string>",
"amount": "<string>",
"formula": "<string>"
}
],
"employer_contributions": [
{
"table_id": "<string>",
"label": "<string>",
"total": "<string>",
"components": [
{
"id": "<string>",
"label": "<string>",
"base": "<string>",
"rate": "<string>",
"amount": "<string>"
}
]
}
],
"dsl_version": "2024.2",
"computed_at": "2023-11-07T05:31:56Z",
"status": "success",
"audit_trail": [
{}
],
"period_basis": {
"type": "biweekly",
"sequence": 1,
"periods_in_month": 2,
"factor": "0.5",
"absorbs_residual": false,
"monthly_equivalent": {
"total_perceptions": "<string>",
"total_deductions": "<string>",
"net_salary": "<string>",
"employer_contributions_total": "<string>",
"employer_total_cost": "<string>"
},
"proration": "native"
},
"record": {
"rule_fingerprint": "sha256:b90834cebdc4224c3...",
"engine_version": "<string>",
"schema_version": 123,
"content_digest": "<string>",
"stored": true,
"batch_id": "<string>",
"supersedes_id": "<string>",
"metadata": {}
},
"warnings": [
{
"code": "FLAG_THRESHOLD_MISMATCH",
"field": "overrides.aplica_auxilio_transporte",
"message": "<string>",
"severity": "warning"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API key authentication. Send your API key as: Authorization: Bearer <your_api_key>
Path Parameters
Calculation id (ULID).
Query Parameters
Set to audit_trail to include the step-by-step trace.
Response
The stored calculation.
Full single-employee payroll calculation result.
All monetary values are JSON strings. Parse with your language's Decimal library before doing any arithmetic.
Globally unique calculation ID (ULID). Stable and sortable by time.
"01HX9B2KM3V4W5X6Y7Z8A9B0CD"
Payroll period definition.
Show child attributes
Show child attributes
Employee ID echoed from the request.
High-level financial summary of the payroll calculation.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Version string of the DSL rule set used for this calculation.
"2024.2"
UTC timestamp when this calculation was performed.
"success"Step-by-step calculation trace. Each step shows the formula, resolved inputs, and result. Null when include_audit_trail=false.
Which slice of a liquidated month these figures are, and what the whole month came to. Present on every calculation.
Show child attributes
Show child attributes
Storage and provenance of this calculation: what rules produced it, which engine build ran, and how to verify later that it has not changed.
Show child attributes
Show child attributes
Non-fatal diagnostics about this calculation. Every amount above already reflects the request as sent; a warning flags an input that contradicts the salary the engine used, so the caller can check it. Empty when the request is coherent.
Show child attributes
Show child attributes