Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 2.95 KB

README.md

File metadata and controls

63 lines (46 loc) · 2.95 KB

CustomerSessions

(CustomerSessions)

Overview

Available Operations

  • Create - Create Customer Session

Create

Create a customer session.

Example Usage

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.CustomerSessions.Create(ctx, components.CustomerSessionCreate{
        CustomerID: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.CustomerSession != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request components.CustomerSessionCreate ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.CustomerSessionsCreateResponse, error

Errors

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