License Keys
List License Keys
Scopes: customer_portal:read customer_portal:write
GET
/
v1
/
customer-portal
/
license-keys
Go (SDK)
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"os"
"github.com/polarsource/polar-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.LicenseKeys.List(ctx, operations.CustomerPortalLicenseKeysListSecurity{
CustomerSession: polargo.Pointer(os.Getenv("POLAR_CUSTOMER_SESSION")),
}, nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))
if err != nil {
log.Fatal(err)
}
if res.ListResourceLicenseKeyRead != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"items": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"customer_id": "<string>",
"customer": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"email_verified": true,
"name": "John Doe",
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"organization_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"avatar_url": "<string>",
"external_id": "usr_1337",
"email": "customer@example.com",
"locale": "<string>"
},
"benefit_id": "<string>",
"key": "<string>",
"display_key": "<string>",
"limit_activations": 123,
"usage": 123,
"limit_usage": 123,
"validations": 123,
"last_validated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total_count": 123,
"max_page": 123
}
}Authorizations
customer_sessionmember_session
Customer session tokens are specific tokens that are used to authenticate customers on your organization. You can create those sessions programmatically using the Create Customer Session endpoint.
Query Parameters
Filter by a specific benefit The benefit ID.
Page number, defaults to 1.
Size of a page, defaults to 10. Maximum is 100.
Was this page helpful?
⌘I
Go (SDK)
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"os"
"github.com/polarsource/polar-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.LicenseKeys.List(ctx, operations.CustomerPortalLicenseKeysListSecurity{
CustomerSession: polargo.Pointer(os.Getenv("POLAR_CUSTOMER_SESSION")),
}, nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))
if err != nil {
log.Fatal(err)
}
if res.ListResourceLicenseKeyRead != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"items": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"customer_id": "<string>",
"customer": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"email_verified": true,
"name": "John Doe",
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"organization_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"avatar_url": "<string>",
"external_id": "usr_1337",
"email": "customer@example.com",
"locale": "<string>"
},
"benefit_id": "<string>",
"key": "<string>",
"display_key": "<string>",
"limit_activations": 123,
"usage": 123,
"limit_usage": 123,
"validations": 123,
"last_validated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total_count": 123,
"max_page": 123
}
}
