NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
B2Brouter PHP SDK - Official library for the B2Brouter API
Last release 4 months ago
25 May 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 6 of 6 stable releases
Nothing withdrawn
no release was ever pulled
10 months old
6 releases · first in 2025
One column per month.
This is a docs + default-version release. The SDK default API version moves to 2026-04-20 (minor bump per the versioning policy ), and the SDK now sel
This is a docs + default-version release. The SDK default API version moves to 2026-04-20 (minor bump per the versioning policy), and the SDK now self-identifies on every request via a User-Agent header.
User-Agent header on every request — the SDK identifies itself as B2BRouter-PHP/1.3.0 (PHP/{version}; curl/{version}). Applies to JSON and binary endpoints. No caller action required.app_info constructor option — applications that wrap the SDK (integrators, plugins) can identify themselves in the User-Agent header.B2BRouterClient::VERSION constant and B2BRouterClient::getUserAgent() getter.The SDK default api_version moves from 2026-03-02 to 2026-04-20. The PHP interface is unchanged; callers can pin the previous API version via the api_version config option.
The CHANGELOG [1.3.0] entry includes a full migration guide covering the 2026-04-20 API delta (invoice_references[] in place of flat amend fields, classification_code_scheme typo fix, removed payment_method_info response field, inline contact identifier requirement, stricter contact/parent_id validation, Peppol transport response shape changes, plus all new fields).
The CHANGELOG also notes that the new TIN verification endpoint and tin_verification.finished webhook event ship with v2026-04-20 but are not yet surfaced by the SDK.
identify_caller_app.phpdocs/VERSIONING.md adds a "Supported API versions" section// Identify your integrating app in the User-Agent header
$client = new B2BRouterClient('your-api-key', [
'app_info' => [
'name' => 'B2BRouter-WooCommerce',
'version' => '1.0.3',
'url' => 'https://shop.example.com',
],
]);
// Pin the previous API version if you need time to migrate
$client = new B2BRouterClient('your-api-key', [
'api_version' => '2026-03-02',
]);Full Changelog: v1.2.0...v1.3.0
User-Agent header on every request — the SDK now identifies itself with a header like B2BRouter-PHP/1.3.0 (PHP/8.2.10; curl/8.5.0). Applies to both JSON and binary endpoints. No caller action required.app_info constructor option — applications that wrap the SDK (e.g. integrators, plugins) can identify themselves in the User-Agent header:$client = new B2BRouterClient('sk_...', [
'app_info' => [
'name' => 'B2BRouter-WooCommerce', // required
'version' => '1.0.3', // optional
'url' => 'https://shop.example.com', // optional
],
]);
Produces: B2BRouter-PHP/1.3.0 (PHP/8.2.10; curl/8.5.0) B2BRouter-WooCommerce/1.0.3 (https://shop.example.com).B2BRouterClient::VERSION constant — the SDK version, also accessible at runtime.B2BRouterClient::getUserAgent() — returns the composed User-Agent string (lazy, cached).identify_caller_app.php2026-03-02 to 2026-04-202026-04-20 migration guideThe following changes apply only if you use API version 2026-04-20 (the new default). If you pin 'api_version' => '2026-03-02', your existing code continues to work unchanged.
To keep the previous API version:
$client = new B2BRouterClient('your-api-key', [
'api_version' => '2026-03-02',
]);
invoice_references[]The flat amend fields on invoices have been removed in favour of a structured invoice_references[] array. Each entry carries a reference_type (amend or prepayment) plus the reference data.
Removed fields: amended_number, amended_date, amended_invoicing_period_start, amended_invoicing_period_end, amend_reason, amend_code_tax, correction_method.
Before (API 2026-03-02):
$invoice = $client->invoices->create($accountId, [
'invoice' => [
// ...
'amended_number' => 'INV-2025-001',
'amended_date' => '2025-01-15',
'amend_reason' => 'Corrected line items',
],
]);
After (API 2026-04-20):
$invoice = $client->invoices->create($accountId, [
'invoice' => [
// ...
'invoice_references' => [
[
'reference_type' => 'amend',
'number' => 'INV-2025-001',
'date' => '2025-01-15',
'reason' => 'Corrected line items',
],
],
],
]);
clasification_code_scheme → classification_code_schemeThe misspelled clasification_code_scheme (single s) on invoice lines has been renamed to the correctly-spelled classification_code_scheme. Update any payloads that set this field.
payment_method_info is no longer returned. Use the structured fields instead: payment_method, contact_iban, contact_bic.
When creating an invoice with an inline contact block via POST /accounts/{account}/invoices, the contact must include either tin_value or cin_value. The only exception is IssuedSimplifiedInvoice. Previously the inline contact could be created without an identifier; this now returns 422 parameter_invalid.
tin_value / tin_scheme validated against parentWhen a contact is created or updated with parent_id set, tin_value and tin_scheme must match the parent contact's values. Mismatches now return 422 parameter_invalid (previously they were silently ignored).
The Peppol transport response replaces standard_documents and pending_peppol_directory_publish with three fields: sml_status, peppol_directory_status, reception_document_types. The SDK does not currently surface Peppol transports through a dedicated service, so this only affects callers parsing the raw response.
The B2BRouter 2026-04-20 platform release adds two capabilities that this SDK does not yet expose. They are noted here so callers are aware they exist at the API level; dedicated SDK support is planned for a future release.
POST /tin_verifications?country=es submits a batch of up to 20,000 TIN+name pairs for verification against the tax authority census (Spain / AEAT only at launch). The request returns 202 Accepted; results are retrieved with GET /tin_verifications/{id} or via webhook. A dedicated TinVerificationService is planned.tin_verification.finished webhook event — fired when a TIN verification batch reaches a terminal state (success or failed). The payload carries only id and status; use GET /tin_verifications/{id} to fetch the full results. Subscribe via the existing webhook configuration; no SDK helpers or event constants are provided yet.These fields are automatically available through the array-based response:
routing_codes (cin1_value/cin1_scheme … cin5_value/cin5_scheme), auto_remittance, skip_line_taxable_base_rounding.cin_value and cin_scheme on the contact object; exchange_rate, exchange_date, order_date (previously write-only, now returned); total_amount_due accepted as write-only input.apply_to_local_government_unit, apply_to_vat_group_member, third_party (expandable via ?include=).type_code (KSeF): ZAL, ROZ, KOR_ZAL, KOR_ROZ, KOR, VAT, UPR.customer_party_jst, customer_party_gv, purchase_order_date, despatch_advice_reference, supplier_party_krs, supplier_party_regon, supplier_party_bdo, supplier_contact_phone, supplier_contact_email, previous_advance_total, order_total_amount, prepayment_references[], writable third_party_*.This release adds full CRUD support for accounts and contacts.
This release adds full CRUD support for accounts and contacts.
AccountService ($client->accounts) — list, create, retrieve, update, delete, unarchive, upload/delete logoContactService ($client->contacts) — list, create, retrieve, update, deleteaccounts_edocsync.php, accounts_edocexchange.php, contacts.phpdocs/VERSIONING.md — SDK versioning policy documentation// List accounts
$accounts = $client->accounts->all(['limit' => 10]);
// Create a contact
$contact = $client->contacts->create($accountId, [
'contact' => [
'name' => 'Customer Company',
'email' => 'billing@customer.com',
'tin_value' => 'ESB87654321',
'country' => 'ES',
]
]);
Full Changelog: https://github.com/B2Brouter/b2brouter-php/compare/v1.1.0...v1.2.0AccountService ($client->accounts) — full account management:
all() — list accounts with Ransack query filteringcreate() — create a new account (eDocSync subscriptions)retrieve() — get account detailsupdate() — update account fieldsdelete() — archive or delete an accountunarchive() — restore an archived accountuploadLogo() — upload account logo (binary)deleteLogo() — remove account logoContactService ($client->contacts) — full contact management:
all() — list contacts with filtering by name, type, and integration codecreate() — create a new contactretrieve() — get contact detailsupdate() — update contact fieldsdelete() — delete a contactaccounts.php, contacts.phpdocs/VERSIONING.md — SDK versioning policy documentationThis release updates the default B2BRouter API version from 2025-10-13 to 2026-03-02 .
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',
]);2026-03-02X-B2B-API-Request-Id (falls back to X-Request-Id for older API versions)use_previous_api_version.php2026-03-02 migration guideThe following changes apply only if you use API version 2026-03-02 (the new default).
Use allowance_charges_attributes instead:
discount_amount, discount_percent, discount_text → allowance_charge_indicator: "allowance"charge_amount, charge_percent, charge_reason → allowance_charge_indicator: "charge"apply_taxes_to_charge → individual apply_taxes per allowance/chargecharge_is_reimbursable_expense → individual is_reimbursable_expense per allowance/chargeSame removals apply to invoice line fields (discount_*, charge_*).
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']);type_document renamed to type_code on invoicestin_scheme, cin_scheme, pin_scheme) now return zero-padded 4-char strings (e.g., "0007" instead of 7)201 Created instead of 200 OK (SDK handles this transparently)contact_id ignored for IssuedSimplifiedInvoiceis_provider defaults to true when creating via APIbase_quantity, tax_currency_code, tax_amount_in_tax_currency, payments_on_accountannulled_by_id, corrected_by_id, KSeF-specific fieldsitem_seller_identifier, item_standard_identifieris_defaultcomposer update b2brouter/b2brouter-phpFull changelog: v1.0.0...v1.1.0
2025-10-13 to 2026-03-02X-B2B-API-Request-Id (falls back to X-Request-Id for older API versions)2026-03-02 migration guideThe following changes apply only if you use API version 2026-03-02 (the new default). If you pin 'api_version' => '2025-10-13', your existing code continues to work unchanged.
To keep the previous API version:
$client = new B2BRouterClient('your-api-key', [
'api_version' => '2025-10-13',
]);
The following invoice-level fields have been removed. Use allowance_charges_attributes instead:
discount_amount, discount_percent, discount_text — use allowance_charges_attributes with allowance_charge_indicator: "allowance"charge_amount, charge_percent, charge_reason — use allowance_charges_attributes with allowance_charge_indicator: "charge"apply_taxes_to_charge — use allowance_charges_attributes with individual apply_taxes settingscharge_is_reimbursable_expense — use allowance_charges_attributes with individual is_reimbursable_expense settingsThe following line-level fields have been removed. Use allowance_charges_attributes instead:
discount_amount, discount_percent, discount_text — use allowance_charges_attributes with allowance_charge_indicator: "allowance"charge_amount, charge_percent, charge_reason — use allowance_charges_attributes with allowance_charge_indicator: "charge"taxcode replaced by queryBefore (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']);
type_document renamed to type_code on invoices for document type codes (Peppol, CII, KSeF, FatturaPA)tin_scheme, cin_scheme, pin_scheme) now return zero-padded 4-character strings (e.g., "0007" instead of 7). Unknown scheme returns nil instead of "0001".201 Created instead of 200 OK (SDK handles this transparently)contact_id ignored for IssuedSimplifiedInvoice — simplified invoices always use inline contact fieldsis_provider now defaults to true when creating contacts via APIThese fields are automatically available through the array-based response:
base_quantity (decimal), tax_currency_code (ISO 4217 string), tax_amount_in_tax_currency (decimal), payments_on_accountannulled_by_id, corrected_by_id (integer, nullable), payment_account_name, purchase_order_reference, sales_order_reference, tax_inclusive_amount_before_allowances_and_charges (KSeF-specific)item_seller_identifier, item_standard_identifier (TicketBAI/KSeF)is_default (boolean)No breaking changes. Update your composer.json:
This is the first stable release of the B2BRouter PHP SDK. The SDK is production-ready with semantic versioning guarantees. All future 1.x releases will maintain backward compatibility.
validate() - Validate invoice structure before sendingsend() - Send invoice to customer and generate tax reportsmarkAs() - Update invoice state (new, sent, paid, etc.)acknowledge() - Mark received invoices as acknowledgedimport() - Import invoices from external sourcesdownloadAs() - Download in any supported formatdownloadPdf() - Convenience method for PDF downloadspdf.invoice)xml.facturae.3.2.2)xml.ubl.invoice.bis3)update()delete()ClientInterfaceApiErrorException - Base exception for all API errorsAuthenticationException - Invalid API key (401)PermissionException - Insufficient permissions (403)ResourceNotFoundException - Resource not found (404)InvalidRequestException - Validation errors (400, 422)ApiConnectionException - Network/connection errorsforeach loopshasMore() helper for checking additional pages.env filestest, test:all, test:coverage)No breaking changes. Update your composer.json:
{
"require": {
"b2brouter/b2brouter-php": "^1.0"
}
}Then run: composer update b2brouter/b2brouter-php
All 0.9.x code is fully compatible with 1.0.0.
Release v0.9.1 - Invoice document download support
Release v0.9.1 - Invoice document download support
InvoiceService::downloadAs($id, $documentType, $params) - Download invoice in any supported formatInvoiceService::downloadPdf($id, $params) - Convenience method for PDF downloadspdf.invoice)xml.facturae.3.2.2, UBL BIS3 xml.ubl.invoice.bis3, and more)ApiResource::requestBinary() method for non-JSON responses
examples/download_invoice_documents.php - Complete example showing invoice creation and downloading in PDF and UBL BIS3 formatsapplication/pdf for PDF formats, application/xml for XML formatsInvoice CRUD operations (create, retrieve, update, delete, list)
validate() - Validate invoice structure before sendingsend() - Send invoice to customer and/or tax authoritymarkAs() - Update invoice state (sent, paid, etc.)acknowledge() - Mark received invoices as acknowledgedimport() - Bulk import invoicesretrieve() - Get tax report detailsall() - List tax reports with filteringdownload() - Download XML tax reportcreate(), update(), delete() - CRUD operationsApiErrorException - Base exception for all API errorsAuthenticationException - Invalid API key (401)PermissionException - Insufficient permissions (403)ResourceNotFoundException - Resource not found (404)InvalidRequestException - Validation errors (400, 422)ApiConnectionException - Network/connection errorsClientInterfaceDEVELOPER_GUIDE.md - Setup, IDE configuration, testing, best practicesSPANISH_INVOICING.md - Verifactu compliance guideTAX_REPORTS.md - Tax reporting system documentationcreate_simple_invoice.phpcreate_detailed_invoice.phplist_invoices.phppaginate_all_invoices.phpupdate_invoice.phpinvoice_workflow.phpinvoices.phpinvoicing_in_spain_with_verifactu.phptax_reports.phpverifactu_tax_report.phpticketbai_tax_report.php.env.example)composer test - Unit tests (fast)composer test:all - All tests including integrationcomposer test:external - External integration testscomposer test:coverage - HTML coverage reportforeach loops)This is a beta release (v0.9.x) intended for early adopters and development/testing purposes.
Stability:
"b2brouter/b2brouter-php": "0.9.0"What's Coming in v1.0.0:
Upgrade Path:
^0.9.0 (allows 0.9.1, 0.9.2, etc.)^1.0 (semantic versioning guarantees)Your coding agent can read these notes before it upgrades. Set up the MCP server →