Altera uma filial (só os campos enviados).
curl --request PATCH \
--url https://economy.synxbr.com/api/v1/branches/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"tax_id": "<string>",
"is_headquarters": true,
"email": "<string>",
"phone": "<string>",
"address": {
"zip_code": "<string>",
"street": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>"
},
"is_active": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
tax_id: '<string>',
is_headquarters: true,
email: '<string>',
phone: '<string>',
address: {
zip_code: '<string>',
street: '<string>',
district: '<string>',
city: '<string>',
state: '<string>'
},
is_active: true
})
};
fetch('https://economy.synxbr.com/api/v1/branches/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/branches/{id}"
payload = {
"name": "<string>",
"code": "<string>",
"tax_id": "<string>",
"is_headquarters": True,
"email": "<string>",
"phone": "<string>",
"address": {
"zip_code": "<string>",
"street": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>"
},
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/branches/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'code' => '<string>',
'tax_id' => '<string>',
'is_headquarters' => true,
'email' => '<string>',
'phone' => '<string>',
'address' => [
'zip_code' => '<string>',
'street' => '<string>',
'district' => '<string>',
'city' => '<string>',
'state' => '<string>'
],
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"tax_id": "<string>",
"is_headquarters": true,
"is_active": true,
"email": "<string>",
"phone": "<string>",
"address": {
"zip_code": "<string>",
"street": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"installments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"generated_titles": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}Altera uma filial (só os campos enviados).
Campo que não vem não muda; texto vazio ou null limpa um campo opcional. Marcar is_headquarters: true faz desta filial a matriz e desmarca a anterior. A matriz não se desativa: marque outra como matriz antes. Filial inativa não vira matriz.
Permissão exigida: Gerenciar filiais (company.branches.manage).
PATCH
/
branches
/
{id}
Altera uma filial (só os campos enviados).
curl --request PATCH \
--url https://economy.synxbr.com/api/v1/branches/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"tax_id": "<string>",
"is_headquarters": true,
"email": "<string>",
"phone": "<string>",
"address": {
"zip_code": "<string>",
"street": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>"
},
"is_active": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
tax_id: '<string>',
is_headquarters: true,
email: '<string>',
phone: '<string>',
address: {
zip_code: '<string>',
street: '<string>',
district: '<string>',
city: '<string>',
state: '<string>'
},
is_active: true
})
};
fetch('https://economy.synxbr.com/api/v1/branches/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/branches/{id}"
payload = {
"name": "<string>",
"code": "<string>",
"tax_id": "<string>",
"is_headquarters": True,
"email": "<string>",
"phone": "<string>",
"address": {
"zip_code": "<string>",
"street": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>"
},
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/branches/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'code' => '<string>',
'tax_id' => '<string>',
'is_headquarters' => true,
'email' => '<string>',
'phone' => '<string>',
'address' => [
'zip_code' => '<string>',
'street' => '<string>',
'district' => '<string>',
'city' => '<string>',
'state' => '<string>'
],
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"tax_id": "<string>",
"is_headquarters": true,
"is_active": true,
"email": "<string>",
"phone": "<string>",
"address": {
"zip_code": "<string>",
"street": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"installments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"generated_titles": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}Autorizações
Corpo
application/json