For AI agents and LLMs: a structured documentation index is available at /llms.txt. Every page has a Markdown sibling — append .md to any URL.

Skip to content
Docs

Go SDK

Install, authenticate, and make your first request with the official Paddle Go SDK for server-side Go applications.

AI summary

Install the Paddle Go SDK (github.com/PaddleHQ/paddle-go-sdk/v5) to integrate Paddle Billing with server-side Go applications. The SDK provides typed request and response structs, iterator-based pagination, and webhook signature verification helpers.

  • • Requires Go 1.21 or later; install with go get github.com/PaddleHQ/paddle-go-sdk/v5 and import as paddle "github.com/PaddleHQ/paddle-go-sdk/v5".
  • • Construct a client with paddle.New(os.Getenv("PADDLE_API_KEY"), paddle.WithBaseURL(paddle.SandboxBaseURL)); use paddle.ProductionBaseURL for live.
  • • Iterate with Iter(ctx, func(*T) (bool, error)) — return (true, nil) to continue or (false, nil) to stop early; pages are fetched automatically.

The Paddle Go SDK integrates Paddle Billing with server-side Go applications. It returns typed request and response structs, provides iterator-based pagination, and includes helpers for webhook signature verification.

Latest: v5.2.0 · 2026-03-30

Requirements

Go 1.21 or later.

Install

Shell
go get github.com/PaddleHQ/paddle-go-sdk/v5

Import the package in your Go program:

Go
import (
paddle "github.com/PaddleHQ/paddle-go-sdk/v5"
)

Authenticate

Create an API key in Paddle > Developer tools > Authentication, then pass it when you create a client.

API keys are environment-specific. Use a sandbox key for sandbox, a live key for production.

Go
package main
import (
"os"
paddle "github.com/PaddleHQ/paddle-go-sdk/v5"
)
func main() {
client, err := paddle.New(
os.Getenv("PADDLE_API_KEY"),
paddle.WithBaseURL(paddle.SandboxBaseURL),
)
if err != nil {
panic(err)
}
_ = client
}

Use paddle.ProductionBaseURL to use the live API.

Make your first request

List the products in your catalog:

Go
package main
import (
"context"
"fmt"
"os"
paddle "github.com/PaddleHQ/paddle-go-sdk/v5"
)
func main() {
client, err := paddle.New(
os.Getenv("PADDLE_API_KEY"),
paddle.WithBaseURL(paddle.SandboxBaseURL),
)
if err != nil {
panic(err)
}
ctx := context.Background()
products, err := client.ListProducts(ctx, &paddle.ListProductsRequest{})
if err != nil {
panic(err)
}
err = products.Iter(ctx, func(p *paddle.Product) (bool, error) {
fmt.Printf("%s %s\n", p.ID, p.Name)
return true, nil
})
if err != nil {
panic(err)
}
}

ListProducts returns a collection. Call Iter with a callback that returns (true, nil) to continue to the next product or (false, nil) to stop early. The SDK fetches subsequent pages as needed.

Next steps

  • Understand shared patterns for pagination, idempotency, retries, and error handling across SDKs.
  • Browse the API reference for every resource and operation the SDK exposes.
  • Work against sandbox while you build, then follow the go-live checklist to switch environments.

Was this page helpful?