PHP SDK

Official Taxu PHP library

Installation

Composer (Recommended)

composer require taxu/taxu-php

Manual Installation

git clone https://github.com/taxu/taxu-php.git
cd taxu-php
composer install

Quick Start

<?php
require_once('vendor/autoload.php');

// Initialize client
$taxu = new \Taxu\TaxuClient([
    'api_key' => 'your_api_key_here'
]);

// Upload and process W-2
$client->documents->upload([
    'file' => fopen('w2.pdf', 'r'),
    'type' => 'w2'
]);

// Calculate refund
$client->tax->calculateRefund([
    'income' => 75000,
    'filing_status' => 'single',
    'state' => 'CA'
]);

Features

PSR-7 Compatible

Works with any PSR-7 HTTP client

Type Hints

Full PHP 7.4+ type declarations

Laravel Support

First-class Laravel integration

Composer Ready

Easy installation via Composer

API Reference

Document Upload

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

Tax Calculation

$client->tax->calculateRefund([
    'income' => 75000,
    'filing_status' => 'single'
]);

Webhook Verification

$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_TAXU_SIGNATURE'];

$client->webhooks->verify($payload, $signature);

Next Steps