Documentation for 4.0 (pre-release). Using 3.x? See the README on main.
Skip to content

Settings (Einstellungen / account settings) ​

API wrapper for the account-wide settings at /settings. Holds the defaults for number ranges, document texts, client portal colors and more.

Access ​

php
$billomat->settings

Justpilot\Billomat\Api\SettingsApi.

Endpoints ​

MethodHTTPPath
get()GET/settings
update($options)PUT/settings

There is no list/create/delete; settings are a singleton per account.

Methods ​

get(): Settings ​

php
$settings = $billomat->settings->get();

echo $settings->currencyCode;           // e.g. "EUR"
echo $settings->invoiceNumberPre;       // e.g. "RE-"
echo $settings->dueDays;                // e.g. 14

Throws UnexpectedResponseException if the response doesn't contain a settings object (shouldn't happen in practice).

update(SettingsUpdateOptions $options): Settings ​

Partial update. Only fields that are not null in SettingsUpdateOptions are sent. Returns the updated settings; throws UnexpectedResponseException like get().

php
use Justpilot\Billomat\Api\SettingsUpdateOptions;
use Justpilot\Billomat\Model\Enum\NetGross;

$opts = new SettingsUpdateOptions(
    dueDays: 21,
    netGross: NetGross::NET,
    defaultEmailSender: 'invoices@mycompany.com',
);

$updated = $billomat->settings->update($opts);

Write model: SettingsUpdateOptions ​

Only the writable fields are included; read-only fields such as *_number_next, created and updated are deliberately missing. Like all write models the class is final readonly: pass fields as named constructor arguments, and use the with*() methods (e.g. $opts->withDueDays(30)) to get a modified copy.

null means "don't send", the value stays unchanged. Every scalar field also accepts Clear::Field (Justpilot\Billomat\Api\Clear): the field is then sent as JSON null and Billomat clears it, e.g. new SettingsUpdateOptions(defaultEmailSender: Clear::Field). The types below omit |Clear for readability.

Client portal and branding ​

PropertyBillomat fieldType
bgcolorbgcolor?string (hex)
color1color1?string (hex)
color2color2?string (hex)
color3color3?string (hex)

Language, currency, price basis ​

PropertyBillomat fieldType
currencyCodecurrency_code?string
localelocale?string (e.g. de_DE)
netGrossnet_gross?NetGross

SEPA and number ranges ​

PropertyBillomat fieldType
sepaCreditorIdsepa_creditor_id?string
numberRangeModenumber_range_mode?NumberRangeMode

Article numbers and price groups ​

PropertyBillomat fieldType
articleNumberPrearticle_number_pre?string
articleNumberLengtharticle_number_length?int
priceGroupsprice_group2, price_group3, …array<int,string> (index → name; empty array = don't send)

Client numbers ​

PropertyBillomat fieldType
clientNumberPreclient_number_pre?string
clientNumberLengthclient_number_length?int

Invoice defaults ​

PropertyBillomat fieldType
invoiceNumberPreinvoice_number_pre?string
invoiceNumberLengthinvoice_number_length?int
invoiceLabelinvoice_label?string
invoiceIntroinvoice_intro?string
invoiceNoteinvoice_note?string
invoiceFilenameinvoice_filename?string
dueDaysdue_days?int
discountRatediscount_rate?float (percent)
discountDaysdiscount_days?int

Offer defaults ​

PropertyBillomat fieldType
offerNumberPreoffer_number_pre?string
offerNumberLengthoffer_number_length?int
offerLabel, offerIntro, offerNote, offerFilenameoffer_label, offer_intro, offer_note, offer_filename?string
offerValidityDaysoffer_validity_days?int

Confirmations, credit notes, delivery notes ​

Each of the three document types has the same block (x = confirmation, creditNote, deliveryNote; Billomat fields confirmation_*, credit_note_*, delivery_note_*):

PropertyBillomat fieldType
xNumberPrex_number_pre?string
xNumberLengthx_number_length?int
xLabel, xIntro, xNote, xFilenamex_label, x_intro, x_note, x_filename?string

Reminders and letters ​

PropertyBillomat fieldType
reminderFilenamereminder_filename?string
reminderDueDaysreminder_due_days?int
letterLabel, letterIntro, letterFilenameletter_label, letter_intro, letter_filename?string
PropertyBillomat fieldType
printVersionprint_version?bool (serialized as 1/0)
defaultEmailSenderdefault_email_sender?string
bccAddressesbcc_addresseslist<string> (sent as a comma-separated string; empty list = don't send)
taxationtaxation?string

Read model: Settings ​

final readonly class Settings. About 60 properties; the main groups:

Metadata ​

PropertyType
created, updated?\DateTimeImmutable

Account basics ​

PropertyType
bgcolor, color1, color2, color3?string
currencyCode, locale?string
netGross?NetGross
sepaCreditorId?string
numberRangeMode?NumberRangeMode

Number ranges (prefix, length, read-only "next") ​

Each document type has a block xNumberPre (?string), xNumberLength (?int) and xNumberNext (?int, read-only):

  • articleNumberPre/Length/Next
  • clientNumberPre/Length/Next
  • invoiceNumberPre/Length/Next
  • offerNumberPre/Length/Next
  • confirmationNumberPre/Length/Next
  • creditNoteNumberPre/Length/Next
  • deliveryNoteNumberPre/Length/Next

Document texts ​

Each document type has xLabel, xIntro, xNote, xFilename:

  • invoiceLabel, invoiceIntro, invoiceNote, invoiceFilename
  • the same for offer, confirmation, creditNote, deliveryNote
  • reminderFilename, reminderDueDays
  • letterLabel, letterIntro, letterFilename

Terms ​

PropertyType
dueDays?int
discountRate?float
discountDays?int
offerValidityDays?int

Other ​

PropertyTypeNotes
priceGroupsarray<int,string>Keyed by price group number (e.g. 2 => "Preisgruppe 2")
templateEngine?TemplateEngine
printVersion?bool
defaultEmailSender?string
bccAddresseslist<string>Normalized from the CSV/list format Billomat returns
taxation?string

Settings::fromArray() normalizes the types: Billomat sends many values as strings ("14", "1", …), and the model casts them to int/float/bool/DateTimeImmutable.

Enums ​

  • NetGross: NET, GROSS, SETTINGS.
  • NumberRangeMode: IGNORE_PREFIX, CONSIDER_PREFIX. Controls whether number prefixes get their own number range.
  • TemplateEngine: DEFAULT.
  • ValueType: SETTINGS, ABSOLUTE, RELATIVE — not used in settings directly, but a related value type for clients/invoices.

Pitfalls ​

  • Read-only fields can't be set. Fields like *NumberNext or created/updated can't be changed via PUT, so SettingsUpdateOptions doesn't offer them at all.
  • printVersion is a ?bool. Billomat expects 1/0; the SDK converts automatically.
  • priceGroups is assembled on read. Billomat sends separate fields price_group2, price_group3, … Settings::fromArray() collects them into an array keyed by the price group number; SettingsUpdateOptions splits them up again.
  • bccAddresses as CSV. Billomat returns the list either as a comma-separated string or as nested bcc_address nodes. The model normalizes both to list<string>; on write the SDK sends a comma-separated string.
  • locale doesn't affect the SDK. Changing locale doesn't change the SDK's Accept-Language header; that comes from BillomatConfig::$language (default de-de).

End-to-end example ​

php
<?php

declare(strict_types=1);

require __DIR__ . '/vendor/autoload.php';

use Justpilot\Billomat\Api\SettingsUpdateOptions;
use Justpilot\Billomat\BillomatClient;
use Justpilot\Billomat\Model\Enum\NetGross;
use Justpilot\Billomat\Model\Enum\NumberRangeMode;

$billomat = BillomatClient::create(
    billomatId: 'mycompany',
    apiKey: getenv('BILLOMAT_API_KEY'),
);

// Read the current settings
$current = $billomat->settings->get();
printf("Current default due days: %d\n", $current->dueDays ?? 0);
printf("Number range mode: %s\n", $current->numberRangeMode?->value ?? 'unknown');

// Change them
$opts = new SettingsUpdateOptions(
    dueDays: 21,
    netGross: NetGross::NET,
    numberRangeMode: NumberRangeMode::CONSIDER_PREFIX,
    defaultEmailSender: 'invoices@mycompany.com',
);

$updated = $billomat->settings->update($opts);
printf("New due days saved: %d\n", $updated->dueDays ?? 0);

Unofficial SDK, not affiliated with Billomat GmbH. Released under the Apache License 2.0.