Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 2.43 KB

README.md

File metadata and controls

61 lines (44 loc) · 2.43 KB

PolarOrganizations

(CustomerPortal.Organizations)

Overview

Available Operations

  • Get - Get Organization

Get

Get a customer portal's organization by slug.

Example Usage

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.CustomerPortal.Organizations.Get(ctx, "<value>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Organization != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
slug string ✔️ The organization slug.
opts []operations.Option The options for this request.

Response

*operations.CustomerPortalOrganizationsGetResponse, error

Errors

Error Type Status Code Content Type
apierrors.ResourceNotFound 404 application/json
apierrors.HTTPValidationError 422 application/json
apierrors.APIError 4XX, 5XX */*