Payroll API
Quickstart
1. Get a sandbox key
—
sandbox keys are issued as we onboard accounts; self-serve signup is coming to this site. Once you
have one, a sandbox key looks like mpk_test_....
2. Calculate a payroll
POST /v1/calculations takes either grossSalary (gross-first — the normal case under MK labour
law) or targetNet (net-first), plus any special hours, seniority, or leave carve-outs, and
returns every contribution, the personal income tax, and the net pay. No Idempotency-Key is
needed — this endpoint has no side effects; see Idempotency.
curl -X POST "https://api.payroll.merot.com/v1/calculations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"grossSalary": "45000",
"workingHours": 176,
"overtimeHours": 8,
"nightHours": 4
}' const response = await fetch("https://api.payroll.merot.com/v1/calculations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"grossSalary": "45000",
"workingHours": 176,
"overtimeHours": 8,
"nightHours": 4
}),
});
const data = await response.json();
console.log(data); import requests
response = requests.post(
"https://api.payroll.merot.com/v1/calculations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"grossSalary": "45000",
"workingHours": 176,
"overtimeHours": 8,
"nightHours": 4
},
)
print(response.json()) <?php
// composer require guzzlehttp/guzzle
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.payroll.merot.com/v1/calculations', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Content-Type' => 'application/json',
],
'json' => [
'grossSalary' => '45000',
'workingHours' => 176,
'overtimeHours' => 8,
'nightHours' => 4,
],
]);
echo $response->getBody(); using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.payroll.merot.com/v1/calculations");
request.Headers.Add("Authorization", "Bearer YOUR_API_KEY");
var json = /* lang=json */ @"{
""grossSalary"": ""45000"",
""workingHours"": 176,
""overtimeHours"": 8,
""nightHours"": 4
}";
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body); import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.payroll.merot.com/v1/calculations"))
.headers("Authorization", "Bearer YOUR_API_KEY", "Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(/* JSON */ "{ \"grossSalary\": \"45000\", \"workingHours\": 176, \"overtimeHours\": 8, \"nightHours\": 4 }"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body()); The response’s salaryGross includes the overtime and night premiums folded into the
contributory and taxable base; netPaid is what actually gets paid out after any post-net
deductions. See MK payroll concepts for what each field means.
Note
Every number in these docs — including this example — comes from actually running the calculator, not from hand computation.
Next steps
- MK payroll concepts — gross-first vs net-first, contributions and tax.
- МПИН, е-ППД and ПДД-ГИ files — generate the files UJP expects.
- Payslips — render a PDF from a calculation result.
- Full API reference — every endpoint, field and error.