Polarex.Subscriptions (Polarex v0.1.0)
View SourceProvides API endpoints related to subscriptions
Summary
Functions
Cancel Subscription
Get Subscription
List Subscriptions
Update Subscription
Export Subscriptions
Get Subscription
List Subscriptions
Revoke Subscription
Update Subscription
Functions
@spec customer_portal_subscriptions_cancel( String.t(), keyword() ) :: {:ok, Polarex.CustomerSubscription.t()} | {:error, Polarex.AlreadyCanceledSubscription.t() | Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Cancel Subscription
Cancel a subscription of the authenticated customer.
Scopes: customer_portal:write
@spec customer_portal_subscriptions_get( String.t(), keyword() ) :: {:ok, Polarex.CustomerSubscription.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Get Subscription
Get a subscription for the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
@spec customer_portal_subscriptions_list(keyword()) :: {:ok, Polarex.ListResourceCustomerSubscription.t()} | {:error, Polarex.HTTPValidationError.t()}
List Subscriptions
List subscriptions of the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
Options
organization_id
: Filter by organization ID.product_id
: Filter by product ID.active
: Filter by active or cancelled subscription.query
: Search by product or organization name.page
: Page number, defaults to 1.limit
: Size of a page, defaults to 10. Maximum is 100.sorting
: 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.
@spec customer_portal_subscriptions_update( String.t(), Polarex.CustomerSubscriptionCancel.t() | Polarex.CustomerSubscriptionUpdateProduct.t(), keyword() ) :: {:ok, Polarex.CustomerSubscription.t()} | {:error, Polarex.AlreadyCanceledSubscription.t() | Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Update Subscription
Update a subscription of the authenticated customer.
Scopes: customer_portal:write
@spec subscriptions_export(keyword()) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}
Export Subscriptions
Export subscriptions as a CSV file.
Scopes: subscriptions:read
subscriptions:write
Options
organization_id
: Filter by organization ID.
@spec subscriptions_get( String.t(), keyword() ) :: {:ok, Polarex.Subscription.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Get Subscription
Get a subscription by ID.
Scopes: subscriptions:write
@spec subscriptions_list(keyword()) :: {:ok, Polarex.ListResourceSubscription.t()} | {:error, Polarex.HTTPValidationError.t()}
List Subscriptions
List subscriptions.
Scopes: subscriptions:read
subscriptions:write
Options
organization_id
: Filter by organization ID.product_id
: Filter by product ID.customer_id
: Filter by customer ID.discount_id
: Filter by discount ID.active
: Filter by active or inactive subscription.page
: Page number, defaults to 1.limit
: Size of a page, defaults to 10. Maximum is 100.sorting
: 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.metadata
: Filter by metadata key-value pairs. It uses thedeepObject
style, e.g.?metadata[key]=value
.
@spec subscriptions_revoke( String.t(), keyword() ) :: {:ok, Polarex.Subscription.t()} | {:error, Polarex.AlreadyCanceledSubscription.t() | Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Revoke Subscription
Revoke a subscription, i.e cancel immediately.
Scopes: subscriptions:write
@spec subscriptions_update( String.t(), Polarex.SubscriptionCancel.t() | Polarex.SubscriptionRevoke.t() | Polarex.SubscriptionUpdateProduct.t(), keyword() ) :: {:ok, Polarex.Subscription.t()} | {:error, Polarex.AlreadyCanceledSubscription.t() | Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Update Subscription
Update a subscription.
Scopes: subscriptions:write