Skip to main content
POST
/
v1
/
members
Go (SDK)
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"github.com/polarsource/polar-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Members.CreateMember(ctx, components.MemberCreate{
        CustomerID: "<value>",
        Email: "member@example.com",
        Name: polargo.Pointer("Jane Doe"),
        ExternalID: polargo.Pointer("usr_1337"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Member != nil {
        // handle response
    }
}
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "customer_id": "<string>",
  "email": "<string>",
  "name": "Jane Doe",
  "external_id": "usr_1337",
  "role": "owner"
}

Documentation Index

Fetch the complete documentation index at: https://polar.sh/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Body

application/json

Schema for creating a new member.

customer_id
string<uuid4>
required

The ID of the customer this member belongs to.

email
string<email>
required

The email address of the member.

Example:

"member@example.com"

name
string | null

The name of the member.

Maximum string length: 256
Example:

"Jane Doe"

external_id
string | null

The ID of the member in your system. This must be unique within the customer.

Example:

"usr_1337"

role
enum<string>
default:member

The role of the member within the customer. To assign or transfer ownership, use the member update endpoint.

Available options:
member,
billing_manager
Example:

"member"

Response

Member created.

A member of a customer.

id
string<uuid4>
required

The ID of the member.

created_at
string<date-time>
required

Creation timestamp of the object.

modified_at
string<date-time> | null
required

Last modification timestamp of the object.

customer_id
string<uuid4>
required

The ID of the customer this member belongs to.

email
string
required

The email address of the member.

Example:

"member@example.com"

name
string | null
required

The name of the member.

Example:

"Jane Doe"

external_id
string | null
required

The ID of the member in your system. This must be unique within the customer.

Example:

"usr_1337"

role
enum<string>
required

The role of the member within the customer.

Available options:
owner,
billing_manager,
member
Example:

"owner"