> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).

# Go SDK

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

---

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.

{% version-badge sdk="paddle-go" /%}

{% card-group cols=3 %}
{% card title="GitHub" icon="carbon:logo-github" url="https://github.com/PaddleHQ/paddle-go-sdk" %}
View source code and report issues on GitHub.
{% /card %}
{% card title="Go package" icon="go" url="https://pkg.go.dev/github.com/PaddleHQ/paddle-go-sdk" %}
View and install on pkg.go.dev.
{% /card %}
{% card title="Changelog" icon="carbon:bullhorn" url="https://github.com/PaddleHQ/paddle-go-sdk/blob/main/CHANGELOG.md" %}
See recent releases and changes.
{% /card %}
{% /card-group %}

## Requirements

Go 1.21 or later.

## Install

```bash
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](https://developer.paddle.com/sdks/libraries.md) for pagination, idempotency, retries, and error handling across SDKs.
- Browse the [API reference](https://developer.paddle.com/api-reference/overview.md) for every resource and operation the SDK exposes.
- Work against [sandbox](https://developer.paddle.com/sdks/sandbox.md) while you build, then follow the [go-live checklist](https://developer.paddle.com/build/onboarding/go-live-checklist.md) to switch environments.