Polarex.Discounts (Polarex v0.1.0)

View Source

Provides API endpoints related to discounts

Summary

Functions

discounts_create(body, opts \\ [])

Create Discount

Create a discount.

Scopes: discounts:write

discounts_delete(id, opts \\ [])

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

Delete Discount

Delete a discount.

Scopes: discounts:write

discounts_get(id, opts \\ [])

Get Discount

Get a discount by ID.

Scopes: discounts:read discounts:write

discounts_list(opts \\ [])

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

List Discounts

List discounts.

Scopes: discounts:read discounts:write

Options

  • organization_id: Filter by organization ID.
  • query: Filter by name.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.
  • sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.

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

Update Discount

Update a discount.

Scopes: discounts:write