🔷
Go SDK
v2.1.0
Official Go SDK for high-performance server applications
Installation
go get github.com/taxu/taxu-go
Quick Start
Initialize the Client
package main
import (
"os"
"github.com/taxu/taxu-go"
)
func main() {
client := taxu.NewClient(os.Getenv("TAXU_API_KEY"))
}Upload a Document
file, err := os.Open("w2.pdf")
if err != nil {
log.Fatal(err)
}
defer file.Close()
uploaded, err := client.Documents.Upload(&taxu.DocumentUploadParams{
File: file,
Type: "w2",
Year: 2024,
})
fmt.Printf("Document ID: %s\n", uploaded.ID)Calculate Tax Refund
refund, err := client.Tax.CalculateRefund(&taxu.RefundParams{
FilingStatus: "single",
Income: 75000,
Deductions: &taxu.Deductions{
Standard: true,
},
Year: 2024,
})
fmt.Printf("Estimated Refund: $%.2f\n", refund.Amount)Features
Type Safety
Strong typing with Go structs
Context Support
Built-in context.Context for cancellation
Zero Dependencies
Only uses Go standard library
Concurrent-Safe
Safe for goroutine usage
API Reference
client.Documents.Upload(params)
Upload a tax document for processing
Parameters:
File- io.Reader interfaceType- Document type (w2, 1099, etc.)Year- Tax year
client.Tax.CalculateRefund(params)
Calculate estimated tax refund
Parameters:
FilingStatus- Filing statusIncome- Total incomeDeductions- Deduction detailsYear- Tax year
client.Webhooks.Verify(payload, signature, secret)
Verify webhook signature
Parameters:
payload- Webhook payload bytessignature- X-Taxu-Signature headersecret- Webhook secret