Asignar sucursal a una planilla (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
}Asignar sucursal a una planilla (v2)
Asigna (o quita con null) la sucursal de una planilla. Si el negocio activó Planillas por sucursal en RRHH, la sucursal es obligatoria. Solo existe en v2.
Permiso requerido: hr.payrolls.write
PUT
/
v2
/
hr
/
payrolls
/
{id}
/
branch
Asignar sucursal a una planilla (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
API Key de la integración (Integraciones → Nueva Integración).
Path Parameters
Body
application/json
Sucursal de la planilla. null = planilla general del negocio (el negocio no maneja planillas por sucursal o es anterior al ajuste).
Response
Éxito