POST
/
v1
/
oauth2
/
register
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"github.com/polarsource/polar-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Oauth2.Clients.Create(ctx, components.OAuth2ClientConfiguration{
        RedirectUris: []string{
            "https://inferior-chainstay.com",
        },
        ClientName: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Any != nil {
        // handle response
    }
}
"<any>"

Authorizations

Authorization
string
header
required

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

Body

application/json
redirect_uris
string[]
required
client_name
string
required
token_endpoint_auth_method
enum<string>
default:
client_secret_post
Available options:
client_secret_basic,
client_secret_post,
none
grant_types
enum<string>[]
Available options:
authorization_code,
refresh_token
response_types
string[]
scope
string
default:
openid profile email user:read 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
client_uri
string | null
logo_uri
string | null
Required string length: 1 - 2083
tos_uri
string | null
Required string length: 1 - 2083
policy_uri
string | null
Required string length: 1 - 2083

Response

200
application/json
Successful Response

The response is of type any.

Was this page helpful?