Polarex.Public (Polarex v0.3.1)

Copy Markdown View Source

Provides API endpoints related to public

Summary

Functions

List Benefit Grants

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

Export Customers

Get Customer State by External ID

List Event Types

List License Keys

Get Meter Quantities

Get Metrics Limits

List Metric Dashboards

Get Order Invoice

Get Order Receipt

List Organizations

Export Subscriptions

List Subscriptions

Functions

benefit_grants_list(opts \\ [])

@spec benefit_grants_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceBenefitGrant.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Benefit Grants

List benefit grants across all benefits accessible to the authenticated subject.

Scopes: benefits:read benefits:write

Options

  • organization_id: Filter by organization ID.
  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by customer external ID.
  • is_granted: Filter by granted status. If true, only granted benefits will be returned. If false, only revoked benefits will be returned.
  • 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_create(body, opts \\ [])

Create Benefit

Create a benefit.

Scopes: benefits:write

Request Body

Content Types: application/json

benefits_delete(id, opts \\ [])

@spec benefits_delete(id :: String.t(), opts :: 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 \\ [])

@spec benefits_grants(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.ListResourceBenefitGrant.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

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.
  • member_id: Filter by member.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

benefits_list(opts \\ [])

@spec benefits_list(opts :: 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.
  • id: Filter by benefit IDs.
  • exclude_id: Exclude benefits with these IDs.
  • 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.
  • metadata: Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.

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

Update Benefit

Update a benefit.

Scopes: benefits:write

Request Body

Content Types: application/json

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.

Request Body

Content Types: application/json

checkouts_client_get(client_secret, opts \\ [])

@spec checkouts_client_get(client_secret :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CheckoutPublic.t()}
  | {:error,
     Polarex.ExpiredCheckoutError.t()
     | Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()}

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.

Request Body

Content Types: application/json

checkouts_create(body, opts \\ [])

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

Create Checkout Session

Create a checkout session.

Scopes: checkouts:write

Request Body

Content Types: application/json

checkouts_get(id, opts \\ [])

@spec checkouts_get(id :: String.t(), opts :: 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(opts :: 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.
  • external_customer_id: Filter by customer external 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

Request Body

Content Types: application/json

custom_fields_create(body, opts \\ [])

Create Custom Field

Create a custom field.

Scopes: custom_fields:write

Request Body

Content Types: application/json

custom_fields_delete(id, opts \\ [])

@spec custom_fields_delete(id :: String.t(), opts :: 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(opts :: 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

Request Body

Content Types: application/json

customer_meters_get(id, opts \\ [])

@spec customer_meters_get(id :: String.t(), opts :: 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(opts :: 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(opts :: 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

  • query: Filter by benefit description.
  • type: Filter by benefit type.
  • benefit_id: Filter by benefit ID.
  • checkout_id: Filter by checkout ID.
  • order_id: Filter by order ID.
  • subscription_id: Filter by subscription ID.
  • member_id: Filter by member 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

Request Body

Content Types: application/json

customer_portal_customer_meters_get(id, opts \\ [])

@spec customer_portal_customer_meters_get(id :: String.t(), opts :: 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(opts :: 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_customer_session_get_authenticated_user(opts \\ [])

@spec customer_portal_customer_session_get_authenticated_user(opts :: keyword()) ::
  {:ok, Polarex.PortalAuthenticatedUser.t()} | :error

Get Authenticated Portal User

Get information about the currently authenticated portal user.

Scopes: customer_portal:read customer_portal:write

customer_portal_customer_session_introspect(opts \\ [])

@spec customer_portal_customer_session_introspect(opts :: keyword()) ::
  {:ok, Polarex.CustomerCustomerSession.t()} | :error

Introspect Customer Session

Introspect the current session and return its information.

Scopes: customer_portal:read customer_portal:write

customer_portal_customers_add_payment_method(body, opts \\ [])

Add Customer Payment Method

Add a payment method to the authenticated customer.

Request Body

Content Types: application/json

customer_portal_customers_check_email_update(opts \\ [])

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

Check Email Change Token

Check if an email change verification token is still valid.

Options

  • token

customer_portal_customers_confirm_payment_method(body, opts \\ [])

Confirm Customer Payment Method

Confirm a payment method for the authenticated customer.

Request Body

Content Types: application/json

customer_portal_customers_delete_payment_method(id, opts \\ [])

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

Delete Customer Payment Method

Delete a payment method from the authenticated customer.

customer_portal_customers_get(opts \\ [])

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

Get Customer

Get authenticated customer.

Scopes: customer_portal:read customer_portal:write

customer_portal_customers_list_payment_methods(opts \\ [])

@spec customer_portal_customers_list_payment_methods(opts :: keyword()) ::
  {:ok, Polarex.ListResourceCustomerPaymentMethod.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Customer Payment Methods

Get saved payment methods of the authenticated customer.

Options

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

customer_portal_customers_request_email_update(body, opts \\ [])

@spec customer_portal_customers_request_email_update(
  body :: Polarex.CustomerEmailUpdateRequest.t(),
  opts :: keyword()
) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}

Request Email Change

Request an email change for the authenticated customer.

Request Body

Content Types: application/json

customer_portal_customers_update(body, opts \\ [])

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

Update Customer

Update authenticated customer.

Request Body

Content Types: application/json

customer_portal_customers_verify_email_update(body, opts \\ [])

@spec customer_portal_customers_verify_email_update(
  body :: Polarex.CustomerEmailUpdateVerifyRequest.t(),
  opts :: keyword()
) :: {:ok, Polarex.CustomerEmailUpdateVerifyResponse.t()} | :error

Verify Email Change

Verify an email change using the token from the verification email.

Request Body

Content Types: application/json

customer_portal_downloadables_list(opts \\ [])

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

List Downloadables

Scopes: customer_portal:read customer_portal:write

Options

  • 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 \\ [])

@spec customer_portal_license_keys_activate(
  body :: Polarex.LicenseKeyActivate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.LicenseKeyActivationRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}

Activate License Key

Activate a license key instance.

This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the /v1/license-keys/activate endpoint instead.

Request Body

Content Types: application/json

customer_portal_license_keys_deactivate(body, opts \\ [])

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

Deactivate License Key

Deactivate a license key instance.

This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the /v1/license-keys/deactivate endpoint instead.

Request Body

Content Types: application/json

customer_portal_license_keys_get(id, opts \\ [])

@spec customer_portal_license_keys_get(id :: String.t(), opts :: 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(opts :: 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

  • 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(
  body :: Polarex.LicenseKeyValidate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.ValidatedLicenseKey.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Validate License Key

Validate a license key.

This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the /v1/license-keys/validate endpoint instead.

Request Body

Content Types: application/json

customer_portal_members_add_member(body, opts \\ [])

@spec customer_portal_members_add_member(
  body :: Polarex.CustomerPortalMemberCreate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerPortalMember.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Add Member

Add a new member to the customer's team.

Only available to owners and billing managers of team customers.

Rules:

  • Cannot add a member with the owner role (there must be exactly one owner)
  • If a member with this email already exists, the existing member is returned

Request Body

Content Types: application/json

customer_portal_members_list_members(opts \\ [])

@spec customer_portal_members_list_members(opts :: keyword()) ::
  {:ok, Polarex.ListResourceCustomerPortalMember.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Members

List all members of the customer's team.

Only available to owners and billing managers of team customers.

Options

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

customer_portal_members_remove_member(id, opts \\ [])

@spec customer_portal_members_remove_member(id :: String.t(), opts :: keyword()) ::
  :ok | {:error, Polarex.HTTPValidationError.t()}

Remove Member

Remove a member from the team.

Only available to owners and billing managers of team customers.

Rules:

  • Cannot remove yourself
  • Cannot remove the only owner

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

@spec customer_portal_members_update_member(
  id :: String.t(),
  body :: Polarex.CustomerPortalMemberUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerPortalMember.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Update Member

Update a member's role.

Only available to owners and billing managers of team customers.

Rules:

  • Cannot modify your own role (to prevent self-demotion)
  • Customer must have exactly one owner at all times

Request Body

Content Types: application/json

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

Confirm Retry Payment

Confirm a retry payment using a Stripe confirmation token.

Request Body

Content Types: application/json

customer_portal_orders_generate_invoice(id, opts \\ [])

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

Generate Order Invoice

Trigger generation of an order's invoice.

customer_portal_orders_get(id, opts \\ [])

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

Get Order

Get an order by ID for the authenticated customer.

customer_portal_orders_get_payment_status(id, opts \\ [])

@spec customer_portal_orders_get_payment_status(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerOrderPaymentStatus.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Order Payment Status

Get the current payment status for an order.

customer_portal_orders_invoice(id, opts \\ [])

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

Get Order Invoice

Get an order's invoice data.

customer_portal_orders_list(opts \\ [])

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

List Orders

List orders of the authenticated customer.

Options

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

@spec customer_portal_orders_receipt(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerOrderReceipt.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Order Receipt

Get a presigned URL to download an order's receipt PDF.

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

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

Update Order

Update an order for the authenticated customer.

Request Body

Content Types: application/json

customer_portal_organizations_get(slug, opts \\ [])

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

Get Organization

Get a customer portal's organization by slug.

customer_portal_seats_assign_seat(body, opts \\ [])

@spec customer_portal_seats_assign_seat(
  body :: Polarex.SeatAssign.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerSeat.t()} | {:error, Polarex.HTTPValidationError.t()}

Assign Seat

Request Body

Content Types: application/json

customer_portal_seats_list_claimed_subscriptions(opts \\ [])

@spec customer_portal_seats_list_claimed_subscriptions(opts :: keyword()) ::
  {:ok, Polarex.ListResourceCustomerSubscription.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Claimed Subscriptions

List all subscriptions where the authenticated customer has claimed a seat.

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_seats_list_seats(opts \\ [])

@spec customer_portal_seats_list_seats(opts :: keyword()) ::
  {:ok, Polarex.SeatsList.t()} | {:error, Polarex.HTTPValidationError.t()}

List Seats

Scopes: customer_portal:read customer_portal:write

Options

  • subscription_id: Subscription ID
  • order_id: Order ID

customer_portal_seats_resend_invitation(seat_id, opts \\ [])

@spec customer_portal_seats_resend_invitation(
  seat_id :: String.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerSeat.t()} | {:error, Polarex.HTTPValidationError.t()}

Resend Invitation

customer_portal_seats_revoke_seat(seat_id, opts \\ [])

@spec customer_portal_seats_revoke_seat(seat_id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerSeat.t()} | {:error, Polarex.HTTPValidationError.t()}

Revoke Seat

customer_portal_subscriptions_cancel(id, opts \\ [])

@spec customer_portal_subscriptions_cancel(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerSubscription.t()}
  | {:error,
     Polarex.AlreadyCanceledSubscription.t()
     | Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()}

Cancel Subscription

Cancel a subscription of the authenticated customer.

customer_portal_subscriptions_get(id, opts \\ [])

@spec customer_portal_subscriptions_get(id :: String.t(), opts :: 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(opts :: 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

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

Request Body

Content Types: application/json

customer_portal_wallets_get(id, opts \\ [])

@spec customer_portal_wallets_get(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerWallet.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Wallet

Get a wallet by ID for the authenticated customer.

customer_portal_wallets_list(opts \\ [])

@spec customer_portal_wallets_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceCustomerWallet.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Wallets

List wallets of the authenticated customer.

Options

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

@spec customer_seats_assign_seat(body :: Polarex.SeatAssign.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerSeat.t()} | {:error, Polarex.HTTPValidationError.t()}

Assign Seat

Scopes: customer_seats:write

Request Body

Content Types: application/json

customer_seats_claim_seat(body, opts \\ [])

@spec customer_seats_claim_seat(body :: Polarex.SeatClaim.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerSeatClaimResponse.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Claim Seat

Request Body

Content Types: application/json

customer_seats_get_claim_info(invitation_token, opts \\ [])

@spec customer_seats_get_claim_info(invitation_token :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.SeatClaimInfo.t()} | {:error, Polarex.HTTPValidationError.t()}

Get Claim Info

customer_seats_list_seats(opts \\ [])

@spec customer_seats_list_seats(opts :: keyword()) ::
  {:ok, Polarex.SeatsList.t()} | {:error, Polarex.HTTPValidationError.t()}

List Seats

Scopes: customer_seats:write

Options

  • subscription_id
  • order_id

customer_seats_resend_invitation(seat_id, opts \\ [])

@spec customer_seats_resend_invitation(seat_id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerSeat.t()} | {:error, Polarex.HTTPValidationError.t()}

Resend Invitation

Scopes: customer_seats:write

customer_seats_revoke_seat(seat_id, opts \\ [])

@spec customer_seats_revoke_seat(seat_id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerSeat.t()} | {:error, Polarex.HTTPValidationError.t()}

Revoke Seat

Scopes: customer_seats:write

customer_sessions_create(body, opts \\ [])

Create Customer Session

Create a customer session.

For organizations with member_model_enabled, this will automatically create a member session for the owner member of the customer.

Scopes: customer_sessions:write

Request Body

Content Types: application/json

customers_create(body, opts \\ [])

Create Customer

Create a customer.

Scopes: customers:write

Request Body

Content Types: application/json

customers_delete(id, opts \\ [])

@spec customers_delete(id :: String.t(), opts :: 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.

Set anonymize=true to also anonymize PII for GDPR compliance.

Scopes: customers:write

Options

  • anonymize: If true, also anonymize the customer's personal data for GDPR compliance. This replaces email with a hashed version, hashes name and billing name (name preserved for businesses with tax_id), clears billing address, and removes OAuth account data.

customers_delete_external(external_id, opts \\ [])

@spec customers_delete_external(external_id :: String.t(), opts :: 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.

Set anonymize=true to also anonymize PII for GDPR compliance.

Scopes: customers:write

Options

  • anonymize: If true, also anonymize the customer's personal data for GDPR compliance.

customers_export(opts \\ [])

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

Export Customers

Export customers as a CSV file.

Scopes: customers:read customers:write

Options

  • organization_id: Filter by organization ID.

customers_get(id, opts \\ [])

@spec customers_get(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerIndividual.t() | Polarex.CustomerTeam.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(external_id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerIndividual.t() | Polarex.CustomerTeam.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(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerStateIndividual.t() | Polarex.CustomerStateTeam.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(external_id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerStateIndividual.t() | Polarex.CustomerStateTeam.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(opts :: 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, email, or external 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.

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

@spec customers_update(
  id :: String.t(),
  body :: Polarex.CustomerUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerIndividual.t() | Polarex.CustomerTeam.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Customer

Update a customer.

Scopes: customers:write

Request Body

Content Types: application/json

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

@spec customers_update_external(
  external_id :: String.t(),
  body :: Polarex.CustomerUpdateExternalID.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerIndividual.t() | Polarex.CustomerTeam.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Customer by External ID

Update a customer by external ID.

Scopes: customers:write

Request Body

Content Types: application/json

discounts_create(body, opts \\ [])

Create Discount

Create a discount.

Scopes: discounts:write

Request Body

Content Types: application/json

discounts_delete(id, opts \\ [])

@spec discounts_delete(id :: String.t(), opts :: 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(opts :: 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

Request Body

Content Types: application/json

disputes_get(id, opts \\ [])

@spec disputes_get(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.Dispute.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Dispute

Get a dispute by ID.

Scopes: disputes:read

disputes_list(opts \\ [])

@spec disputes_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceDispute.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Disputes

List disputes.

Scopes: disputes:read

Options

  • organization_id: Filter by organization ID.
  • order_id: Filter by order ID.
  • status: Filter by dispute status.
  • 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.

event_types_list(opts \\ [])

@spec event_types_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceEventTypeWithStats.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Event Types

List event types with aggregated statistics.

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.
  • query: Query to filter event types by name or label.
  • root_events: When true, only return event types with root events (parent_id IS NULL).
  • parent_id: Filter by specific parent event ID.
  • source: Filter by event source (system or user).
  • 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.

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

@spec event_types_update(
  id :: String.t(),
  body :: Polarex.EventTypeUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.EventType.t()} | {:error, Polarex.HTTPValidationError.t()}

Update Event Type

Update an event type's label.

Scopes: events:write

Request Body

Content Types: application/json

events_get(id, opts \\ [])

@spec events_get(id :: String.t(), opts :: 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(body :: Polarex.EventsIngest.t(), opts :: keyword()) ::
  {:ok, Polarex.EventsIngestResponse.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Ingest Events

Ingest batch of events.

Scopes: events:write

Request Body

Content Types: application/json

events_list(opts \\ [])

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.
  • query: Query to filter events.
  • parent_id: When combined with depth, use this event as the anchor instead of root events.
  • depth: Fetch descendants up to this depth. When set: 0=root events only, 1=roots+children, etc. Max 5. When not set, returns all events.
  • 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(opts :: 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

Request Body

Content Types: application/json

files_delete(id, opts \\ [])

@spec files_delete(id :: String.t(), opts :: 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(opts :: 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

Request Body

Content Types: application/json

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

Complete File Upload

Complete a file upload.

Scopes: files:write

Request Body

Content Types: application/json

license_keys_activate(body, opts \\ [])

Activate License Key

Activate a license key instance.

Scopes: license_keys:write

Request Body

Content Types: application/json

license_keys_deactivate(body, opts \\ [])

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

Deactivate License Key

Deactivate a license key instance.

Scopes: license_keys:write

Request Body

Content Types: application/json

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 \\ [])

@spec license_keys_get_activation(
  id :: String.t(),
  activation_id :: String.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.LicenseKeyActivationRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()
     | Polarex.Unauthorized.t()}

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.
  • status: Filter by license key status.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

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

@spec license_keys_update(
  id :: String.t(),
  body :: Polarex.LicenseKeyUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.LicenseKeyRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()
     | Polarex.Unauthorized.t()}

Update License Key

Update a license key.

Scopes: license_keys:write

Request Body

Content Types: application/json

license_keys_validate(body, opts \\ [])

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

Validate License Key

Validate a license key.

Scopes: license_keys:write

Request Body

Content Types: application/json

members_create_member(body, opts \\ [])

@spec members_create_member(body :: Polarex.MemberCreate.t(), opts :: keyword()) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Create Member

Create a new member for a customer.

Only B2B customers with the member management feature enabled can add members. The authenticated user or organization must have access to the customer's organization.

Scopes: members:write

Request Body

Content Types: application/json

members_delete_member(id, opts \\ [])

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

Delete Member

Delete a member.

The authenticated user or organization must have access to the member's organization.

Scopes: members:write

members_delete_member_by_external_id(external_id, opts \\ [])

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

Delete Member by External ID

Delete a member by external ID. One of customer_id or external_customer_id must be specified.

Scopes: members:write

Options

  • customer_id: The customer ID.
  • external_customer_id: The customer external ID.

members_get_member(id, opts \\ [])

@spec members_get_member(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Member

Get a member by ID.

The authenticated user or organization must have access to the member's organization.

Scopes: members:read members:write

members_get_member_by_external_id(external_id, opts \\ [])

@spec members_get_member_by_external_id(external_id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Member by External ID

Get a member by external ID. One of customer_id or external_customer_id must be specified.

Scopes: members:read members:write

Options

  • customer_id: The customer ID.
  • external_customer_id: The customer external ID.

members_list_members(opts \\ [])

@spec members_list_members(opts :: keyword()) ::
  {:ok, Polarex.ListResourceMember.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Members

List members with optional customer ID filter.

Scopes: members:read members:write

Options

  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by customer external ID.
  • role: Filter by member role.
  • 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.

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

@spec members_update_member(
  id :: String.t(),
  body :: Polarex.MemberUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Member

Update a member.

Only name and role can be updated. The authenticated user or organization must have access to the member's organization.

Scopes: members:write

Request Body

Content Types: application/json

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

@spec members_update_member_by_external_id(
  external_id :: String.t(),
  body :: Polarex.MemberUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Member by External ID

Update a member by external ID. One of customer_id or external_customer_id must be specified.

Scopes: members:write

Options

  • customer_id: The customer ID.
  • external_customer_id: The customer external ID.

Request Body

Content Types: application/json

meters_create(body, opts \\ [])

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

Create Meter

Create a meter.

Scopes: meters:write

Request Body

Content Types: application/json

meters_get(id, opts \\ [])

@spec meters_get(id :: String.t(), opts :: 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(opts :: 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.
  • is_archived: Filter on archived meters.
  • 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(id :: String.t(), opts :: 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.
  • timezone: Timezone to use for the timestamps. Default is UTC.
  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by external customer ID.
  • customer_aggregation_function: If set, will first compute the quantities per customer before aggregating them using the given function. If not set, the quantities will be aggregated across all events.
  • metadata: Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.

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

@spec meters_update(
  id :: String.t(),
  body :: Polarex.MeterUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Meter.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Meter

Update a meter.

Scopes: meters:write

Request Body

Content Types: application/json

metrics_create_dashboard(body, opts \\ [])

@spec metrics_create_dashboard(
  body :: Polarex.MetricDashboardCreate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.MetricDashboardSchema.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Create Metric Dashboard

Create a user-defined metric dashboard.

Scopes: metrics:write

Request Body

Content Types: application/json

metrics_delete_dashboard(id, opts \\ [])

@spec metrics_delete_dashboard(id :: String.t(), opts :: keyword()) ::
  :ok | {:error, Polarex.HTTPValidationError.t()}

Delete Metric Dashboard

Delete a user-defined metric dashboard.

Scopes: metrics:write

metrics_export(opts \\ [])

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

Export Metrics

Export metrics as a CSV file.

Scopes: metrics:read

Options

  • start_date: Start date.
  • end_date: End date.
  • timezone: Timezone to use for the timestamps. Default is UTC.
  • 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: List of metric slugs to include in the export. If not provided, all metrics are exported.

metrics_get(opts \\ [])

@spec metrics_get(opts :: 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.
  • timezone: Timezone to use for the timestamps. Default is UTC.
  • 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: List of metric slugs to focus on. When provided, only the queries needed for these metrics will be executed, improving performance. If not provided, all metrics are returned.

metrics_get_dashboard(id, opts \\ [])

@spec metrics_get_dashboard(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.MetricDashboardSchema.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Get Metric Dashboard

Get a user-defined metric dashboard by ID.

Scopes: metrics:read

metrics_limits(opts \\ [])

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

Get Metrics Limits

Get the interval limits for the metrics endpoint.

Scopes: metrics:read

metrics_list_dashboards(opts \\ [])

@spec metrics_list_dashboards(opts :: keyword()) ::
  {:ok, [Polarex.MetricDashboardSchema.t()]}
  | {:error, Polarex.HTTPValidationError.t()}

List Metric Dashboards

List user-defined metric dashboards.

Scopes: metrics:read

Options

  • organization_id: Filter by organization ID.

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

@spec metrics_update_dashboard(
  id :: String.t(),
  body :: Polarex.MetricDashboardUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.MetricDashboardSchema.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Update Metric Dashboard

Update a user-defined metric dashboard.

Scopes: metrics:write

Request Body

Content Types: application/json

oauth2_authorize(opts \\ [])

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

Authorize

oauth2_clients_oauth2_create_client(body, opts \\ [])

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

Create Client

Create an OAuth2 client.

Request Body

Content Types: application/json

oauth2_clients_oauth2_delete_client(client_id, opts \\ [])

@spec oauth2_clients_oauth2_delete_client(client_id :: String.t(), opts :: 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(client_id :: String.t(), opts :: 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(
  client_id :: String.t(),
  body :: Polarex.OAuth2ClientConfigurationUpdate.t(),
  opts :: keyword()
) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}

Update Client

Update an OAuth2 client.

Request Body

Content Types: application/json

oauth2_introspect_token(body, opts \\ [])

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

Introspect Token

Get information about an access token.

Request Body

Content Types: application/x-www-form-urlencoded

oauth2_request_token(body, opts \\ [])

@spec oauth2_request_token(
  body ::
    Polarex.AuthorizationCodeTokenRequest.t()
    | Polarex.RefreshTokenRequest.t()
    | Polarex.WebTokenRequest.t(),
  opts :: keyword()
) :: {:ok, Polarex.TokenResponse.t()} | :error

Request Token

Request an access token using a valid grant.

Request Body

Content Types: application/x-www-form-urlencoded

oauth2_revoke_token(body, opts \\ [])

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

Revoke Token

Revoke an access token or a refresh token.

Request Body

Content Types: application/x-www-form-urlencoded

oauth2_userinfo(opts \\ [])

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

Get User Info

Get information about the authenticated user.

orders_export(opts \\ [])

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

Export Orders

Export orders as a CSV file.

Scopes: orders:read

Options

  • organization_id: Filter by organization ID.
  • product_id: Filter by product ID.

orders_generate_invoice(id, opts \\ [])

@spec orders_generate_invoice(id :: String.t(), opts :: keyword()) ::
  {:ok, map()}
  | {:error,
     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(id :: String.t(), opts :: 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(id :: String.t(), opts :: 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(opts :: 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.
  • external_customer_id: Filter by customer external ID.
  • checkout_id: Filter by checkout 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.
  • metadata: Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.

orders_receipt(id, opts \\ [])

@spec orders_receipt(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.OrderReceipt.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Order Receipt

Get a presigned URL to download an order's receipt PDF.

Scopes: orders:read

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

@spec orders_update(
  id :: String.t(),
  body :: Polarex.OrderUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Order.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Order

Update an order.

Scopes: orders:write

Request Body

Content Types: application/json

organization_access_tokens_create(body, opts \\ [])

@spec organization_access_tokens_create(
  body :: Polarex.OrganizationAccessTokenCreate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.OrganizationAccessTokenCreateResponse.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Create

Scopes: organization_access_tokens:write

Request Body

Content Types: application/json

organization_access_tokens_delete(id, opts \\ [])

@spec organization_access_tokens_delete(id :: String.t(), opts :: keyword()) ::
  :ok | {:error, Polarex.HTTPValidationError.t()}

Delete

Scopes: organization_access_tokens:write

organization_access_tokens_list(opts \\ [])

@spec organization_access_tokens_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceOrganizationAccessToken.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List

List organization access tokens.

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

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

@spec organization_access_tokens_update(
  id :: String.t(),
  body :: Polarex.OrganizationAccessTokenUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.OrganizationAccessToken.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Update

Scopes: organization_access_tokens:write

Request Body

Content Types: application/json

organizations_create(body, opts \\ [])

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

Create Organization

Create an organization.

Scopes: organizations:write

Request Body

Content Types: application/json

organizations_get(id, opts \\ [])

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

Get Organization

Get an organization by ID.

organizations_list(opts \\ [])

@spec organizations_list(opts :: 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 \\ [])

@spec organizations_update(
  id :: String.t(),
  body :: Polarex.OrganizationUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Organization.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}

Update Organization

Update an organization.

Request Body

Content Types: application/json

payments_get(id, opts \\ [])

@spec payments_get(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CardPayment.t() | Polarex.GenericPayment.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Payment

Get a payment by ID.

Scopes: payments:read

payments_list(opts \\ [])

@spec payments_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourcePayment.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(
  body :: Polarex.ProductCreateOneTime.t() | Polarex.ProductCreateRecurring.t(),
  opts :: keyword()
) :: {:ok, Polarex.Product.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Product

Create a product.

Scopes: products:write

Request Body

Content Types: application/json

products_get(id, opts \\ [])

@spec products_get(id :: String.t(), opts :: 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(opts :: 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.
  • visibility: Filter by visibility.
  • 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.

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

@spec products_update(
  id :: String.t(),
  body :: Polarex.ProductUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Product.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}

Update Product

Update a product.

Scopes: products:write

Request Body

Content Types: application/json

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

@spec products_update_benefits(
  id :: String.t(),
  body :: Polarex.ProductBenefitsUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Product.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}

Update Product Benefits

Update benefits granted by a product.

Scopes: products:write

Request Body

Content Types: application/json

refunds_create(body, opts \\ [])

@spec refunds_create(body :: Polarex.RefundCreate.t(), opts :: keyword()) ::
  {:ok, Polarex.Refund.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.RefundedAlready.t()}

Create Refund

Create a refund.

Scopes: refunds:write

Request Body

Content Types: application/json

refunds_list(opts \\ [])

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

List Refunds

List refunds.

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.
  • external_customer_id: Filter by customer external 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_create(body, opts \\ [])

Create Subscription

Create a subscription programmatically.

This endpoint only allows to create subscription on free products. For paid products, use the checkout flow.

No initial order will be created and no confirmation email will be sent.

Scopes: subscriptions:write

Request Body

Content Types: application/json

subscriptions_export(opts \\ [])

@spec subscriptions_export(opts :: keyword()) ::
  {:ok, map() | String.t()} | {: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(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.Subscription.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Subscription

Get a subscription by ID.

Scopes: subscriptions:read subscriptions:write

subscriptions_list(opts \\ [])

@spec subscriptions_list(opts :: 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.
  • external_customer_id: Filter by customer external ID.
  • discount_id: Filter by discount ID.
  • active: Filter by active or inactive subscription.
  • cancel_at_period_end: Filter by subscriptions that are set to cancel at period end.
  • customer_cancellation_reason: Filter by customer cancellation reason.
  • canceled_at_after: Filter by cancellation date (after or equal to).
  • canceled_at_before: Filter by cancellation date (before or equal to).
  • 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

Request Body

Content Types: application/json

webhooks_create_webhook_endpoint(body, opts \\ [])

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

Create Webhook Endpoint

Create a webhook endpoint.

Scopes: webhooks:write

Request Body

Content Types: application/json

webhooks_delete_webhook_endpoint(id, opts \\ [])

@spec webhooks_delete_webhook_endpoint(id :: String.t(), opts :: 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(id :: String.t(), opts :: 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(opts :: 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.
  • start_timestamp: Filter deliveries after this timestamp.
  • end_timestamp: Filter deliveries before this timestamp.
  • succeeded: Filter by delivery success status.
  • query: Query to filter webhook deliveries.
  • http_code_class: Filter by HTTP response code class (2xx, 3xx, 4xx, 5xx).
  • event_type: Filter by webhook event type.
  • 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(opts :: 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(id :: String.t(), opts :: 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_reset_webhook_endpoint_secret(id, opts \\ [])

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

Reset Webhook Endpoint Secret

Regenerate a webhook endpoint secret.

Scopes: webhooks:write

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

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

Update Webhook Endpoint

Update a webhook endpoint.

Scopes: webhooks:write

Request Body

Content Types: application/json