Create API credentials in the Paxos Dashboard and export them as environment variables.
If you don’t have a Sandbox account, sign up here.
Create a file called
main.go with the following code. This example creates a client, lists your profiles, and prints the result.package main
import (
"context"
"fmt"
"log"
"os"
"github.com/paxosglobal/paxos-go"
)
func main() {
client, err := paxos.NewClient(
os.Getenv("PAXOS_CLIENT_ID"),
os.Getenv("PAXOS_CLIENT_SECRET"),
paxos.WithSandbox(),
)
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
// List profiles
iter := client.Profiles.ListProfiles(ctx, &paxos.ListProfilesRequest{
Limit: 10,
})
for iter.Next() {
profile := iter.Current()
fmt.Printf("Profile: %s (%s)\n", profile.ID, profile.Nickname)
}
if err := iter.Err(); err != nil {
log.Fatal(err)
}
}
Next Steps
- Learn how the SDK manages Authentication automatically
- Explore Error Handling patterns
- Set up the Sandbox environment for testing
- Browse the Transfers service reference