Journal templates
Preview a journal template
Preview the journal a template would produce for a pay run, as structured data.
POST
/
templates
/
{templateId}
/
preview
Preview a journal template
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview"
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'X-Org-Id': '<api-key>'}
};
fetch('https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview', 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/journal/templates/{templateId}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
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/journal/templates/{templateId}/preview")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview")
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>'
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"journal": {
"id": "<string>",
"organisationId": "<string>",
"payrollConfigId": "<string>",
"taxYear": 123,
"taxPeriod": 123,
"payDate": "<string>",
"frequency": "<string>",
"version": 123,
"templateId": "<string>",
"sumDebit": 123,
"sumCredit": 123,
"isBalanced": true,
"isFinalised": true,
"failureReason": "<string>",
"createdBy": "<string>",
"createdDate": "<string>",
"updatedBy": "<string>",
"updatedDate": "<string>",
"settled": true,
"incorporatedPayslipVersion": "<string>"
},
"lines": [
{
"lineSequence": 123,
"accountCode": "<string>",
"description": "<string>",
"debit": 123,
"credit": 123,
"narration": "<string>",
"employeeAttribution": "<string>",
"dimensions": [
{
"name": "<string>",
"value": "<string>"
}
],
"groupLabel": "<string>",
"fellBackToDefault": true,
"taxCode": "<string>"
}
],
"reconciliation": {
"sumDebit": 123,
"sumCredit": 123,
"imbalance": 123,
"isBalanced": true,
"imbalancePerNominal": [
{
"accountCode": "<string>",
"sumDebit": 123,
"sumCredit": 123,
"imbalance": 123
}
]
},
"unassignedLineCount": 123,
"unassignedEmployeeIds": [
"<string>"
],
"unmappedValueLineCount": 123,
"unmappedValueEmployeeIds": [
"<string>"
],
"unmappedAccountLineCount": 123,
"unmappedAccountEmployeeIds": [
"<string>"
],
"unmappedAccountPayItems": [
"<string>"
],
"unmappedAccountAmount": 123,
"unmappedControlAccountLineCount": 123,
"unmappedControlAccountEmployeeIds": [
"<string>"
],
"unbalancedEmployees": [
{
"employeeId": "<string>",
"name": "<string>",
"payrollId": "<string>",
"netImbalance": 123
}
],
"unbalancedAmount": 123,
"unmappedControlAccountNames": [
"<string>"
],
"unmappedControlAccountAmount": 123,
"employees": [
{
"employeeId": "<string>",
"name": "<string>",
"payrollId": "<string>"
}
],
"summary": {
"byNominal": [
{
"accountCode": "<string>",
"description": "<string>",
"debit": 123,
"credit": 123
}
],
"byDepartment": [
{
"label": "<string>",
"debit": 123,
"credit": 123
}
],
"issueLineCount": 123,
"totalLineCount": 123
}
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}Authorizations
FlowPayroll JWT (raw token, no Bearer prefix)
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).
Path Parameters
Was this page helpful?
⌘I
Preview a journal template
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview"
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'X-Org-Id': '<api-key>'}
};
fetch('https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview', 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/journal/templates/{templateId}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
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/journal/templates/{templateId}/preview")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/journal/templates/{templateId}/preview")
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>'
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"journal": {
"id": "<string>",
"organisationId": "<string>",
"payrollConfigId": "<string>",
"taxYear": 123,
"taxPeriod": 123,
"payDate": "<string>",
"frequency": "<string>",
"version": 123,
"templateId": "<string>",
"sumDebit": 123,
"sumCredit": 123,
"isBalanced": true,
"isFinalised": true,
"failureReason": "<string>",
"createdBy": "<string>",
"createdDate": "<string>",
"updatedBy": "<string>",
"updatedDate": "<string>",
"settled": true,
"incorporatedPayslipVersion": "<string>"
},
"lines": [
{
"lineSequence": 123,
"accountCode": "<string>",
"description": "<string>",
"debit": 123,
"credit": 123,
"narration": "<string>",
"employeeAttribution": "<string>",
"dimensions": [
{
"name": "<string>",
"value": "<string>"
}
],
"groupLabel": "<string>",
"fellBackToDefault": true,
"taxCode": "<string>"
}
],
"reconciliation": {
"sumDebit": 123,
"sumCredit": 123,
"imbalance": 123,
"isBalanced": true,
"imbalancePerNominal": [
{
"accountCode": "<string>",
"sumDebit": 123,
"sumCredit": 123,
"imbalance": 123
}
]
},
"unassignedLineCount": 123,
"unassignedEmployeeIds": [
"<string>"
],
"unmappedValueLineCount": 123,
"unmappedValueEmployeeIds": [
"<string>"
],
"unmappedAccountLineCount": 123,
"unmappedAccountEmployeeIds": [
"<string>"
],
"unmappedAccountPayItems": [
"<string>"
],
"unmappedAccountAmount": 123,
"unmappedControlAccountLineCount": 123,
"unmappedControlAccountEmployeeIds": [
"<string>"
],
"unbalancedEmployees": [
{
"employeeId": "<string>",
"name": "<string>",
"payrollId": "<string>",
"netImbalance": 123
}
],
"unbalancedAmount": 123,
"unmappedControlAccountNames": [
"<string>"
],
"unmappedControlAccountAmount": 123,
"employees": [
{
"employeeId": "<string>",
"name": "<string>",
"payrollId": "<string>"
}
],
"summary": {
"byNominal": [
{
"accountCode": "<string>",
"description": "<string>",
"debit": 123,
"credit": 123
}
],
"byDepartment": [
{
"label": "<string>",
"debit": 123,
"credit": 123
}
],
"issueLineCount": 123,
"totalLineCount": 123
}
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}