Assign branch to a payroll (v2)
curl --request PUT \
--url https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e"
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch_id: '7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e'})
};
fetch('https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch"
payload = { "branch_id": "7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'branch_id' => '7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"id": "5f0e8d1a-3c2b-4a7e-9d4f-6b1c2a3e4f50",
"branch_id": "7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e"
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"code": "payroll_not_found",
"message": "Payroll not found"
}{
"status": false,
"code": "invalid_branch",
"message": "La sucursal no pertenece al negocio.",
"errors": {
"branch_id": [
"La sucursal no pertenece al negocio."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}Assign branch to a payroll (v2)
Assigns (or removes with null) the branch of a payroll. If the business enabled Payrolls by branch in HR, the branch is required. Exists only in v2.
Required permission: hr.payrolls.write
PUT
/
v2
/
hr
/
payrolls
/
{id}
/
branch
Assign branch to a payroll (v2)
curl --request PUT \
--url https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e"
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch_id: '7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e'})
};
fetch('https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch"
payload = { "branch_id": "7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/v1/v2/hr/payrolls/{id}/branch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'branch_id' => '7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"id": "5f0e8d1a-3c2b-4a7e-9d4f-6b1c2a3e4f50",
"branch_id": "7c1d4e2a-9b3f-4a6e-8d5c-0f2a1b3c4d5e"
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"code": "payroll_not_found",
"message": "Payroll not found"
}{
"status": false,
"code": "invalid_branch",
"message": "La sucursal no pertenece al negocio.",
"errors": {
"branch_id": [
"La sucursal no pertenece al negocio."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}Authorizations
Integration API Key (Integrations → New Integration).
Path Parameters
Body
application/json
Branch of the payroll. null = general payroll of the business (the business does not use payrolls by branch or predates the adjustment).
Response
Success