-
Notifications
You must be signed in to change notification settings - Fork 489
Description
Describe the bug
Where can I fine V2 accounts functionality?
The changelog entry for 82.1.0 specifies:
Services are all version-namespaced for symmetry. E.g. stripeClient.V1Accounts and stripeClient.V2Accounts.
And states support was added for V2 APIs.
https://docs.stripe.com/connect/accounts-v2/api also showcases this method call:
sc.V2CoreAccounts.Create(context.TODO(), params);
However, browsing through the code, I don't see any V2CoreAccounts functionality. Is the documentation wrong, or am I looking at the wrong release?
To Reproduce
- main.go:
package main
import (
"context"
"github.com/stripe/stripe-go/v82"
)
func main() {
sc := stripe.NewClient("sk_test_")
sc.V2Accounts.Create(context.TODO(), &stripe.V2CoreAccountUpdateParams{})
}
$ go run main.go
:
# command-line-arguments
./main.go:11:5: sc.V2Accounts undefined (type *stripe.Client has no field or method V2Accounts)
./main.go:11:47: undefined: stripe.V2CoreAccountUpdateParams
Expected behavior
Successful compilation, or documentation that specifies where this functionality is available.
Code snippets
OS
Linux
Go version
1.24.4
stripe-go version
v82.3.0
API version
2025-06-30.basil
Additional context
- In Go, what do I need to import for stripe.NewClient with the V2CoreAccount functionality?
To use the stripe.NewClient function with V2CoreAccount functionality in Go, you need to import the Stripe Go SDK with the correct module path.
Here's what you need to include in your Go code:
example.go
import (
"context"
"github.com/stripe/stripe-go/v82"
)
For the V2 Core Accounts functionality specifically, make sure you're using version 75.3.0 or newer of the Stripe Go SDK, as the Accounts v2 API is a newer feature.
When initializing your Stripe client, you would do:
example.go
sc := stripe.NewClient("<<secret key>>");
// Example using V2 Core Account functionality
params := &stripe.V2CoreAccountCreateParams{
DisplayName: stripe.String("Example Business"),
ContactEmail: stripe.String("contact@example.com"),
Identity: &stripe.V2CoreAccountCreateIdentityParams{
Country: stripe.String(string(stripe.V2CoreAccountIdentityCountryUS)),
EntityType: stripe.String(string(stripe.V2CoreAccountIdentityEntityTypeCompany)),
},
Configuration: &stripe.V2CoreAccountCreateConfigurationParams{
Customer: &stripe.V2CoreAccountCreateConfigurationCustomerParams{},
},
}
account, err := sc.V2CoreAccounts.Create(context.TODO(), params)
Make sure you've installed the SDK using Go modules:
go get github.com/stripe/stripe-go/v82
- Your understanding is that v82 has V2CoreAccounts functionality?
Used 6 sources
I apologize for the confusion in my previous response. You're right to question this, and I appreciate you bringing it to my attention. Let me provide a more accurate answer:
The V2CoreAccounts functionality is relatively new, and it's not currently available in the public versions of the Stripe Go SDK.
For the most up-to-date information on using Accounts v2 API with Go, you should:
Check the latest version of the Stripe Go SDK on GitHub: https://github.com/stripe/stripe-go
Look for any beta or preview releases that might include V2CoreAccounts functionality.
Consult the official Stripe documentation for Go, which should provide the most current information on how to use new features like Accounts v2.
If the V2CoreAccounts functionality is not yet available in the public SDK, you may need to wait for an updated release or contact Stripe support for guidance on how to access this feature in Go.
I apologize again for any confusion my previous response may have caused. Thank you for your understanding.