Setup

To use the Discount API, install the @wix/restaurants package using npm or Yarn:

Copy
1
npm install @wix/restaurants

or

Copy
1
yarn add @wix/restaurants

Then import { discount } from @wix/restaurants:

Copy
1
import { discount } from '@wix/restaurants'
Was this helpful?
Yes
No

createDiscount( )

Developer Preview

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:
Manage Restaurant Catalogs
Manage Restaurants - all permissions
Learn more about permission scopes.
Copy
function createDiscount(catalogId: string, options: CreateDiscountOptions): Promise<Discount>
Method Parameters
catalogIdstringRequired

ID of the catalog the discount belongs to.


optionsCreateDiscountOptionsRequired
Returns
Return Type:Promise<Discount>
Was this helpful?
Yes
No

getDiscount( )

Developer Preview

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:
Manage Bookings Services and Settings
Manage Restaurant Catalogs
Manage Restaurants - all permissions
Read Restaurant Catalogs
Learn more about permission scopes.
Copy
function getDiscount(identifiers: GetDiscountIdentifiers): Promise<Discount>
Method Parameters
identifiersGetDiscountIdentifiersRequired
Returns
Return Type:Promise<Discount>
Was this helpful?
Yes
No

listDiscounts( )

Developer Preview

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:
Manage Bookings Services and Settings
Manage Restaurant Catalogs
Manage Restaurants - all permissions
Read Restaurant Catalogs
Learn more about permission scopes.
Copy
function listDiscounts(catalogId: string, options: ListDiscountsOptions): Promise<ListDiscountsResponse>
Method Parameters
catalogIdstringRequired

ID of the catalog the discounts belong to.


optionsListDiscountsOptions
Returns
Return Type:Promise<ListDiscountsResponse>
Was this helpful?
Yes
No

updateDiscount( )

Developer Preview

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:
Manage Restaurant Catalogs
Manage Restaurants - all permissions
Learn more about permission scopes.
Copy
function updateDiscount(identifiers: UpdateDiscountIdentifiers, options: UpdateDiscountOptions): Promise<Discount>
Method Parameters
identifiersUpdateDiscountIdentifiersRequired

optionsUpdateDiscountOptions
Returns
Return Type:Promise<Discount>
Was this helpful?
Yes
No