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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200 - application/json
Successful Response
client
object
required
sub_type
string
required
Allowed value: "user"
sub
object | null
required
scopes
enum<string>[]
required
Available options:
openid,
profile,
email,
user:read,
admin,
web_default,
organizations:read,
organizations:write,
custom_fields:read,
custom_fields:write,
discounts:read,
discounts:write,
checkout_links:read,
checkout_links:write,
checkouts:read,
checkouts:write,
products:read,
products:write,
benefits:read,
benefits:write,
events:read,
events:write,
meters:read,
meters:write,
files:read,
files:write,
subscriptions:read,
subscriptions:write,
customers:read,
customers:write,
customer_sessions:write,
orders:read,
refunds:read,
refunds:write,
metrics:read,
webhooks:read,
webhooks:write,
external_organizations:read,
license_keys:read,
license_keys:write,
repositories:read,
repositories:write,
issues:read,
issues:write,
customer_portal:read,
customer_portal:write