Polarex.CustomerPortal (Polarex v0.2.3)
View SourceProvides API endpoints related to customer portal
Summary
Functions
Get Benefit Grant
List Benefit Grants
Update Benefit Grant
Get Customer Meter
List Meters
Add Customer Payment Method
Delete Customer Payment Method
Get Customer
Get Customer Payment Methods
Update Customer
List Downloadables
Activate License Key
Deactivate License Key
Get License Key
List License Keys
Validate License Key
Generate Order Invoice
Get Order Invoice
List Orders
Update Order
Get Organization
Cancel Subscription
Get Subscription
List Subscriptions
Update Subscription
Functions
@spec customer_portal_benefit_grants_get( String.t(), keyword() ) :: {:ok, Polarex.CustomerBenefitGrantCustom.t() | Polarex.CustomerBenefitGrantDiscord.t() | Polarex.CustomerBenefitGrantDownloadables.t() | Polarex.CustomerBenefitGrantGitHubRepository.t() | Polarex.CustomerBenefitGrantLicenseKeys.t() | Polarex.CustomerBenefitGrantMeterCredit.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Get Benefit Grant
Get a benefit grant by ID for the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
@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.
@spec customer_portal_benefit_grants_update( String.t(), Polarex.CustomerBenefitGrantCustomUpdate.t() | Polarex.CustomerBenefitGrantDiscordUpdate.t() | Polarex.CustomerBenefitGrantDownloadablesUpdate.t() | Polarex.CustomerBenefitGrantGitHubRepositoryUpdate.t() | Polarex.CustomerBenefitGrantLicenseKeysUpdate.t() | Polarex.CustomerBenefitGrantMeterCreditUpdate.t(), keyword() ) :: {:ok, Polarex.CustomerBenefitGrantCustom.t() | Polarex.CustomerBenefitGrantDiscord.t() | Polarex.CustomerBenefitGrantDownloadables.t() | Polarex.CustomerBenefitGrantGitHubRepository.t() | Polarex.CustomerBenefitGrantLicenseKeys.t() | Polarex.CustomerBenefitGrantMeterCredit.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.NotPermitted.t() | Polarex.ResourceNotFound.t()}
Update Benefit Grant
Update a benefit grant for the authenticated customer.
Scopes: customer_portal:write
@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
@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.
@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
@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
@spec customer_portal_customers_get(keyword()) :: {:ok, Polarex.CustomerPortalCustomer.t()} | :error
Get Customer
Get authenticated customer.
Scopes: customer_portal:read
customer_portal:write
@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.
@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
@spec customer_portal_downloadables_customer_portal_downloadables_get( String.t(), keyword() ) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}
Get Downloadable
@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.
@spec customer_portal_license_keys_activate( Polarex.LicenseKeyActivate.t(), keyword() ) :: {:ok, Polarex.LicenseKeyActivationRead.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.NotPermitted.t() | Polarex.ResourceNotFound.t()}
Activate License Key
Activate a license key instance.
@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.
@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
@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 benefitpage
: Page number, defaults to 1.limit
: Size of a page, defaults to 10. Maximum is 100.
@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.
@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
@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
@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
@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.
@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
@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.
@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