💎
Ruby SDK
v2.1.0
Official Ruby SDK for Rails applications and Ruby scripts
Installation
Add to your Gemfile:
gem 'taxu'
Or install directly:
gem install taxu
Quick Start
Initialize the Client
require 'taxu' Taxu.api_key = ENV['TAXU_API_KEY']
Upload a Document
uploaded = Taxu::Document.upload(
file: File.open('w2.pdf'),
type: 'w2',
year: 2024
)
puts "Document ID: #{uploaded.id}"Calculate Tax Refund
refund = Taxu::Tax.calculate_refund(
filing_status: 'single',
income: 75000,
deductions: { standard: true },
year: 2024
)
puts "Estimated Refund: $#{refund.amount}"Features
Rails Integration
Seamless Rails ActiveRecord support
Idiomatic Ruby
Follows Ruby conventions and style
Thread-Safe
Safe for concurrent requests
Enumerable Support
Works with Ruby enumerables
API Reference
Taxu::Document.upload(params)
Upload a tax document for processing
Parameters:
file- File objecttype- Document type (w2, 1099, etc.)year- Tax year
Taxu::Tax.calculate_refund(params)
Calculate estimated tax refund
Parameters:
filing_status- Filing statusincome- Total incomedeductions- Deduction detailsyear- Tax year
Taxu::Webhook.verify(payload, signature, secret)
Verify webhook signature
Parameters:
payload- Webhook payload stringsignature- X-Taxu-Signature headersecret- Webhook secret