Polarex.Customers (Polarex v0.1.0)
View SourceProvides API endpoints related to customers
Summary
Functions
Add Customer Payment Method
Delete Customer Payment Method
Get Customer
Get Customer Payment Methods
Update Customer
Create Customer
Delete Customer
Delete Customer by External ID
Get Customer
Get Customer by External ID
Get Customer State
Get Customer State by External ID
List Customers
Update Customer
Update Customer by External ID
Functions
@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 customers_create( Polarex.CustomerCreate.t(), keyword() ) :: {:ok, Polarex.Customer.t()} | {:error, Polarex.HTTPValidationError.t()}
Create Customer
Create a customer.
Scopes: customers:write
@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
@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
@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
@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
@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
@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
@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 thedeepObject
style, e.g.?metadata[key]=value
.
@spec customers_update(String.t(), Polarex.CustomerUpdate.t(), keyword()) :: {:ok, Polarex.Customer.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Update Customer
Update a customer.
Scopes: customers:write
@spec customers_update_external( String.t(), Polarex.CustomerUpdateExternalID.t(), keyword() ) :: {:ok, Polarex.Customer.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Update Customer by External ID
Update a customer by external ID.
Scopes: customers:write