Customers
Customers API operations.
Summary
Functions
Create Customer
Delete Customer
Delete Customer by External ID
Export Customers
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 create_customer(PolarExpress.Client.t(), map(), keyword()) :: {:ok, PolarExpress.Schemas.CustomerWithMembers.t()} | {:error, PolarExpress.Error.t()}
Create Customer
Create a customer.
Scopes: customers:write
See PolarExpress.Params.CustomersCreateCustomerParams for parameter details.
@spec delete_customer(PolarExpress.Client.t(), String.t(), map(), keyword()) :: {:ok, term()} | {:error, PolarExpress.Error.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.
Set anonymize=true to also anonymize PII for GDPR compliance.
Scopes: customers:write
See PolarExpress.Params.CustomersDeleteCustomerParams for parameter details.
@spec delete_customer_by_external_id( PolarExpress.Client.t(), String.t(), map(), keyword() ) :: {:ok, term()} | {:error, PolarExpress.Error.t()}
Delete Customer by External ID
Delete a customer by external ID.
Immediately cancels any active subscriptions and revokes any active benefits.
Set anonymize=true to also anonymize PII for GDPR compliance.
Scopes: customers:write
See PolarExpress.Params.CustomersDeleteCustomerByExternalIdParams for parameter details.
@spec export_customers(PolarExpress.Client.t(), map(), keyword()) :: {:ok, term()} | {:error, PolarExpress.Error.t()}
Export Customers
Export customers as a CSV file.
Scopes: customers:read customers:write
See PolarExpress.Params.CustomersExportCustomersParams for parameter details.
@spec get_customer(PolarExpress.Client.t(), String.t(), map(), keyword()) :: {:ok, PolarExpress.Schemas.CustomerWithMembers.t()} | {:error, PolarExpress.Error.t()}
Get Customer
Get a customer by ID.
Scopes: customers:read customers:write
See PolarExpress.Params.CustomersGetCustomerParams for parameter details.
@spec get_customer_by_external_id( PolarExpress.Client.t(), String.t(), map(), keyword() ) :: {:ok, PolarExpress.Schemas.CustomerWithMembers.t()} | {:error, PolarExpress.Error.t()}
Get Customer by External ID
Get a customer by external ID.
Scopes: customers:read customers:write
See PolarExpress.Params.CustomersGetCustomerByExternalIdParams for parameter details.
@spec get_customer_state(PolarExpress.Client.t(), String.t(), map(), keyword()) :: {:ok, PolarExpress.Schemas.CustomerState.t()} | {:error, PolarExpress.Error.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
See PolarExpress.Params.CustomersGetCustomerStateParams for parameter details.
@spec get_customer_state_by_external_id( PolarExpress.Client.t(), String.t(), map(), keyword() ) :: {:ok, PolarExpress.Schemas.CustomerState.t()} | {:error, PolarExpress.Error.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
See PolarExpress.Params.CustomersGetCustomerStateByExternalIdParams for parameter details.
@spec list_customers(PolarExpress.Client.t(), map(), keyword()) :: {:ok, PolarExpress.ListObject.t()} | {:error, PolarExpress.Error.t()}
List Customers
List customers.
Scopes: customers:read customers:write
See PolarExpress.Params.CustomersListCustomersParams for parameter details.
@spec update_customer(PolarExpress.Client.t(), String.t(), map(), keyword()) :: {:ok, PolarExpress.Schemas.CustomerWithMembers.t()} | {:error, PolarExpress.Error.t()}
Update Customer
Update a customer.
Scopes: customers:write
See PolarExpress.Params.CustomersUpdateCustomerParams for parameter details.
@spec update_customer_by_external_id( PolarExpress.Client.t(), String.t(), map(), keyword() ) :: {:ok, PolarExpress.Schemas.CustomerWithMembers.t()} | {:error, PolarExpress.Error.t()}
Update Customer by External ID
Update a customer by external ID.
Scopes: customers:write
See PolarExpress.Params.CustomersUpdateCustomerByExternalIdParams for parameter details.