> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryDiscountRules

# Package: discounts

# Namespace: DiscountRuleService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/discounts/discount-rules/query-discount-rules?apiView=SDK.md

## Permission Scopes:
Read eCommerce - all read permissions: SCOPE.DC-ECOM-MEGA.READ-ECOM

## Introduction

Query discount rules using [WQL (Wix Query Language)](https://dev.wix.com/api/rest/getting-started/api-query-language).
Total entries (`pagingMetadata.total`) will be returned only for the first page.

> **Note:** `discountRule.status` can't be used for querying.

---

## REST API

### Schema

```
 Method: queryDiscountRules
 Description: Query discount rules using [WQL (Wix Query Language)](https://dev.wix.com/api/rest/getting-started/api-query-language). Total entries (`pagingMetadata.total`) will be returned only for the first page.  > **Note:** `discountRule.status` can't be used for querying.
 URL: https://www.wixapis.com/ecom/v1/discount-rules/query
 Method: POST
 Method parameters:
   param name: query | type: PlatformQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  
        - name: sort | type: array<Sorting> | description: Sorting options. For example, `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`.  
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  | validation: format double
              - name: longitude | type: number | description: Address longitude.  | validation: format double
 Query fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: active | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: revision | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: activeTimeInfo.start | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: activeTimeInfo.end | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: tags.privateTags.tagIds | operators: $hasSome, $hasAll, $exists, $isEmpty | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryDiscountRulesResponse
  - name: discountRules | type: array<DiscountRule> | description: List of discount rules.  
     - name: id | type: string | description: Discount rule GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the discount rule is updated. To prevent conflicting changes, the current `revision` must be passed when updating the discount rule.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the discount rule was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the discount rule was last updated.  | read-only: true | validation: format date-time
     - name: active | type: boolean | description: Whether the discount rule is active.  Default: `true`  
     - name: name | type: string | description: Discount rule name.  | validation: minLength 1, maxLength 50
     - name: trigger | type: DiscountTrigger | description: Discount rule trigger. A set of conditions that must be met for the `discounts` to be applied. Not passing a trigger will cause the discount to always apply.  
        - ONE-OF: 
           - name: and | type: And | description: Chain multiple triggers with the `and` operator.  
              - name: triggers | type: array<DiscountTrigger> | description: List of triggers to have an "AND" operator between their results.  | validation: minItems 2, maxItems 5
           - name: or | type: Or | description: Chain multiple triggers with the `or` operator.  
              - name: triggers | type: array<DiscountTrigger> | description: List of triggers to have an "OR" operator between their results.  | validation: minItems 2, maxItems 5
           - name: customTrigger | type: Custom | description: Custom trigger.  
              - name: id | type: string | description: Trigger GUID.  | validation: minLength 1, maxLength 100
              - name: appId | type: string | description: GUID of the app that created the trigger.  | validation: format GUID
           - name: subtotalRange | type: SubtotalRange | description: Subtotal trigger range.  
              - name: scopes | type: array<Scope> | description: Relevant scopes for `SPECIFIC_ITEMS` target type.  | validation: maxItems 50
                 - ONE-OF: 
                    - name: catalogItemFilter | type: CatalogItemFilter | description: Catalog item filter. Must be passed with `type."CATALOG_ITEM"`.  
                       - name: catalogAppId | type: string | description: Catalog App GUID. For example, the Wix Stores, Wix Bookings, or 3rd-party [`appId`](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md).  | validation: format GUID
                       - name: catalogItemIds | type: array<string> | description: GUID of the item within its Wix or 3rd-party catalog. For example, `productId` for Wix Stores.  | validation: minItems 0, maxItems 50, minLength 1, maxLength 36
                    - name: customFilter | type: CustomFilter | description: Custom filter. Must be passed with `type."CATALOG_ITEM"`.  
                       - name: appId | type: string | description: Custom filter app GUID, when relevant.  | validation: format GUID
                       - name: params | type: object | description: Custom filter in `{ "key": "value" }` form. For example, an array of `collectionIDs`: `{ ["collectionId": "12345"], ["collectionId": "67890"] }`.  
                 - name: id | type: string | description: Scope GUID.  | validation: minLength 1, maxLength 100
                 - name: type | type: ScopeType | description: Scope type.  
                         - enum:
                         -     CATALOG_ITEM: Specific catalog items
                         -     CUSTOM_FILTER: Specific items by custom filters
              - name: from | type: string | description: Minimum subtotal price (inclusive).  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
              - name: to | type: string | description: Maximum subtotal price (inclusive).  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
           - name: itemQuantityRange | type: ItemQuantityRange | description: Item quantity trigger range.  
              - name: scopes | type: array<Scope> | description: Relevant scopes for `SPECIFIC_ITEMS` target type.  | validation: maxItems 50
              - name: from | type: integer | description: Minimum item quantity (inclusive).  | validation: minimum 1, format int32
              - name: to | type: integer | description: Maximum item quantity (inclusive).  | validation: minimum 1, format int32
           - name: customerEligibility | type: CustomerEligibility | description: Customer Eligibility info  
              - ONE-OF: 
                 - name: individualMembersInfo | type: IndividualMembers | description: Information about specific members.  
                    - name: memberIds | type: array<string> | description: Eligible member ids.  | validation: minItems 1, maxItems 100, format GUID
              - name: eligibilityType | type: EligibilityType | description: Customer eligibility type.  
                     - enum:
                     -     INDIVIDUAL_MEMBERS: Only specific customers based on member id.
        - name: triggerType | type: TriggerType | description: Trigger type.  
             - enum:
             -     AND: Operator used for chaining multiple triggers. Currently 1 `AND` chain operator is supported.
             -     SUBTOTAL_RANGE: Subtotal must be within the specified `subtotalRange` values.
             -     ITEM_QUANTITY_RANGE: Quantity of items in scope must be within specified `itemQuantityRange` values.
             -     CUSTOM: Custom trigger type defined in `customTrigger` object.
             -     OR: Chain multiple triggers with OR operator
             -     CUSTOMER_ELIGIBILITY: Customer eligibility type must be within specified `customerEligibility` values.
     - name: activeTimeInfo | type: ActiveTimeInfo | description: Time frame in which the discount rule is active.  
        - name: start | type: string | description: Date and time the discount rule is active **from**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.  | validation: format date-time
        - name: end | type: string | description: Date and time the discount rule is active **till**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.  | validation: format date-time
     - name: discounts | type: Discounts | description: List of discounts that are applied when one or more triggers are met.  > **Notes:** > > + Currently, only 1 discount can be defined per discount rule. > + A discount rule can be applied on multiple items per cart. > + A discount rule can only be applied once per item.  
        - name: values | type: array<Discount> | description: Discounts.  | validation: minItems 1, maxItems 1
           - ONE-OF: 
              - name: percentage | type: number | description: Percentage to discount from original price.  | validation: minimum 0.1, maximum 100
              - name: fixedAmount | type: string | description: Amount to discount from original price.  | validation: decimalValue {"gt":"0","lte":"1000000000000000","maxScale":4}
              - name: fixedPrice | type: string | description: Fixed price. Line item will be fixed to this price.  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
              - name: quantityBased | type: QuantityBased | description: A special price is applied for a specific quantity of items. For example, 3 for $10.  
                 - name: configurations | type: array<DiscountConfig> | description: list of discountConfig options.  | validation: minItems 1, maxItems 1
                    - name: id | type: string | description: DiscountConfig GUID.  | read-only: true | validation: format GUID
                    - name: quantity | type: integer | description: The number of items that must be added to the cart to be eligible for the discount (Represents X).  | validation: minimum 2
                    - name: price | type: string | description: The DiscountConfig price (Represents Amount).  | validation: decimalValue {"gte":"0","lte":"1000000","maxScale":4}
           - name: targetType | type: Type | description: Discount target.  + `SPECIFIC_ITEMS`: Discount applies to a specific set of items.  
                 - enum:
                 -     SPECIFIC_ITEMS: Target type is a set of specific items
           - name: specificItemsInfo | type: SpecificItemsInfo | description: Data related to `SPECIFIC_ITEMS` target type.  
              - name: scopes | type: array<Scope> | description: All associated scopes for `SPECIFIC_ITEMS` target type.  | validation: minItems 1, maxItems 50
           - name: discountType | type: DiscountType | description: Discount type.  
                 - enum:
                 -     PERCENTAGE: Price is reduced by percentage value.
                 -     FIXED_AMOUNT: Price is reduced by fixed amount.
                 -     FIXED_PRICE: Price will be set to fixed amount.
                 -     QUANTITY_BASED: Quantity based options for Buy X For Amount.
     - name: status | type: Status | description: Discount rule status. Default: `UNDEFINED`  | read-only: true 
         - enum:
         -     LIVE: Rule status is live.
         -     EXPIRED: Rule status is expired, it might have been live in the past.
         -     PENDING: Rule status is pending, it might be live in the future.
     - name: usageCount | type: integer | description: Number of times the discount rule was used.  | read-only: true 
     - name: tags | type: Tags | description: Tags for this discount rule.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
  - name: pagingMetadata | type: PlatformPagingMetadata | description: Details on the paged set of results returned.  
     - name: count | type: integer | description: The number of items returned in this response.  | validation: format int32
     - name: offset | type: integer | description: The offset which was requested. Returned if offset paging was used.  | validation: format int32
     - name: total | type: integer | description: The total number of items that match the query. Returned if offset paging was used.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursors to navigate through result pages. Returned if cursor paging was used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### Query Discount Rules
Query Discount rules by active and start date fields, sorted by name

```curl
curl -X POST \
  'https://www.wixapis.com/ecom/v1/discount-rules/query' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>' \
  --data-binary '{
    "query": {
      "sort": [
        {
          "fieldName": "name",
          "order": "ASC"
        }
      ],
      "filter": {
        "active": true,
        "activeTimeInfo.start": {
          "$gt": "2021-08-01T00:00:00Z"
        }
      },
      "cursorPaging": {
        "limit": 2
      }
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.discountRules.queryDiscountRules(query)
 Description: Query discount rules using [WQL (Wix Query Language)](https://dev.wix.com/api/rest/getting-started/api-query-language). Total entries (`pagingMetadata.total`) will be returned only for the first page.  > **Note:** `discountRule.status` can't be used for querying.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: DiscountRuleQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  
        - name: sort | type: array<Sorting> | description: Sorting options. For example, `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`.  
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  
              - name: longitude | type: number | description: Address longitude.  
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: active | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: revision | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: activeTimeInfo.start | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: activeTimeInfo.end | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: tags.privateTags.tagIds | operators: $hasSome, $hasAll, $exists, $isEmpty | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryDiscountRulesResponse>
  - name: discountRules | type: array<DiscountRule> | description: List of discount rules.  
     - name: _id | type: string | description: Discount rule GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the discount rule is updated. To prevent conflicting changes, the current `revision` must be passed when updating the discount rule.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the discount rule was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the discount rule was last updated.  | read-only: true 
     - name: active | type: boolean | description: Whether the discount rule is active.  Default: `true`  
     - name: name | type: string | description: Discount rule name.  | validation: minLength 1, maxLength 50
     - name: trigger | type: DiscountTrigger | description: Discount rule trigger. A set of conditions that must be met for the `discounts` to be applied. Not passing a trigger will cause the discount to always apply.  
        - ONE-OF: 
           - name: and | type: And | description: Chain multiple triggers with the `and` operator.  
              - name: triggers | type: array<DiscountTrigger> | description: List of triggers to have an "AND" operator between their results.  | validation: minItems 2, maxItems 5
           - name: or | type: Or | description: Chain multiple triggers with the `or` operator.  
              - name: triggers | type: array<DiscountTrigger> | description: List of triggers to have an "OR" operator between their results.  | validation: minItems 2, maxItems 5
           - name: customTrigger | type: Custom | description: Custom trigger.  
              - name: _id | type: string | description: Trigger GUID.  | validation: minLength 1, maxLength 100
              - name: appId | type: string | description: GUID of the app that created the trigger.  | validation: format GUID
           - name: subtotalRange | type: SubtotalRange | description: Subtotal trigger range.  
              - name: scopes | type: array<Scope> | description: Relevant scopes for `SPECIFIC_ITEMS` target type.  | validation: maxItems 50
                 - ONE-OF: 
                    - name: catalogItemFilter | type: CatalogItemFilter | description: Catalog item filter. Must be passed with `type."CATALOG_ITEM"`.  
                       - name: catalogAppId | type: string | description: Catalog App GUID. For example, the Wix Stores, Wix Bookings, or 3rd-party [`appId`](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md).  | validation: format GUID
                       - name: catalogItemIds | type: array<string> | description: GUID of the item within its Wix or 3rd-party catalog. For example, `productId` for Wix Stores.  | validation: minItems 0, maxItems 50, minLength 1, maxLength 36
                    - name: customFilter | type: CustomFilter | description: Custom filter. Must be passed with `type."CATALOG_ITEM"`.  
                       - name: appId | type: string | description: Custom filter app GUID, when relevant.  | validation: format GUID
                       - name: params | type: object | description: Custom filter in `{ "key": "value" }` form. For example, an array of `collectionIDs`: `{ ["collectionId": "12345"], ["collectionId": "67890"] }`.  
                 - name: _id | type: string | description: Scope GUID.  | validation: minLength 1, maxLength 100
                 - name: type | type: ScopeType | description: Scope type.  
                         - enum:
                         -     CATALOG_ITEM: Specific catalog items
                         -     CUSTOM_FILTER: Specific items by custom filters
              - name: from | type: string | description: Minimum subtotal price (inclusive).  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
              - name: to | type: string | description: Maximum subtotal price (inclusive).  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
           - name: itemQuantityRange | type: ItemQuantityRange | description: Item quantity trigger range.  
              - name: scopes | type: array<Scope> | description: Relevant scopes for `SPECIFIC_ITEMS` target type.  | validation: maxItems 50
              - name: from | type: integer | description: Minimum item quantity (inclusive).  | validation: minimum 1, format int32
              - name: to | type: integer | description: Maximum item quantity (inclusive).  | validation: minimum 1, format int32
           - name: customerEligibility | type: CustomerEligibility | description: Customer Eligibility info  
              - ONE-OF: 
                 - name: individualMembersInfo | type: IndividualMembers | description: Information about specific members.  
                    - name: memberIds | type: array<string> | description: Eligible member ids.  | validation: minItems 1, maxItems 100, format GUID
              - name: eligibilityType | type: EligibilityType | description: Customer eligibility type.  
                     - enum:
                     -     INDIVIDUAL_MEMBERS: Only specific customers based on member id.
        - name: triggerType | type: TriggerType | description: Trigger type.  
             - enum:
             -     AND: Operator used for chaining multiple triggers. Currently 1 `AND` chain operator is supported.
             -     SUBTOTAL_RANGE: Subtotal must be within the specified `subtotalRange` values.
             -     ITEM_QUANTITY_RANGE: Quantity of items in scope must be within specified `itemQuantityRange` values.
             -     CUSTOM: Custom trigger type defined in `customTrigger` object.
             -     OR: Chain multiple triggers with OR operator
             -     CUSTOMER_ELIGIBILITY: Customer eligibility type must be within specified `customerEligibility` values.
     - name: activeTimeInfo | type: ActiveTimeInfo | description: Time frame in which the discount rule is active.  
        - name: start | type: Date | description: Date and time the discount rule is active **from**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.  
        - name: end | type: Date | description: Date and time the discount rule is active **till**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.  
     - name: discounts | type: Discounts | description: List of discounts that are applied when one or more triggers are met.  > **Notes:** > > + Currently, only 1 discount can be defined per discount rule. > + A discount rule can be applied on multiple items per cart. > + A discount rule can only be applied once per item.  
        - name: values | type: array<Discount> | description: Discounts.  | validation: minItems 1, maxItems 1
           - ONE-OF: 
              - name: percentage | type: number | description: Percentage to discount from original price.  | validation: minimum 0.1, maximum 100
              - name: fixedAmount | type: string | description: Amount to discount from original price.  | validation: decimalValue {"gt":"0","lte":"1000000000000000","maxScale":4}
              - name: fixedPrice | type: string | description: Fixed price. Line item will be fixed to this price.  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
              - name: quantityBased | type: QuantityBased | description: A special price is applied for a specific quantity of items. For example, 3 for $10.  
                 - name: configurations | type: array<DiscountConfig> | description: list of discountConfig options.  | validation: minItems 1, maxItems 1
                    - name: _id | type: string | description: DiscountConfig GUID.  | read-only: true | validation: format GUID
                    - name: quantity | type: integer | description: The number of items that must be added to the cart to be eligible for the discount (Represents X).  | validation: minimum 2
                    - name: price | type: string | description: The DiscountConfig price (Represents Amount).  | validation: decimalValue {"gte":"0","lte":"1000000","maxScale":4}
           - name: targetType | type: Type | description: Discount target.  + `SPECIFIC_ITEMS`: Discount applies to a specific set of items.  
                 - enum:
                 -     SPECIFIC_ITEMS: Target type is a set of specific items
           - name: specificItemsInfo | type: SpecificItemsInfo | description: Data related to `SPECIFIC_ITEMS` target type.  
              - name: scopes | type: array<Scope> | description: All associated scopes for `SPECIFIC_ITEMS` target type.  | validation: minItems 1, maxItems 50
           - name: discountType | type: DiscountType | description: Discount type.  
                 - enum:
                 -     PERCENTAGE: Price is reduced by percentage value.
                 -     FIXED_AMOUNT: Price is reduced by fixed amount.
                 -     FIXED_PRICE: Price will be set to fixed amount.
                 -     QUANTITY_BASED: Quantity based options for Buy X For Amount.
     - name: status | type: Status | description: Discount rule status. Default: `UNDEFINED`  | read-only: true 
         - enum:
         -     LIVE: Rule status is live.
         -     EXPIRED: Rule status is expired, it might have been live in the past.
         -     PENDING: Rule status is pending, it might be live in the future.
     - name: usageCount | type: integer | description: Number of times the discount rule was used.  | read-only: true 
     - name: tags | type: Tags | description: Tags for this discount rule.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
  - name: pagingMetadata | type: PlatformPagingMetadata | description: Details on the paged set of results returned.  
     - name: count | type: integer | description: The number of items returned in this response.  | validation: format int32
     - name: offset | type: integer | description: The offset which was requested. Returned if offset paging was used.  | validation: format int32
     - name: total | type: integer | description: The total number of items that match the query. Returned if offset paging was used.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursors to navigate through result pages. Returned if cursor paging was used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### queryDiscountRules
```javascript
import { discountRules } from '@wix/ecom';

async function queryDiscountRules(query) {
  const response = await discountRules.queryDiscountRules(query);
};
```

### queryDiscountRules (with elevated permissions)
```javascript
import { discountRules } from '@wix/ecom';
import { auth } from '@wix/essentials';

async function myQueryDiscountRulesMethod(query) {
  const elevatedQueryDiscountRules = auth.elevate(discountRules.queryDiscountRules);
  const response = await elevatedQueryDiscountRules(query);
}
```

### queryDiscountRules (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { discountRules } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { discountRules },
  // Include the auth strategy and host as relevant
});


async function queryDiscountRules(query) {
  const response = await myWixClient.discountRules.queryDiscountRules(query);
};
```

---