Update Company Configurations API
curl --request PATCH \
--url https://api.pazy.io/v1.0/company/configurationsimport requests
url = "https://api.pazy.io/v1.0/company/configurations"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.pazy.io/v1.0/company/configurations', 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.pazy.io/v1.0/company/configurations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$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.pazy.io/v1.0/company/configurations"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.pazy.io/v1.0/company/configurations")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/company/configurations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyCompany APIs
Update Company Configurations API
Update one or more organization configuration settings
Update Company Configurations API
curl --request PATCH \
--url https://api.pazy.io/v1.0/company/configurationsimport requests
url = "https://api.pazy.io/v1.0/company/configurations"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.pazy.io/v1.0/company/configurations', 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.pazy.io/v1.0/company/configurations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$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.pazy.io/v1.0/company/configurations"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.pazy.io/v1.0/company/configurations")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/company/configurations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
All requests require an API key in the request headers. Headers:Authorization: Api-Key YOUR_API_KEY
Content-Type: application/json
Request
Content-Type:application/json
Update one or more settings by sending their key and new value. The available keys, their input type, and the allowed options are returned by the Company Configurations API.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
settings | array | Yes | List of settings to update. Must contain at least one item |
settings[].key | string | Yes | Identifier of the setting to update (from the Company Configurations API) |
settings[].value | object | Yes | New value, wrapped in an object: { "value": <newValue> }. The inner value type must match the setting’s type (see below) |
Value Format
Thevalue must be an object whose inner value field matches the setting type:
Setting type | Inner value type | Example |
|---|---|---|
TOGGLE | boolean | { "value": true } |
NUMBER | number | { "value": 30 } |
SELECT | string (one of the setting’s options) | { "value": "MULTI" } |
TEXT | string | { "value": "Custom text" } |
MULTISELECT | array of strings (each from the setting’s options) | { "value": ["cost-centre", "department"] } |
Code Examples
curl -X PATCH https://api.pazy.io/v1.0/company/configurations \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"settings": [
{ "key": "IS_ROUND_OFF_ENABLED", "value": { "value": true } },
{ "key": "LINE_ITEM_PARSING_MODE", "value": { "value": "MULTI" } }
]
}'
const response = await fetch('https://api.pazy.io/v1.0/company/configurations', {
method: 'PATCH',
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
settings: [
{ key: 'IS_ROUND_OFF_ENABLED', value: { value: true } },
{ key: 'LINE_ITEM_PARSING_MODE', value: { value: 'MULTI' } }
]
})
});
const result = await response.json();
import requests
url = "https://api.pazy.io/v1.0/company/configurations"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"settings": [
{ "key": "IS_ROUND_OFF_ENABLED", "value": { "value": True } },
{ "key": "LINE_ITEM_PARSING_MODE", "value": { "value": "MULTI" } }
]
}
response = requests.patch(url, headers=headers, json=payload)
result = response.json()
Success Response
HTTP Status:200 OK
Valid settings are applied even if some entries in the request fail validation. Settings that fail validation are skipped and reported in misConfigurations — always inspect this array to confirm every setting was applied.
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was processed |
data | object | Contains the update result |
data.context | object | Update result metadata |
data.context.patchedCount | number | Number of settings that were successfully updated |
data.context.misConfigurations | array | Settings that failed validation and were skipped |
data.context.misConfigurations[].key | string | Key of the skipped setting |
data.context.misConfigurations[].value | object | The rejected value |
data.context.misConfigurations[].message | string | Reason the value was rejected |
data.context.misConfigurations[].options | array | Allowed option values for the setting, when applicable |
Response Example
{
"ok": true,
"data": {
"context": {
"patchedCount": 2,
"misConfigurations": []
}
}
}
Response Example (with a skipped setting)
{
"ok": true,
"data": {
"context": {
"patchedCount": 1,
"misConfigurations": [
{
"key": "LINE_ITEM_PARSING_MODE",
"value": { "value": "INVALID_OPTION" },
"message": "Value should be one of this options",
"options": ["MULTI", "TAX_BASED", "SINGLE"]
}
]
}
}
}
Error Responses
Setting Not Editable / Update Rejected
When a requested setting is read-only, or a value-specific rule fails (for example, an invalid active-currency change), the update is rejected as a whole. This is returned with an HTTP200 OK status, ok: false, and an errorData object — no settings are updated in this case.
HTTP Status: 200 OK
{
"ok": false,
"errorData": {
"isError": true,
"error": "Key not editable"
}
}
Validation Error
Returned when the request body is malformed — for example,settings is missing or empty, or an item is missing key or value.
HTTP Status: 400 Bad Request
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed: /body: must have required property 'settings'"
}
}
Access Denied
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "ACCESS_DENIED",
"message": "Access denied: Resource can be updated only by admins and bookkeepers"
}
}
Authentication Errors
HTTP Status:401 Unauthorized
{
"ok": false,
"error": {
"code": "MISSING_CREDENTIALS",
"message": "Missing Credentials"
}
}
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API Key"
}
}
Permission Errors
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "INSUFFICIENT_PERMISSIONS",
"message": "Permission check failed - PERMISSION_CHECK_FAILED"
}
}
Internal Error
HTTP Status:500 Internal Server Error
{
"ok": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal error"
}
}
Best Practices
- Always wrap the new value in an object:
{ "value": <newValue> }— sending a bare value will fail validation - Fetch the Company Configurations API first to get valid
keyvalues, the expectedtype, and the allowedoptions - Check
data.context.misConfigurationsafter each call — valid settings are still applied even when other entries are skipped, so a200 OKwithok: truedoes not guarantee every setting changed - Treat a
200 OKresponse withok: falseand anerrorDataobject as a full rejection — no settings were updated - Access is limited to users with organization update permission and an admin or bookkeeper role
Was this page helpful?