Make a sample payslip in your brand draft
Returns a made-up payslip as a PDF, drawn in your account’s unpublished brand draft, so you can see a brand before you publish it. Send nothing to draw the saved draft, or send unsaved changes to draw them without saving. The account comes from your credentials. Nothing is stored and nothing is sent.
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/payslip/samples \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"primaryColour": "#0B7A75",
"documentsShowProductName": false
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/payslip/samples"
payload = {
"primaryColour": "#0B7A75",
"documentsShowProductName": False
}
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({primaryColour: '#0B7A75', documentsShowProductName: false})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/payslip/samples', 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/payslip/samples",
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([
'primaryColour' => '#0B7A75',
'documentsShowProductName' => false
]),
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/payslip/samples"
payload := strings.NewReader("{\n \"primaryColour\": \"#0B7A75\",\n \"documentsShowProductName\": false\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/payslip/samples")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"primaryColour\": \"#0B7A75\",\n \"documentsShowProductName\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/payslip/samples")
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 \"primaryColour\": \"#0B7A75\",\n \"documentsShowProductName\": false\n}"
response = http.request(request)
puts response.read_body"<string>"{
"message": {
"text": "The changes to preview could not be read. Reload the page and try again.",
"token": "payslip_sample_changes_invalid"
}
}{
"message": {
"text": "Your sign-in is not linked to an account, so there is no brand to show. Sign out, sign back in and try again.",
"token": "payslip_sample_no_account"
}
}{
"message": {
"text": "There is no saved brand draft yet, so no sample payslip was made. Save your brand, then try again.",
"token": "payslip_sample_no_draft"
}
}{
"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).
Query Parameters
Send sample to draw it as an organisation with its own logo sees it, with a made-up company logo and your brand as "Powered by".
sample Body
Unsaved changes to the brand draft, in the shape of the Administration API's brand draft merge patch without version. Up to 16 KB. Every field is checked as a save would check it.
The body is of type object.
Response
The sample payslip PDF
The response is of type file.
Was this page helpful?
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/payslip/samples \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"primaryColour": "#0B7A75",
"documentsShowProductName": false
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/payslip/samples"
payload = {
"primaryColour": "#0B7A75",
"documentsShowProductName": False
}
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({primaryColour: '#0B7A75', documentsShowProductName: false})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/payslip/samples', 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/payslip/samples",
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([
'primaryColour' => '#0B7A75',
'documentsShowProductName' => false
]),
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/payslip/samples"
payload := strings.NewReader("{\n \"primaryColour\": \"#0B7A75\",\n \"documentsShowProductName\": false\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/payslip/samples")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"primaryColour\": \"#0B7A75\",\n \"documentsShowProductName\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/payslip/samples")
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 \"primaryColour\": \"#0B7A75\",\n \"documentsShowProductName\": false\n}"
response = http.request(request)
puts response.read_body"<string>"{
"message": {
"text": "The changes to preview could not be read. Reload the page and try again.",
"token": "payslip_sample_changes_invalid"
}
}{
"message": {
"text": "Your sign-in is not linked to an account, so there is no brand to show. Sign out, sign back in and try again.",
"token": "payslip_sample_no_account"
}
}{
"message": {
"text": "There is no saved brand draft yet, so no sample payslip was made. Save your brand, then try again.",
"token": "payslip_sample_no_draft"
}
}{
"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>"
}
]
}
]
}