OpenID Connect
Authorize
GET
/
v1
/
oauth2
/
authorize
python (new sdk)
from polar.v2026_04 import Polar
polar = Polar("polar_oat_xxx")
response = polar.oauth2.authorize()
print(response)import { createPolar } from "@polar-sh/sdk/2026-04";
const polar = createPolar({
accessToken: "polar_oat_xxx",
});
const response = await polar.oauth2.authorize();
console.log(response);curl --request GET \
--url https://api.polar.sh/v1/oauth2/authorize \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.polar.sh/v1/oauth2/authorize"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polar.sh/v1/oauth2/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polar.sh/v1/oauth2/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polar.sh/v1/oauth2/authorize"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.polar.sh/v1/oauth2/authorize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polar.sh/v1/oauth2/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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": [],
"organizations": [
{
"id": "<string>",
"slug": "<string>",
"avatar_url": "<string>"
}
],
"requires_single_organization": false,
"scope_display_names": {
"openid": "OpenID",
"profile": "Read your profile",
"email": "Read your email address",
"user:read": "Read your user account",
"user:write": "Manage your user account",
"organizations:read": "Read your organizations",
"organizations:write": "Create or modify organizations",
"custom_fields:read": "Read custom fields",
"custom_fields:write": "Create or modify custom fields",
"discounts:read": "Read discounts",
"discounts:write": "Create or modify discounts",
"checkout_links:read": "Read checkout links",
"checkout_links:write": "Create or modify checkout links",
"checkouts:read": "Read checkout sessions",
"checkouts:write": "Create or modify checkout sessions",
"transactions:read": "Read transactions",
"transactions:write": "Create or modify transactions",
"payouts:read": "Read payouts",
"payouts:write": "Create or modify payouts",
"products:read": "Read products",
"products:write": "Create or modify products",
"benefits:read": "Read benefits",
"benefits:write": "Create or modify benefits",
"events:read": "Read events",
"events:write": "Create events",
"meters:read": "Read meters",
"meters:write": "Create or modify meters",
"files:read": "Read file uploads",
"files:write": "Create or modify file uploads",
"subscriptions:read": "Read subscriptions made on your organizations",
"subscriptions:write": "Create or modify subscriptions made on your organizations",
"customers:read": "Read customers",
"customers:write": "Create or modify customers",
"members:read": "Read members",
"members:write": "Create or modify members",
"wallets:read": "Read wallets",
"wallets:write": "Create or modify wallets",
"disputes:read": "Read disputes",
"disputes:write": "Create or modify disputes",
"customer_meters:read": "Read customer meters",
"customer_sessions:write": "Create or modify customer sessions",
"member_sessions:write": "Create or modify member sessions",
"customer_seats:read": "Read customer seats",
"customer_seats:write": "Create or modify customer seats",
"orders:read": "Read orders made on your organizations",
"orders:write": "Modify orders made on your organizations",
"refunds:read": "Read refunds made on your organizations",
"refunds:write": "Create or modify refunds",
"payments:read": "Read payments made on your organizations",
"metrics:read": "Read metrics",
"metrics:write": "Create or modify metric definitions",
"webhooks:read": "Read webhooks",
"webhooks:write": "Create or modify webhooks",
"license_keys:read": "Read license keys",
"license_keys:write": "Modify license keys",
"customer_portal:read": "Read your orders, subscriptions and benefits",
"customer_portal:write": "Create or modify your orders, subscriptions and benefits",
"notifications:read": "Read notifications",
"notifications:write": "Mark notifications as read",
"notification_recipients:read": "Read notification recipients",
"notification_recipients:write": "Create or modify notification recipients",
"organization_access_tokens:read": "Read organization access tokens",
"organization_access_tokens:write": "Create or modify organization access tokens"
}
}Authorizations
Response
200 - application/json
Successful Response
- AuthorizeResponseUser
- AuthorizeResponseOrganization
Show child attributes
Show child attributes
Allowed value:
"user"Show child attributes
Show child attributes
Available options:
openid, profile, email, user:read, user:write, organizations:read, organizations:write, custom_fields:read, custom_fields:write, discounts:read, discounts:write, checkout_links:read, checkout_links:write, checkouts:read, checkouts:write, transactions:read, transactions:write, payouts:read, payouts: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, members:read, members:write, wallets:read, wallets:write, disputes:read, disputes:write, customer_meters:read, customer_sessions:write, member_sessions:write, customer_seats:read, customer_seats:write, orders:read, orders:write, refunds:read, refunds:write, payments:read, metrics:read, metrics:write, webhooks:read, webhooks:write, license_keys:read, license_keys:write, customer_portal:read, customer_portal:write, notifications:read, notifications:write, notification_recipients:read, notification_recipients:write, organization_access_tokens:read, organization_access_tokens:write Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I
python (new sdk)
from polar.v2026_04 import Polar
polar = Polar("polar_oat_xxx")
response = polar.oauth2.authorize()
print(response)import { createPolar } from "@polar-sh/sdk/2026-04";
const polar = createPolar({
accessToken: "polar_oat_xxx",
});
const response = await polar.oauth2.authorize();
console.log(response);curl --request GET \
--url https://api.polar.sh/v1/oauth2/authorize \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.polar.sh/v1/oauth2/authorize"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polar.sh/v1/oauth2/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polar.sh/v1/oauth2/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polar.sh/v1/oauth2/authorize"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.polar.sh/v1/oauth2/authorize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polar.sh/v1/oauth2/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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": [],
"organizations": [
{
"id": "<string>",
"slug": "<string>",
"avatar_url": "<string>"
}
],
"requires_single_organization": false,
"scope_display_names": {
"openid": "OpenID",
"profile": "Read your profile",
"email": "Read your email address",
"user:read": "Read your user account",
"user:write": "Manage your user account",
"organizations:read": "Read your organizations",
"organizations:write": "Create or modify organizations",
"custom_fields:read": "Read custom fields",
"custom_fields:write": "Create or modify custom fields",
"discounts:read": "Read discounts",
"discounts:write": "Create or modify discounts",
"checkout_links:read": "Read checkout links",
"checkout_links:write": "Create or modify checkout links",
"checkouts:read": "Read checkout sessions",
"checkouts:write": "Create or modify checkout sessions",
"transactions:read": "Read transactions",
"transactions:write": "Create or modify transactions",
"payouts:read": "Read payouts",
"payouts:write": "Create or modify payouts",
"products:read": "Read products",
"products:write": "Create or modify products",
"benefits:read": "Read benefits",
"benefits:write": "Create or modify benefits",
"events:read": "Read events",
"events:write": "Create events",
"meters:read": "Read meters",
"meters:write": "Create or modify meters",
"files:read": "Read file uploads",
"files:write": "Create or modify file uploads",
"subscriptions:read": "Read subscriptions made on your organizations",
"subscriptions:write": "Create or modify subscriptions made on your organizations",
"customers:read": "Read customers",
"customers:write": "Create or modify customers",
"members:read": "Read members",
"members:write": "Create or modify members",
"wallets:read": "Read wallets",
"wallets:write": "Create or modify wallets",
"disputes:read": "Read disputes",
"disputes:write": "Create or modify disputes",
"customer_meters:read": "Read customer meters",
"customer_sessions:write": "Create or modify customer sessions",
"member_sessions:write": "Create or modify member sessions",
"customer_seats:read": "Read customer seats",
"customer_seats:write": "Create or modify customer seats",
"orders:read": "Read orders made on your organizations",
"orders:write": "Modify orders made on your organizations",
"refunds:read": "Read refunds made on your organizations",
"refunds:write": "Create or modify refunds",
"payments:read": "Read payments made on your organizations",
"metrics:read": "Read metrics",
"metrics:write": "Create or modify metric definitions",
"webhooks:read": "Read webhooks",
"webhooks:write": "Create or modify webhooks",
"license_keys:read": "Read license keys",
"license_keys:write": "Modify license keys",
"customer_portal:read": "Read your orders, subscriptions and benefits",
"customer_portal:write": "Create or modify your orders, subscriptions and benefits",
"notifications:read": "Read notifications",
"notifications:write": "Mark notifications as read",
"notification_recipients:read": "Read notification recipients",
"notification_recipients:write": "Create or modify notification recipients",
"organization_access_tokens:read": "Read organization access tokens",
"organization_access_tokens:write": "Create or modify organization access tokens"
}
}
