class

Polar::Api::Checkouts

Inherits Reference < Object

API client for checkouts operations

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new Checkouts instance

@param client [Client] The Polar API client instance

Source

Instance methods

Confirm Checkout Session from Client

Confirm a checkout session by client secret.

Orders and subscriptions will be processed.

Endpoint: POST /v1/checkouts/client/{client_secret}/confirm

Parameters:

  • client_secret (required): The checkout session client secret.
  • body (required): Request body as Polar::Models::CheckoutConfirmStripe

Returns: Polar::Models::CheckoutPublicConfirmed

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
client_get(client_secret : String) : Polar::Models::CheckoutPublic

Get Checkout Session from Client

Get a checkout session by client secret.

Endpoint: GET /v1/checkouts/client/{client_secret}

Parameters:

  • client_secret (required): The checkout session client secret.

Returns: Polar::Models::CheckoutPublic

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Update Checkout Session from Client

Update a checkout session by client secret.

Endpoint: PATCH /v1/checkouts/client/{client_secret}

Parameters:

  • client_secret (required): The checkout session client secret.
  • body (required): Request body as Polar::Models::CheckoutUpdatePublic

Returns: Polar::Models::CheckoutPublic

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Create Checkout Session

Create a checkout session.

Scopes: checkouts:write

Endpoint: POST /v1/checkouts/

Parameters:

  • body (required): Request body as Polar::Models::CheckoutCreate

Returns: Polar::Models::Checkout

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Get Checkout Session

Get a checkout session by ID.

Scopes: checkouts:read checkouts:write

Endpoint: GET /v1/checkouts/{id}

Parameters:

  • id (required): The checkout session ID.

Returns: Polar::Models::Checkout

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(organization_id : String | Nil = nil, product_id : String | Nil = nil, customer_id : String | Nil = nil, status : String | Nil = nil, query : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil, sorting : String | Nil = nil) : Polar::Models::ListResource(Polar::Models::Checkout)

List Checkout Sessions

List checkout sessions.

Scopes: checkouts:read checkouts:write

Endpoint: GET /v1/checkouts/

Parameters:

  • organization_id (optional): Filter by organization ID.
  • product_id (optional): Filter by product ID.
  • customer_id (optional): Filter by customer ID.
  • status (optional): Filter by checkout session status.
  • query (optional): Filter by customer email.
  • page (optional): Page number, defaults to 1.
  • limit (optional): Size of a page, defaults to 10. Maximum is 100.
  • sorting (optional): Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.

Returns: Polar::Models::ListResource(Polar::Models::Checkout)

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Update Checkout Session

Update a checkout session.

Scopes: checkouts:write

Endpoint: PATCH /v1/checkouts/{id}

Parameters:

  • id (required): The checkout session ID.
  • body (required): Request body as Polar::Models::CheckoutUpdate

Returns: Polar::Models::Checkout

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source