Polarex.Documented (Polarex v0.2.3)

View Source

Provides API endpoints related to documented

Summary

Functions

List Benefit Grants

List Checkout Links

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 Custom Fields

List Customer Meters

Get Customer State by External ID

List License Keys

Get Meter Quantities

Get Metrics Limits

Get Order Invoice

List Organizations

Export Subscriptions

List Subscriptions

Functions

benefits_create(body, opts \\ [])

Create Benefit

Create a benefit.

Scopes: benefits:write

benefits_delete(id, opts \\ [])

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

Delete Benefit

Delete a benefit.

[!WARNING] Every grants associated with the benefit will be revoked. Users will lose access to the benefit.

Scopes: benefits:write

benefits_get(id, opts \\ [])

Get Benefit

Get a benefit by ID.

Scopes: benefits:read benefits:write

benefits_grants(id, opts \\ [])

List Benefit Grants

List the individual grants for a benefit.

It's especially useful to check if a user has been granted a benefit.

Scopes: benefits:read benefits:write

Options

  • is_granted: Filter by granted status. If true, only granted benefits will be returned. If false, only revoked benefits will be returned.
  • customer_id: Filter by customer.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

benefits_list(opts \\ [])

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

List Benefits

List benefits.

Scopes: benefits:read benefits:write

Options

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

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

Update Benefit

Update a benefit.

Scopes: benefits:write

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

custom_fields_create(body, opts \\ [])

Create Custom Field

Create a custom field.

Scopes: custom_fields:write

custom_fields_delete(id, opts \\ [])

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

Delete Custom Field

Delete a custom field.

Scopes: custom_fields:write

custom_fields_get(id, opts \\ [])

Get Custom Field

Get a custom field by ID.

Scopes: custom_fields:read custom_fields:write

custom_fields_list(opts \\ [])

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

List Custom Fields

List custom fields.

Scopes: custom_fields:read custom_fields:write

Options

  • organization_id: Filter by organization ID.
  • query: Filter by custom field name or slug.
  • type: Filter by custom field type.
  • 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.

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

Update Custom Field

Update a custom field.

Scopes: custom_fields: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_benefit_grants_get(id, opts \\ [])

Get Benefit Grant

Get a benefit grant by ID for the authenticated customer.

Scopes: customer_portal:read customer_portal:write

customer_portal_benefit_grants_list(opts \\ [])

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

List Benefit Grants

List benefits grants of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Options

  • type: Filter by benefit type.
  • benefit_id: Filter by benefit ID.
  • organization_id: Filter by organization ID.
  • checkout_id: Filter by checkout ID.
  • order_id: Filter by order ID.
  • subscription_id: Filter by subscription 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_benefit_grants_update(id, body, opts \\ [])

Update Benefit Grant

Update a benefit grant for the authenticated customer.

Scopes: customer_portal:write

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_customers_add_payment_method(body, opts \\ [])

@spec customer_portal_customers_add_payment_method(
  Polarex.CustomerPaymentMethodCreate.t(),
  keyword()
) ::
  {:ok, Polarex.PaymentMethodCard.t() | Polarex.PaymentMethodGeneric.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Add Customer Payment Method

Add a payment method to the authenticated customer.

Scopes: customer_portal:read customer_portal:write

customer_portal_customers_delete_payment_method(id, opts \\ [])

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

Delete Customer Payment Method

Delete a payment method from the authenticated customer.

Scopes: customer_portal:read customer_portal:write

customer_portal_customers_get(opts \\ [])

@spec customer_portal_customers_get(keyword()) ::
  {:ok, Polarex.CustomerPortalCustomer.t()} | :error

Get Customer

Get authenticated customer.

Scopes: customer_portal:read customer_portal:write

customer_portal_customers_get_payment_methods(opts \\ [])

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

Get Customer Payment Methods

Get saved payment methods of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Options

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

customer_portal_customers_update(body, opts \\ [])

@spec customer_portal_customers_update(
  Polarex.CustomerPortalCustomerUpdate.t(),
  keyword()
) ::
  {:ok, Polarex.CustomerPortalCustomer.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Update Customer

Update authenticated customer.

Scopes: customer_portal:write

customer_portal_downloadables_customer_portal_downloadables_get(token, opts \\ [])

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

Get Downloadable

customer_portal_downloadables_list(opts \\ [])

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

List Downloadables

Scopes: customer_portal:read customer_portal: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.

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_orders_generate_invoice(id, opts \\ [])

@spec customer_portal_orders_generate_invoice(
  String.t(),
  keyword()
) ::
  {:ok, map()}
  | {:error,
     Polarex.InvoiceAlreadyExists.t()
     | Polarex.MissingInvoiceBillingDetails.t()
     | Polarex.NotPaidOrder.t()}

Generate Order Invoice

Trigger generation of an order's invoice.

Scopes: customer_portal:read customer_portal:write

customer_portal_orders_get(id, opts \\ [])

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

Get Order

Get an order by ID for the authenticated customer.

Scopes: customer_portal:read customer_portal:write

customer_portal_orders_invoice(id, opts \\ [])

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

Get Order Invoice

Get an order's invoice data.

Scopes: customer_portal:read customer_portal:write

customer_portal_orders_list(opts \\ [])

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

List Orders

List orders of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Options

  • organization_id: Filter by organization ID.
  • product_id: Filter by product ID.
  • product_billing_type: Filter by product billing type. recurring will filter data corresponding to subscriptions creations or renewals. one_time will filter data corresponding to one-time purchases.
  • subscription_id: Filter by subscription ID.
  • 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_orders_update(id, body, opts \\ [])

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

Update Order

Update an order for the authenticated customer.

Scopes: customer_portal:write

customer_portal_organizations_get(slug, opts \\ [])

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

Get Organization

Get a customer portal's organization by slug.

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.

files_create(body, opts \\ [])

Create File

Create a file.

Scopes: files:write

files_delete(id, opts \\ [])

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

Delete File

Delete a file.

Scopes: files:write

files_list(opts \\ [])

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

List Files

List files.

Scopes: files:read files:write

Options

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

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

Update File

Update a file.

Scopes: files:write

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

Complete File Upload

Complete a file upload.

Scopes: files:write

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

metrics_get(opts \\ [])

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

Get Metrics

Get metrics about your orders and subscriptions.

Currency values are output in cents.

Scopes: metrics:read

Options

  • start_date: Start date.
  • end_date: End date.
  • interval: Interval between two timestamps.
  • organization_id: Filter by organization ID.
  • product_id: Filter by product ID.
  • billing_type: Filter by billing type. recurring will filter data corresponding to subscriptions creations or renewals. one_time will filter data corresponding to one-time purchases.
  • customer_id: Filter by customer ID.

metrics_limits(opts \\ [])

@spec metrics_limits(keyword()) :: {:ok, Polarex.MetricsLimits.t()} | :error

Get Metrics Limits

Get the interval limits for the metrics endpoint.

Scopes: metrics:read

oauth2_authorize(opts \\ [])

@spec oauth2_authorize(keyword()) ::
  {:ok,
   Polarex.AuthorizeResponseOrganization.t() | Polarex.AuthorizeResponseUser.t()}
  | :error

Authorize

oauth2_clients_list(opts \\ [])

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

List Clients

List OAuth2 clients.

Options

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

oauth2_clients_oauth2_create_client(body, opts \\ [])

@spec oauth2_clients_oauth2_create_client(
  Polarex.OAuth2ClientConfiguration.t(),
  keyword()
) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}

Create Client

Create an OAuth2 client.

oauth2_clients_oauth2_delete_client(client_id, opts \\ [])

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

Delete Client

Delete an OAuth2 client.

oauth2_clients_oauth2_get_client(client_id, opts \\ [])

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

Get Client

Get an OAuth2 client by Client ID.

oauth2_clients_oauth2_update_client(client_id, body, opts \\ [])

@spec oauth2_clients_oauth2_update_client(
  String.t(),
  Polarex.OAuth2ClientConfigurationUpdate.t(),
  keyword()
) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}

Update Client

Update an OAuth2 client.

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.

orders_generate_invoice(id, opts \\ [])

@spec orders_generate_invoice(
  String.t(),
  keyword()
) ::
  {:ok, map()}
  | {:error,
     Polarex.InvoiceAlreadyExists.t()
     | Polarex.MissingInvoiceBillingDetails.t()
     | Polarex.NotPaidOrder.t()}

Generate Order Invoice

Trigger generation of an order's invoice.

Scopes: orders:read

orders_get(id, opts \\ [])

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

Get Order

Get an order by ID.

Scopes: orders:read

orders_invoice(id, opts \\ [])

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

Get Order Invoice

Get an order's invoice data.

Scopes: orders:read

orders_list(opts \\ [])

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

List Orders

List orders.

Scopes: orders:read

Options

  • organization_id: Filter by organization ID.
  • product_id: Filter by product ID.
  • product_billing_type: Filter by product billing type. recurring will filter data corresponding to subscriptions creations or renewals. one_time will filter data corresponding to one-time purchases.
  • discount_id: Filter by discount ID.
  • customer_id: Filter by customer ID.
  • checkout_id: Filter by checkout 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.
  • metadata: Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.

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

Update Order

Update an order.

Scopes: orders:write

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

payments_get(id, opts \\ [])

Get Payment

Get a payment by ID.

Scopes: payments:read

payments_list(opts \\ [])

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

List Payments

List payments.

Scopes: payments:read

Options

  • organization_id: Filter by organization ID.
  • checkout_id: Filter by checkout ID.
  • order_id: Filter by order ID.
  • status: Filter by payment status.
  • method: Filter by payment method.
  • customer_email: 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.

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

refunds_create(body, opts \\ [])

Create Refund

Create a refund.

Scopes: refunds:write

refunds_list(opts \\ [])

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

List Refunds

List products.

Scopes: refunds:read refunds:write

Options

  • id: Filter by refund ID.
  • organization_id: Filter by organization ID.
  • order_id: Filter by order ID.
  • subscription_id: Filter by subscription ID.
  • customer_id: Filter by customer ID.
  • succeeded: Filter by succeeded.
  • 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.

subscriptions_export(opts \\ [])

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

subscriptions_get(id, opts \\ [])

@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

subscriptions_list(opts \\ [])

@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 the deepObject style, e.g. ?metadata[key]=value.

subscriptions_revoke(id, opts \\ [])

Revoke Subscription

Revoke a subscription, i.e cancel immediately.

Scopes: subscriptions:write

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

Update Subscription

Update a subscription.

Scopes: subscriptions:write

webhooks_create_webhook_endpoint(body, opts \\ [])

@spec webhooks_create_webhook_endpoint(
  Polarex.WebhookEndpointCreate.t(),
  keyword()
) ::
  {:ok, Polarex.WebhookEndpoint.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Webhook Endpoint

Create a webhook endpoint.

Scopes: webhooks:write

webhooks_delete_webhook_endpoint(id, opts \\ [])

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

Delete Webhook Endpoint

Delete a webhook endpoint.

Scopes: webhooks:write

webhooks_get_webhook_endpoint(id, opts \\ [])

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

Get Webhook Endpoint

Get a webhook endpoint by ID.

Scopes: webhooks:read webhooks:write

webhooks_list_webhook_deliveries(opts \\ [])

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

List Webhook Deliveries

List webhook deliveries.

Deliveries are all the attempts to deliver a webhook event to an endpoint.

Scopes: webhooks:read webhooks:write

Options

  • endpoint_id: Filter by webhook endpoint ID.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

webhooks_list_webhook_endpoints(opts \\ [])

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

List Webhook Endpoints

List webhook endpoints.

Scopes: webhooks:read webhooks:write

Options

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

webhooks_redeliver_webhook_event(id, opts \\ [])

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

Redeliver Webhook Event

Schedule the re-delivery of a webhook event.

Scopes: webhooks:write

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

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

Update Webhook Endpoint

Update a webhook endpoint.

Scopes: webhooks:write