Search documentation of polar_express

# PolarExpress.Services.DiscountsService (polar_express v0.1.5)

Copy Markdown View Source

Discounts

Discounts API operations.

## Summary

### Functions

create_discount(client, params \\ %{}, opts \\ [])

Create Discount

delete_discount(client, id, params \\ %{}, opts \\ [])

Delete Discount

get_discount(client, id, params \\ %{}, opts \\ [])

Get Discount

list_discounts(client, params \\ %{}, opts \\ [])

List Discounts

update_discount(client, id, params \\ %{}, opts \\ [])

Update Discount

## Functions

# create_discount(client, params \\ %{}, opts \\ [])

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

# delete_discount(client, id, params \\ %{}, opts \\ [])

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

# get_discount(client, id, params \\ %{}, opts \\ [])

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

# list_discounts(client, params \\ %{}, opts \\ [])

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

# update_discount(client, id, params \\ %{}, opts \\ [])

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