Polar::Api::CustomerPortal::Subscriptions
API client for subscriptions operations in customer_portal context
Constants
Constructors
Creates a new Subscriptions instance
@param client [Client] The Polar API client instance
Instance methods
Cancel Subscription
Cancel a subscription of the authenticated customer.
Scopes: customer_portal:write
Endpoint: DELETE /v1/customer-portal/subscriptions/{id}
Parameters:
id(required): The subscription ID.
Returns: Polar::Models::CustomerSubscription
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Get Subscription
Get a subscription for the authenticated customer.
Scopes: customer_portal:read customer_portal:write
Endpoint: GET /v1/customer-portal/subscriptions/{id}
Parameters:
id(required): The subscription ID.
Returns: Polar::Models::CustomerSubscription
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
List Subscriptions
List subscriptions of the authenticated customer.
Scopes: customer_portal:read customer_portal:write
Endpoint: GET /v1/customer-portal/subscriptions/
Parameters:
product_id(optional): Filter by product ID.active(optional): Filter by active or cancelled subscription.query(optional): Search by product or organization name.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::CustomerSubscription)
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Update Subscription
Update a subscription of the authenticated customer.
Scopes: customer_portal:write
Endpoint: PATCH /v1/customer-portal/subscriptions/{id}
Parameters:
id(required): The subscription ID.body(required): Request body as Polar::Models::CustomerSubscriptionUpdate
Returns: Polar::Models::CustomerSubscription
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors