class

Polar::Api::CustomerPortal::Customers

Inherits Reference < Object

API client for customers operations in customer_portal context

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new Customers instance

@param client [Client] The Polar API client instance

Source

Instance methods

Add Customer Payment Method

Add a payment method to the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: POST /v1/customer-portal/customers/me/payment-methods

Parameters:

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

Returns: Polar::Models::CustomerPaymentMethodCreateResponse

Raises:

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

Confirm Customer Payment Method

Confirm a payment method for the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: POST /v1/customer-portal/customers/me/payment-methods/confirm

Parameters:

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

Returns: Polar::Models::CustomerPaymentMethodCreateResponse

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
delete(id : String)

Delete Customer Payment Method

Delete a payment method from the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: DELETE /v1/customer-portal/customers/me/payment-methods/{id}

Parameters:

  • id (required): Path parameter

Returns: JSON response string

Raises:

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

Get Customer

Get authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/customers/me

Returns: Polar::Models::CustomerPortalCustomer

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(page : Int32 | Nil = nil, limit : Int32 | Nil = nil) : Polar::Models::ListResource(Polar::Models::CustomerPaymentMethod)

List Customer Payment Methods

Get saved payment methods of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/customers/me/payment-methods

Parameters:

  • page (optional): Page number, defaults to 1.
  • limit (optional): Size of a page, defaults to 10. Maximum is 100.

Returns: Polar::Models::ListResource(Polar::Models::CustomerPaymentMethod)

Raises:

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

Update Customer

Update authenticated customer.

Scopes: customer_portal:write

Endpoint: PATCH /v1/customer-portal/customers/me

Parameters:

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

Returns: Polar::Models::CustomerPortalCustomer

Raises:

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