Connect
Authorize
Core API
- Checkout
- Checkout Links
- Custom Checkout Fields
- Customers
- Subscriptions
- Orders
- Discounts
- Refunds
- Products
- Events
- Meters
- Benefits
- Customer Meters
- License Keys
- Files
- Organizations
- Metrics
Customer Portal API
- GETGet Customer
- GETGet Organization
- Sessions
- Subscriptions
- Orders
- License Keys
- File Downloads
Webhook Events
- Customer Events
- Billing Events
- Organization Events
OAuth 2.0 API
Connect
Authorize
GET
/
v1
/
oauth2
/
authorize
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Oauth2.Authorize(ctx)
if err != nil {
log.Fatal(err)
}
if res.ResponseOauth2Authorize != nil {
// handle response
}
}
{
"client": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"client_id": "<string>",
"client_name": "<string>",
"client_uri": "<string>",
"logo_uri": "<string>",
"tos_uri": "<string>",
"policy_uri": "<string>"
},
"sub_type": "<string>",
"sub": {
"id": "<string>",
"email": "jsmith@example.com",
"avatar_url": "<string>"
},
"scopes": [
"openid"
]
}
Authorizations
You can generate an Organization Access Token from your organization's settings.
Response
200 - application/json
Successful Response
The response is of type object
.
The response is of type object
.
The response is of type object
.
Was this page helpful?
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Oauth2.Authorize(ctx)
if err != nil {
log.Fatal(err)
}
if res.ResponseOauth2Authorize != nil {
// handle response
}
}
{
"client": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"client_id": "<string>",
"client_name": "<string>",
"client_uri": "<string>",
"logo_uri": "<string>",
"tos_uri": "<string>",
"policy_uri": "<string>"
},
"sub_type": "<string>",
"sub": {
"id": "<string>",
"email": "jsmith@example.com",
"avatar_url": "<string>"
},
"scopes": [
"openid"
]
}