Skip to content

v1.1.0

Choose a tag to compare

@rockedcs rockedcs released this 24 Mar 12:35
· 9 commits to main since this release

This release updates the default B2BRouter API version from 2025-10-13 to 2026-03-02.

This is a safe upgrade. The SDK's PHP interface is unchanged. If you're not ready to adopt the new API version, pin the previous one:

$client = new B2BRouterClient('your-api-key', [
    'api_version' => '2025-10-13',
]);

What changed in the SDK

  • Default API version updated to 2026-03-02
  • Request ID header updated to X-B2B-API-Request-Id (falls back to X-Request-Id for older API versions)
  • Added versioning policy documentation
  • New example: use_previous_api_version.php

API version 2026-03-02 migration guide

The following changes apply only if you use API version 2026-03-02 (the new default).

Removed invoice fields

Use allowance_charges_attributes instead:

  • discount_amount, discount_percent, discount_textallowance_charge_indicator: "allowance"
  • charge_amount, charge_percent, charge_reasonallowance_charge_indicator: "charge"
  • apply_taxes_to_charge → individual apply_taxes per allowance/charge
  • charge_is_reimbursable_expense → individual is_reimbursable_expense per allowance/charge

Same removals apply to invoice line fields (discount_*, charge_*).

Invoice search: taxcode replaced by query

// Before (API 2025-10-13)
$invoices = $client->invoices->all($accountId, ['taxcode' => 'ESB12345678']);

// After (API 2026-03-02)
$invoices = $client->invoices->all($accountId, ['query' => 'tin_value=ESB12345678']);

Other API changes

  • type_document renamed to type_code on invoices
  • Scheme fields (tin_scheme, cin_scheme, pin_scheme) now return zero-padded 4-char strings (e.g., "0007" instead of 7)
  • POST create endpoints return 201 Created instead of 200 OK (SDK handles this transparently)
  • contact_id ignored for IssuedSimplifiedInvoice
  • Contact is_provider defaults to true when creating via API

New API fields (automatic, no SDK changes needed)

  • Invoice: base_quantity, tax_currency_code, tax_amount_in_tax_currency, payments_on_account
  • TaxReport: annulled_by_id, corrected_by_id, KSeF-specific fields
  • TaxReportLine: item_seller_identifier, item_standard_identifier
  • BankAccount: is_default

Upgrade

composer update b2brouter/b2brouter-php

Full changelog: v1.0.0...v1.1.0