PHPackages                             b2brouter/b2brouter-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. b2brouter/b2brouter-php

ActiveLibrary[API Development](/categories/api)

b2brouter/b2brouter-php
=======================

B2Brouter PHP SDK - Official library for the B2Brouter API

v1.2.0(1mo ago)204301MITPHPPHP &gt;=7.4CI passing

Since Nov 18Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/B2Brouter/b2brouter-php)[ Packagist](https://packagist.org/packages/b2brouter/b2brouter-php)[ Docs](https://developer.b2brouter.net)[ RSS](/packages/b2brouter-b2brouter-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (10)Used By (0)

B2BRouter PHP SDK
=================

[](#b2brouter-php-sdk)

Official PHP SDK for the B2BRouter API - Electronic Invoicing and Tax Reporting

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/291fb48c27888cb58d3daa496237532ea2d0bdd51a933f0a7a4262e9d87b7304/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e342d3838393242462e737667)](https://php.net/)

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Core Concepts](#core-concepts)
    - [Invoice Operations](#invoice-operations)
    - [Tax Reports](#tax-reports)
    - [Spanish Invoicing with Verifactu](#spanish-invoicing-with-verifactu)
- [Pagination](#pagination)
- [Error Handling](#error-handling)
- [Examples](#examples)
- [Development](#development)
- [Documentation](#documentation)
- [Support](#support)
- [License](#license)

Features
--------

[](#features)

### Core Functionality

[](#core-functionality)

- **Complete invoice management** - Create, retrieve, update, delete, import, validate, send, and acknowledge invoices
- **Multi-format document downloads** - Export invoices as PDF, Spanish Facturae XML, UBL BIS3, and other formats
- **Tax report operations** - Create, retrieve, list, download, update (corrections), and delete (annullations) tax reports
- **Tax report settings** - Configure and manage Verifactu, TicketBAI, and other tax authority settings

### Developer Experience

[](#developer-experience)

- **Simple and intuitive API** - Clean, modern PHP interface with service-based architecture
- **Zero dependencies** - Runs on PHP 7.4+ with only standard extensions (cURL, JSON, mbstring)
- **Automatic authentication** - Secure API key management built-in
- **Pagination support** - Iterator and Countable implementations for easy traversal of large result sets
- **Comprehensive error handling** - Detailed exception hierarchy with HTTP status codes and request IDs
- **Automatic retries** - Network failures handled gracefully with exponential backoff (configurable)
- **Type safety** - Full PHP 7.4+ support with proper type hints

### Compliance and Tax Reporting

[](#compliance-and-tax-reporting)

- **Spanish Verifactu** - Full compliance with Spanish Anti-Fraud Law (Law 11/2021) and Royal Decree 1007/2023
- **TicketBAI** - Basque Country invoicing compliance with automatic submission
- **QR code generation** - Automatic QR codes for invoice verification (embedded in tax reports)
- **Hash chain management** - Tamper-proof audit trails computed and maintained automatically
- **Automated AEAT submission** - Real-time tax report submission to Spanish Tax Authority with rate limiting
- **Multi-jurisdiction support** - Architecture supports Italian SDI, Polish KSeF, Saudi Zatca, and more

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- cURL extension
- JSON extension
- mbstring extension

Installation
------------

[](#installation)

Install via Composer:

```
composer require b2brouter/b2brouter-php
```

Quick Start
-----------

[](#quick-start)

```
