🔷

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 interface
  • Type - Document type (w2, 1099, etc.)
  • Year - Tax year

client.Tax.CalculateRefund(params)

Calculate estimated tax refund

Parameters:

  • FilingStatus - Filing status
  • Income - Total income
  • Deductions - Deduction details
  • Year - Tax year

client.Webhooks.Verify(payload, signature, secret)

Verify webhook signature

Parameters:

  • payload - Webhook payload bytes
  • signature - X-Taxu-Signature header
  • secret - Webhook secret