Skip to main content
POST
/
team
Go (SDK)
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_zp6AZ91ZbLt8A7x47b6oI1510LV0",
    "type": "teams",
    "attributes": {
      "name": "Name",
      "slug": "name",
      "address": "Address",
      "currency": "USD",
      "token": "token-for-team",
      "enforce_mfa": false,
      "customer_billing_id": "cus_w79w7tlr",
      "referred_code": null
    }
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

Body

data
object
required

Response

201 - application/vnd.api+json

Created

data
object