Scopes: customer_portal:read customer_portal:write
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: 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": {},
"external_id": "usr_1337",
"email": "<string>",
"email_verified": true,
"name": "John Doe",
"billing_address": {
"country": "AD",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": [
"911144442",
"us_ein"
],
"organization_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"avatar_url": "<string>"
},
"benefit_id": "<string>",
"key": "<string>",
"display_key": "<string>",
"status": "granted",
"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
}
}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.
Filter by a specific benefit
Page number, defaults to 1.
Size of a page, defaults to 10. Maximum is 100.
Successful Response
Show child attributes
The ID of the object.
Creation timestamp of the object.
Last modification timestamp of the object.
Show child attributes
The ID of the customer.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.
"usr_1337"
The email address of the customer. This must be unique within the organization.
Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.
The name of the customer.
"John Doe"
Show child attributes
AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW 2 elements["911144442", "us_ein"]The ID of the organization owning the customer.
Timestamp for when the customer was soft deleted.
The benefit ID.
granted, revoked, disabled Was this page helpful?
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: 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": {},
"external_id": "usr_1337",
"email": "<string>",
"email_verified": true,
"name": "John Doe",
"billing_address": {
"country": "AD",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": [
"911144442",
"us_ein"
],
"organization_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"avatar_url": "<string>"
},
"benefit_id": "<string>",
"key": "<string>",
"display_key": "<string>",
"status": "granted",
"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
}
}