package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Teams.Create(ctx, operations.PostTeamTeamsRequestBody{
Data: operations.PostTeamTeamsData{
Type: operations.PostTeamTeamsTypeTeams,
Attributes: &operations.PostTeamTeamsAttributes{
Name: "Name",
Currency: operations.PostTeamCurrencyUsd,
Address: latitudeshgosdk.Pointer("Address"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"data": {
"id": "team_aEjv7ZKeWzCrjA5ANeMvImmKEoV",
"type": "teams",
"attributes": {
"name": "Name",
"slug": "name",
"address": "Address",
"currency": "USD",
"token": "token-for-team",
"enforce_mfa": false,
"customer_billing_id": "cus_hp2b02do",
"referred_code": null
}
},
"meta": {}
}package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Teams.Create(ctx, operations.PostTeamTeamsRequestBody{
Data: operations.PostTeamTeamsData{
Type: operations.PostTeamTeamsTypeTeams,
Attributes: &operations.PostTeamTeamsAttributes{
Name: "Name",
Currency: operations.PostTeamCurrencyUsd,
Address: latitudeshgosdk.Pointer("Address"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"data": {
"id": "team_aEjv7ZKeWzCrjA5ANeMvImmKEoV",
"type": "teams",
"attributes": {
"name": "Name",
"slug": "name",
"address": "Address",
"currency": "USD",
"token": "token-for-team",
"enforce_mfa": false,
"customer_billing_id": "cus_hp2b02do",
"referred_code": null
}
},
"meta": {}
}Was this page helpful?