Setup
To use the Discount API, install the @wix/restaurants
package using npm or Yarn:
1npm install @wix/restaurants
or
1yarn add @wix/restaurants
Then import { discount }
from @wix/restaurants
:
1import { discount } from '@wix/restaurants'
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a discount. You can create discounts for catalogs, sections, or dishes. You can't create a discount that applies to a menu.
Permission Scopes
For app development, you must have one of the following permission scopes:function createDiscount(catalogId: string, options: CreateDiscountOptions): Promise<Discount>
ID of the catalog the discount belongs to.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a discount.
Permission Scopes
For app development, you must have one of the following permission scopes:function getDiscount(identifiers: GetDiscountIdentifiers): Promise<Discount>
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves up to 1000 discounts.
Permission Scopes
For app development, you must have one of the following permission scopes:function listDiscounts(catalogId: string, options: ListDiscountsOptions): Promise<ListDiscountsResponse>
ID of the catalog the discounts belong to.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates a discount. A discount can belong to a catalog, section, or dish. You can't create a discount that applies to a menu.
Permission Scopes
For app development, you must have one of the following permission scopes:function updateDiscount(identifiers: UpdateDiscountIdentifiers, options: UpdateDiscountOptions): Promise<Discount>