class

Polar::Api::CustomerPortal::BenefitGrants

Inherits Reference < Object

API client for benefit_grants operations in customer_portal context

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new BenefitGrants instance

@param client [Client] The Polar API client instance

Source

Instance methods

Get Benefit Grant

Get a benefit grant by ID for the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/benefit-grants/{id}

Parameters:

  • id (required): The benefit grant ID.

Returns: Polar::Models::CustomerBenefitGrant

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(type : String | Nil = nil, benefit_id : String | Nil = nil, checkout_id : String | Nil = nil, order_id : String | Nil = nil, subscription_id : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil, sorting : String | Nil = nil) : Polar::Models::ListResource(Polar::Models::CustomerBenefitGrant)

List Benefit Grants

List benefits grants of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/benefit-grants/

Parameters:

  • type (optional): Filter by benefit type.
  • benefit_id (optional): Filter by benefit ID.
  • checkout_id (optional): Filter by checkout ID.
  • order_id (optional): Filter by order ID.
  • subscription_id (optional): Filter by subscription ID.
  • 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::CustomerBenefitGrant)

Raises:

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

Update Benefit Grant

Update a benefit grant for the authenticated customer.

Scopes: customer_portal:write

Endpoint: PATCH /v1/customer-portal/benefit-grants/{id}

Parameters:

  • id (required): The benefit grant ID.
  • body (required): Request body as Polar::Models::CustomerBenefitGrantUpdate

Returns: Polar::Models::CustomerBenefitGrant

Raises:

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