Payroll API
v1 Guides MK Get started

Payroll API

Payslips

POST /v1/payslips renders a payslip PDF from a calculation result — normally the exact object POST /v1/calculations gave you — plus the employee, employer and period it’s for.

curl -X POST "https://api.payroll.merot.com/v1/payslips" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const response = await fetch("https://api.payroll.merot.com/v1/payslips", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
    "https://api.payroll.merot.com/v1/payslips",
    headers={
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
    },
    json={},
)

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/payslips', [
    'headers' => [
        'Authorization' => 'Bearer YOUR_API_KEY',
        'Content-Type' => 'application/json',
    ],
    'json' => [],
]);

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/payslips");
request.Headers.Add("Authorization", "Bearer YOUR_API_KEY");
var json = /* lang=json */ @"{}";
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/payslips"))
    .headers("Authorization", "Bearer YOUR_API_KEY", "Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString(/* JSON */ "{}"))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

The response is the PDF directly (application/pdf); there’s nothing to poll. language selects MK, SQ or EN — the amounts and field labels are translated, the numbers are not recalculated.

Note

Payslip generation is new for this API’s v1 and shares the same PDF rendering used by Merot HRS and Merot ERP payslips.