PHP SDK

The official Taxu PHP library provides modern PHP access to the Taxu API with PSR-7 compliance and full Composer support.

What is the Taxu PHP SDK?

The Taxu PHP SDK is a modern, PSR-compliant library that brings enterprise tax compliance to PHP applications. Compatible with PHP 8.0+ and following PHP-FIG standards, it integrates seamlessly with Laravel, Symfony, WordPress, and custom PHP frameworks.

Built for the millions of PHP applications powering e-commerce, SaaS, and business platforms worldwide, the PHP SDK provides a robust, well-tested solution for tax calculations, form generation, and IRS e-filing with modern PHP features and best practices.

Ideal For:

  • • Laravel and Symfony applications
  • • WordPress and WooCommerce sites
  • • E-commerce platforms
  • • Business management systems

PHP Standards:

  • • PSR-7 HTTP message compliance
  • • Composer package management
  • • PHP 8.0+ modern features
  • • Framework agnostic design
v2.8.0
PHP 8.0+

Installation

Install via Composer:

composer
composer require taxu/taxu-php

Authentication

<?php

require_once 'vendor/autoload.php';

use Taxu\TaxuClient;

$taxu = new TaxuClient('your_api_key_here');

Basic Usage

$filing = $taxu->tax->file1099NEC([
    'tax_year' => 2024,
    'payer' => [
        'name' => 'Acme Corp',
        'ein' => '12-3456789',
        'address' => '123 Business St'
    ],
    'recipient' => [
        'name' => 'John Contractor',
        'ssn' => '123-45-6789',
        'address' => '456 Worker Ave'
    ],
    'non_employee_compensation' => 15000
]);

echo $filing->id;  // fil_1234567890

More Examples

Calculate Tax

$result = $taxu->tax->calculate([
    'income' => 85000,
    'deductions' => 12000,
    'filing_status' => 'single',
    'state' => 'CA'
]);

echo "Federal tax: $" . $result->federal_tax;
echo "State tax: $" . $result->state_tax;

Upload Document

$document = $taxu->documents->upload([
    'file' => fopen('w2.pdf', 'r'),
    'type' => 'w2',
    'tax_year' => 2024
]);

echo "Document ID: " . $document->id;