// the find
stripe/stripe-go
Go library for the Stripe API.
The official Stripe Go client library, auto-generated from Stripe's OpenAPI spec. It covers the full Stripe API surface including V1 and V2 endpoints, Connect, webhooks, and billing. You use this if you're building Go services that charge money.
Automatic retries with idempotency keys baked in — you get safe retry behavior without thinking about it. The new `stripe.Client` pattern (introduced in v82) is cleaner than the old global-state approach and properly supports Connect's per-account scoping. The `Backend` interface is mockable via GoMock without any wrapper code. Webhook signature verification ships in the box, including a test helper to generate signed payloads.
The library is code-generated, and it shows: accessing undocumented or preview API fields requires raw JSON unmarshaling from `LastResponse.RawJSON`, which is fragile and untyped. The legacy global-state pattern (`stripe.Key = ...`) is deprecated but still present and still works, so teams on older code won't feel pressure to migrate. The iter pattern for lists uses `i.Next()` / `i.Customer()` — replaced in the new client with range-over-func iterators, but the migration is a non-trivial diff for large codebases. Version numbers are in the import path (`/v86`), meaning every major Stripe API version bump requires touching every import across your project.