class

Polar::Api::Wallets

Inherits Reference < Object

API client for wallets operations

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new Wallets instance

@param client [Client] The Polar API client instance

Source

Instance methods

Get Wallet

Get a wallet by ID.

Scopes: wallets:read

Endpoint: GET /v1/wallets/{id}

Parameters:

  • id (required): The wallet ID.

Returns: Polar::Models::Wallet

Raises:

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

List Wallets

List wallets.

Scopes: wallets:read

Endpoint: GET /v1/wallets/

Parameters:

  • organization_id (optional): Filter by organization ID.
  • customer_id (optional): Filter by customer 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::Wallet)

Raises:

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

Top-Up Wallet

Top-up a wallet by adding funds to its balance.

The customer should have a valid payment method on file.

Scopes: wallets:write

Endpoint: POST /v1/wallets/{id}/top-up

Parameters:

  • id (required): The wallet ID.
  • body (required): Request body as Polar::Models::WalletTopUpCreate

Returns: Polar::Models::Wallet

Raises:

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