Polarex.Featured (Polarex v0.2.3)

View Source

Provides API endpoints related to featured

Summary

Functions

Confirm Checkout Session from Client

Get Checkout Session from Client

Update Checkout Session from Client

Create Checkout Session

Get Checkout Session

List Checkout Sessions

Update Checkout Session

List Customer Meters

Get Customer State by External ID

List License Keys

Get Meter Quantities

List Organizations

Functions

checkouts_client_confirm(client_secret, body, opts \\ [])

Confirm Checkout Session from Client

Confirm a checkout session by client secret.

Orders and subscriptions will be processed.

checkouts_client_get(client_secret, opts \\ [])

Get Checkout Session from Client

Get a checkout session by client secret.

checkouts_client_update(client_secret, body, opts \\ [])

Update Checkout Session from Client

Update a checkout session by client secret.

checkouts_create(body, opts \\ [])

@spec checkouts_create(
  Polarex.CheckoutProductsCreate.t(),
  keyword()
) :: {:ok, Polarex.Checkout.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Checkout Session

Create a checkout session.

Scopes: checkouts:write

checkouts_get(id, opts \\ [])

@spec checkouts_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.Checkout.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Checkout Session

Get a checkout session by ID.

Scopes: checkouts:read checkouts:write

checkouts_list(opts \\ [])

@spec checkouts_list(keyword()) ::
  {:ok, Polarex.ListResourceCheckout.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Checkout Sessions

List checkout sessions.

Scopes: checkouts:read checkouts:write

Options

  • organization_id: Filter by organization ID.
  • product_id: Filter by product ID.
  • customer_id: Filter by customer ID.
  • status: Filter by checkout session status.
  • query: Filter by customer email.
  • 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.

checkouts_update(id, body, opts \\ [])

Update Checkout Session

Update a checkout session.

Scopes: checkouts:write

customer_meters_get(id, opts \\ [])

@spec customer_meters_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.CustomerMeter.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Customer Meter

Get a customer meter by ID.

Scopes: customer_meters:read

customer_meters_list(opts \\ [])

@spec customer_meters_list(keyword()) ::
  {:ok, Polarex.ListResourceCustomerMeter.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Customer Meters

List customer meters.

Scopes: customer_meters:read

Options

  • organization_id: Filter by organization ID.
  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by external customer ID.
  • meter_id: Filter by meter ID.
  • 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.

customer_portal_customer_meters_get(id, opts \\ [])

@spec customer_portal_customer_meters_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.CustomerCustomerMeter.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Customer Meter

Get a meter by ID for the authenticated customer.

Scopes: customer_portal:read customer_portal:write

customer_portal_customer_meters_list(opts \\ [])

@spec customer_portal_customer_meters_list(keyword()) ::
  {:ok, Polarex.ListResourceCustomerCustomerMeter.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Meters

List meters of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Options

  • meter_id: Filter by meter ID.
  • query: Filter by meter 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.

customer_portal_license_keys_activate(body, opts \\ [])

Activate License Key

Activate a license key instance.

customer_portal_license_keys_deactivate(body, opts \\ [])

@spec customer_portal_license_keys_deactivate(
  Polarex.LicenseKeyDeactivate.t(),
  keyword()
) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Deactivate License Key

Deactivate a license key instance.

customer_portal_license_keys_get(id, opts \\ [])

@spec customer_portal_license_keys_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.LicenseKeyWithActivations.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get License Key

Get a license key.

Scopes: customer_portal:read customer_portal:write

customer_portal_license_keys_list(opts \\ [])

@spec customer_portal_license_keys_list(keyword()) ::
  {:ok, Polarex.ListResourceLicenseKeyRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()
     | Polarex.Unauthorized.t()}

List License Keys

Scopes: customer_portal:read customer_portal:write

Options

  • organization_id: Filter by organization ID.
  • benefit_id: Filter by a specific benefit
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

customer_portal_license_keys_validate(body, opts \\ [])

@spec customer_portal_license_keys_validate(
  Polarex.LicenseKeyValidate.t(),
  keyword()
) ::
  {:ok, Polarex.ValidatedLicenseKey.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Validate License Key

Validate a license key.

customer_portal_subscriptions_cancel(id, opts \\ [])

@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

customer_portal_subscriptions_get(id, opts \\ [])

@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

customer_portal_subscriptions_list(opts \\ [])

@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.

customer_portal_subscriptions_update(id, body, opts \\ [])

Update Subscription

Update a subscription of the authenticated customer.

Scopes: customer_portal:write

customer_sessions_create(body, opts \\ [])

Create Customer Session

Create a customer session.

Scopes: customer_sessions:write

customers_create(body, opts \\ [])

@spec customers_create(
  Polarex.CustomerCreate.t(),
  keyword()
) :: {:ok, Polarex.Customer.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Customer

Create a customer.

Scopes: customers:write

customers_delete(id, opts \\ [])

@spec customers_delete(
  String.t(),
  keyword()
) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Delete Customer

Delete a customer.

This action cannot be undone and will immediately:

  • Cancel any active subscriptions for the customer
  • Revoke all their benefits
  • Clear any external_id

Use it only in the context of deleting a user within your own service. Otherwise, use more granular API endpoints to cancel a specific subscription or revoke certain benefits.

Note: The customers information will nonetheless be retained for historic orders and subscriptions.

Scopes: customers:write

customers_delete_external(external_id, opts \\ [])

@spec customers_delete_external(
  String.t(),
  keyword()
) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Delete Customer by External ID

Delete a customer by external ID.

Immediately cancels any active subscriptions and revokes any active benefits.

Scopes: customers:write

customers_get(id, opts \\ [])

@spec customers_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.Customer.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Customer

Get a customer by ID.

Scopes: customers:read customers:write

customers_get_external(external_id, opts \\ [])

@spec customers_get_external(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.Customer.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Customer by External ID

Get a customer by external ID.

Scopes: customers:read customers:write

customers_get_state(id, opts \\ [])

@spec customers_get_state(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.CustomerState.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Customer State

Get a customer state by ID.

The customer state includes information about the customer's active subscriptions and benefits.

It's the ideal endpoint to use when you need to get a full overview of a customer's status.

Scopes: customers:read customers:write

customers_get_state_external(external_id, opts \\ [])

@spec customers_get_state_external(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.CustomerState.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Customer State by External ID

Get a customer state by external ID.

The customer state includes information about the customer's active subscriptions and benefits.

It's the ideal endpoint to use when you need to get a full overview of a customer's status.

Scopes: customers:read customers:write

customers_list(opts \\ [])

@spec customers_list(keyword()) ::
  {:ok, Polarex.ListResourceCustomer.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Customers

List customers.

Scopes: customers:read customers:write

Options

  • organization_id: Filter by organization ID.
  • email: Filter by exact email.
  • query: Filter by name or email.
  • 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 the deepObject style, e.g. ?metadata[key]=value.

customers_update(id, body, opts \\ [])

Update Customer

Update a customer.

Scopes: customers:write

customers_update_external(external_id, body, opts \\ [])

Update Customer by External ID

Update a customer by external ID.

Scopes: customers:write

discounts_create(body, opts \\ [])

Create Discount

Create a discount.

Scopes: discounts:write

discounts_delete(id, opts \\ [])

@spec discounts_delete(
  String.t(),
  keyword()
) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Delete Discount

Delete a discount.

Scopes: discounts:write

discounts_get(id, opts \\ [])

Get Discount

Get a discount by ID.

Scopes: discounts:read discounts:write

discounts_list(opts \\ [])

@spec discounts_list(keyword()) ::
  {:ok, Polarex.ListResourceDiscount.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Discounts

List discounts.

Scopes: discounts:read discounts:write

Options

  • organization_id: Filter by organization ID.
  • query: Filter by 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.

discounts_update(id, body, opts \\ [])

Update Discount

Update a discount.

Scopes: discounts:write

events_get(id, opts \\ [])

@spec events_get(
  String.t(),
  keyword()
) ::
  {:ok, map() | Polarex.UserEvent.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Event

Get an event by ID.

Scopes: events:read events:write

events_ingest(body, opts \\ [])

@spec events_ingest(
  Polarex.EventsIngest.t(),
  keyword()
) ::
  {:ok, Polarex.EventsIngestResponse.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Ingest Events

Ingest batch of events.

Scopes: events:write

events_list(opts \\ [])

@spec events_list(keyword()) ::
  {:ok, Polarex.ListResourceEvent.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Events

List events.

Scopes: events:read events:write

Options

  • filter: Filter events following filter clauses. JSON string following the same schema a meter filter clause.
  • start_timestamp: Filter events after this timestamp.
  • end_timestamp: Filter events before this timestamp.
  • organization_id: Filter by organization ID.
  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by external customer ID.
  • meter_id: Filter by a meter filter clause.
  • name: Filter by event name.
  • source: Filter by event source.
  • 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 the deepObject style, e.g. ?metadata[key]=value.

events_list_names(opts \\ [])

@spec events_list_names(keyword()) ::
  {:ok, Polarex.ListResourceEventName.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Event Names

List event names.

Scopes: events:read events:write

Options

  • organization_id: Filter by organization ID.
  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by external customer ID.
  • source: Filter by event source.
  • query: Query to filter event names.
  • 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.

license_keys_get(id, opts \\ [])

Get License Key

Get a license key.

Scopes: license_keys:read license_keys:write

license_keys_get_activation(id, activation_id, opts \\ [])

Get Activation

Get a license key activation.

Scopes: license_keys:read license_keys:write

license_keys_list(opts \\ [])

List License Keys

Get license keys connected to the given organization & filters.

Scopes: license_keys:read license_keys:write

Options

  • organization_id: Filter by organization ID.
  • benefit_id: Filter by benefit ID.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

license_keys_update(id, body, opts \\ [])

Update License Key

Update a license key.

Scopes: license_keys:write

meters_create(body, opts \\ [])

@spec meters_create(
  Polarex.MeterCreate.t(),
  keyword()
) :: {:ok, Polarex.Meter.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Meter

Create a meter.

Scopes: meters:write

meters_get(id, opts \\ [])

@spec meters_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.Meter.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Meter

Get a meter by ID.

Scopes: meters:read meters:write

meters_list(opts \\ [])

@spec meters_list(keyword()) ::
  {:ok, Polarex.ListResourceMeter.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Meters

List meters.

Scopes: meters:read meters:write

Options

  • organization_id: Filter by organization ID.
  • query: Filter by 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.
  • metadata: Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.

meters_quantities(id, opts \\ [])

@spec meters_quantities(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.MeterQuantities.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Meter Quantities

Get quantities of a meter over a time period.

Scopes: meters:read meters:write

Options

  • start_timestamp: Start timestamp.
  • end_timestamp: End timestamp.
  • interval: Interval between two timestamps.
  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by external customer ID.

meters_update(id, body, opts \\ [])

Update Meter

Update a meter.

Scopes: meters:write

oauth2_introspect_token(body, opts \\ [])

@spec oauth2_introspect_token(
  Polarex.IntrospectTokenRequest.t(),
  keyword()
) :: {:ok, Polarex.IntrospectTokenResponse.t()} | :error

Introspect Token

Get information about an access token.

oauth2_request_token(body, opts \\ [])

Request Token

Request an access token using a valid grant.

oauth2_revoke_token(body, opts \\ [])

@spec oauth2_revoke_token(
  Polarex.RevokeTokenRequest.t(),
  keyword()
) :: {:ok, map()} | :error

Revoke Token

Revoke an access token or a refresh token.

oauth2_userinfo(opts \\ [])

@spec oauth2_userinfo(keyword()) ::
  {:ok, Polarex.UserInfoOrganization.t() | Polarex.UserInfoUser.t()} | :error

Get User Info

Get information about the authenticated user.

organizations_create(body, opts \\ [])

@spec organizations_create(
  Polarex.OrganizationCreate.t(),
  keyword()
) :: {:ok, Polarex.Organization.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Organization

Create an organization.

Scopes: organizations:write

organizations_get(id, opts \\ [])

@spec organizations_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.Organization.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Organization

Get an organization by ID.

Scopes: organizations:read organizations:write

organizations_list(opts \\ [])

@spec organizations_list(keyword()) ::
  {:ok, Polarex.ListResourceOrganization.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Organizations

List organizations.

Scopes: organizations:read organizations:write

Options

  • slug: Filter by slug.
  • 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.

organizations_update(id, body, opts \\ [])

Update Organization

Update an organization.

Scopes: organizations:write

products_create(body, opts \\ [])

@spec products_create(
  Polarex.ProductCreate.t(),
  keyword()
) :: {:ok, Polarex.Product.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Product

Create a product.

Scopes: products:write

products_get(id, opts \\ [])

@spec products_get(
  String.t(),
  keyword()
) ::
  {:ok, Polarex.Product.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Product

Get a product by ID.

Scopes: products:read products:write

products_list(opts \\ [])

@spec products_list(keyword()) ::
  {:ok, Polarex.ListResourceProduct.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Products

List products.

Scopes: products:read products:write

Options

  • id: Filter by product ID.
  • organization_id: Filter by organization ID.
  • query: Filter by product name.
  • is_archived: Filter on archived products.
  • is_recurring: Filter on recurring products. If true, only subscriptions tiers are returned. If false, only one-time purchase products are returned.
  • benefit_id: Filter products granting specific benefit.
  • 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.

products_update(id, body, opts \\ [])

Update Product

Update a product.

Scopes: products:write

products_update_benefits(id, body, opts \\ [])

Update Product Benefits

Update benefits granted by a product.

Scopes: products:write