Settings
The /settings endpoint reads and updates the account settings that affect documents issued through the API: the date format and document numbering.
Required scopes: settings:read (read) and settings:update (write).
Reading settings
curl -s https://prod.api.fakturnia.pl/external/v1/settings \
-H "Authorization: Bearer $TOKEN"
{
"success": true,
"data": {
"general": {
"dateFormat": "dd.MM.yyyy",
"newsletter": true,
"dateFormatOptions": ["dd.MM.yyyy", "yyyy-MM-dd", "..."]
},
"numbering": {
"numberingType": "MONTH",
"numberingFormat": "/MM/YYYY",
"numberingTypeOptions": ["MONTH", "YEAR"],
"numberingFormatOptions": ["/MM/YYYY", "/YYYY", "..."],
"documentSymbols": { "FakturaVAT": "FV", "FakturaKorygujaca": "KOR" }
}
}
}
The *Options fields list the accepted values for writes. Treat them like a dictionary: fetch them before showing a form to the user instead of hardcoding values.
General settings
curl -s -X PATCH https://prod.api.fakturnia.pl/external/v1/settings/general \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "dateFormat": "yyyy-MM-dd" }'
| Field | Meaning |
|---|---|
dateFormat |
date format on document PDFs, one of dateFormatOptions |
newsletter |
product newsletter consent (true/false) |
Document numbering
curl -s -X PATCH https://prod.api.fakturnia.pl/external/v1/settings/numbering \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"numberingType": "MONTH",
"numberingFormat": "/MM/YYYY",
"documentSymbols": { "FakturaVAT": "FV", "FakturaKorygujaca": "KOR" }
}'
| Field | Meaning |
|---|---|
numberingType |
MONTH (counter resets monthly) or YEAR (resets yearly) |
numberingFormat |
number suffix format, one of numberingFormatOptions |
documentSymbols |
the number symbol (prefix) for each document type |
All three fields are required in this request. With numberingType: "MONTH" the format must contain MM, otherwise you get a 400.
Numbering works together with automatic number assignment when creating documents: if you omit the number, the API assigns the next one according to these settings.