Discounts
Discounts API operations.
Summary
Functions
@spec create_discount(PolarExpress.Client.t(), map(), keyword()) :: {:ok, PolarExpress.Schemas.Discount.t()} | {:error, PolarExpress.Error.t()}
Create Discount
Create a discount.
Scopes: discounts:write
See PolarExpress.Params.DiscountsCreateDiscountParams for parameter details.
@spec delete_discount(PolarExpress.Client.t(), String.t(), map(), keyword()) :: {:ok, term()} | {:error, PolarExpress.Error.t()}
Delete Discount
Delete a discount.
Scopes: discounts:write
See PolarExpress.Params.DiscountsDeleteDiscountParams for parameter details.
@spec get_discount(PolarExpress.Client.t(), String.t(), map(), keyword()) :: {:ok, PolarExpress.Schemas.Discount.t()} | {:error, PolarExpress.Error.t()}
Get Discount
Get a discount by ID.
Scopes: discounts:read discounts:write
See PolarExpress.Params.DiscountsGetDiscountParams for parameter details.
@spec list_discounts(PolarExpress.Client.t(), map(), keyword()) :: {:ok, PolarExpress.ListObject.t()} | {:error, PolarExpress.Error.t()}
List Discounts
List discounts.
Scopes: discounts:read discounts:write
See PolarExpress.Params.DiscountsListDiscountsParams for parameter details.
@spec update_discount(PolarExpress.Client.t(), String.t(), map(), keyword()) :: {:ok, PolarExpress.Schemas.Discount.t()} | {:error, PolarExpress.Error.t()}
Update Discount
Update a discount.
Scopes: discounts:write
See PolarExpress.Params.DiscountsUpdateDiscountParams for parameter details.