> 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

# QueryPackages

# Package: resellers

# Namespace: Packages

# Method link: https://dev.wix.com/docs/api-reference/account-level/resellers/packages-and-product-instances/query-packages?apiView=SDK.md

## Permission Scopes:
## Method Code Examples

--- Code Example: Query packages with an API key ---

## Introduction

Retrieves a list of packages, given the provided paging, filtering, and sorting.


You must pass the ID of the Wix account that the packages belong to in the
header of the call. The call returns packages that belong to the parent
account, regardless if you pass the ID of a parent or sub-account. In case
you want to retrieve only packages that belong to a sub-account, you must
pass the sub-account ID as `filter` in the `query` object like this:

```json
{
"query": {
"filter": {
"accountId": {
"$eq": "<SUB_ACCOUNT_ID>"
}
}
}
}
```

Query Packages runs with these defaults, which you can override:

- `createdDate` is sorted in `DESC` order
- `cursorPaging.limit` is `100`

By default `pagingMetadata.cursors` are returned, unless you specifically pass
`query.paging`.

The maximum for `cursorPaging.limit` is `100`.

If you pass a cursor token that you have received in a previous Query Package response,
passing additional sort or filter information results in an invalid cursor
error. Since the received cursor token already holds all the needed information
for sort and filter. Changing the sort and filter properties during the span of
a cursor query isn't supported. But you can provide a different limit.

To learn about working with _Query_ endpoints, see
[API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
[Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).

> **Important**: This call requires an account level API key and cannot be
> authenticated with the standard authorization header.

---

## REST API

### Schema

```
 Method: queryPackages
 Description: Retrieves a list of packages, given the provided paging, filtering, and sorting.   You must pass the GUID of the Wix account that the packages belong to in the header of the call. The call returns packages that belong to the parent account, regardless if you pass the GUID of a parent or sub-account. In case you want to retrieve only packages that belong to a sub-account, you must pass the sub-account GUID as `filter` in the `query` object like this:  ```json { "query": { "filter": { "accountId": { "$eq": "<SUB_ACCOUNT_ID>" } } } } ```  Query Packages runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order - `cursorPaging.limit` is `100`  By default `pagingMetadata.cursors` are returned, unless you specifically pass `query.paging`.  The maximum for `cursorPaging.limit` is `100`.  If you pass a cursor token that you have received in a previous Query Package response, passing additional sort or filter information results in an invalid cursor error. Since the received cursor token already holds all the needed information for sort and filter. Changing the sort and filter properties during the span of a cursor query isn't supported. But you can provide a different limit.  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).  > **Important**: This call requires an account level API key and cannot be > authenticated with the standard authorization header.
 URL: https://www.wixapis.com/resellers/v1/packages/query
 Method: POST
 # 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: QueryV2   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `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.  Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting).  
           - 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
        - name: fields | type: array<string> | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned.  
        - name: fieldsets | type: array<string> | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned.  
 Query fields:
   - 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: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: accountId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: externalId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances | operators: none | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.instanceId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.siteId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.catalogProductId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.status | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.failure | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.failure.code | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.failure.message | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.type | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.cycleDuration | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.cycleDuration.unit | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.cycleDuration.count | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.countryCode | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
 Return type: QueryPackagesResponse
  - name: metadata | type: PagingMetadataV2 | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is 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
  - name: packages | type: array<Package> | description: Retrieved packages.  Max: 1000 packages  | validation: minItems 0, maxItems 1000
     - name: id | type: string | description: Package GUID.  | read-only: true | validation: format GUID
     - name: accountId | type: string | description: Wix account GUID. See [Account Level APIs](https://dev.wix.com/docs/rest/account-level/about-account-level-apis.md) for more details.  | read-only: true | validation: format GUID
     - name: externalId | type: string | description: External reference. For example, an external subscription GUID. This field isn't validated by Wix.  Max: 100 characters  | validation: maxLength 100
     - name: productInstances | type: array<ProductInstance> | description: Product instances that are included in the package.  Min: 1 product instance Max: 1000 product instances  | validation: minItems 1, maxItems 1000
        - ONE-OF: 
           - name: billingInfo | type: Cycle | description: Billing information for the contract between the reseller and Wix.  
              - name: type | type: CycleDescriptorType | description: Payment type.  
                     - enum:
                     -     ONE_TIME: The reseller pays Wix in a single payment.
                     -     RECURRING: The reseller pays Wix on a recurring schedule.
              - name: cycleDuration | type: Interval | description: Duration of the billing cycle. Available only for `RECURRING` payments.  
                 - name: unit | type: IntervalUnit | description: Unit of the billing cycle.  
                         - enum:
                         -     DAY: Day
                         -     WEEK: Week
                         -     MONTH: Month
                         -     YEAR: Year
                 - name: count | type: integer | description: Count of units that make up the billing cycle.  | validation: minimum 1
        - name: instanceId | type: string | description: GUID of the instance of the resold Wix service. **Note:** Differs from the `catalogProductId`. Allows you to identify different instances of the same product in a package.  | read-only: true | validation: format GUID
        - name: siteId | type: string | description: GUID of the Wix site that the product instance is assigned to. See the [Query Sites API](https://dev.wix.com/api/rest/account-level-apis/sites/query-sites) for more information.  | validation: format GUID
        - name: catalogProductId | type: string | description: Product GUID, as defined in the Wix Premium Product Catalog. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more details about available Wix services.  | validation: format GUID
        - name: status | type: Status | description: Status of the product instance.  | read-only: true 
             - enum:
             -     PENDING: The product instance isn't yet available to the customer.
             -     ENABLED: The customer can use the product instance.
             -     CANCELED: The product instance isn't any longer available to the customer.
             -     FAILED: The product instance couldn't be delivered successfully and has never been available to the customer.
             -     AWAITING_ACTION: The product instance isn't yet available to the customer, because an external provider or the customer must take an action.
        - name: failure | type: FailureReason | description: Failure object. Only present for status `FAILED`. Describes why the product instance `FAILED`.  | read-only: true 
           - name: code | type: FailureReasonCode | description: Failure code.  
                 - enum:
                 -     DELIVERY_TIMEOUT: The product instance couldn't be created because the Resellers API timed out.
                 -     EXTERNAL_FAILURE: The product instance couldn't be created because an external process failed.
           - name: message | type: string | description: Failure message.  
        - name: createdDate | type: string | description: Date and time the product instance was created.  | read-only: true | validation: format date-time
        - name: updatedDate | type: string | description: Date and time the product instance was last updated.  | read-only: true | validation: format date-time
        - name: countryCode | type: string | description: Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. Specifies where customers can claim vouchers that may come with the product. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) to get more information about vouchers and supported locations.  | validation: format COUNTRY
        - name: expirationDate | type: string | description: Date and time the product instance expires in `YYYY-MM-DDThh:mm:ss.sssZ` format. Used only for instances that don't auto renew at the end of the current billing cycle.  | read-only: true | validation: format date-time
        - name: discountCode | type: string | description: Discount code indicating that the reseller provisioned the product instance during a sale. Wix doesn't guarantee that a discount code reduces the price between Wix and the reseller, even when it's valid. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more information.  Max: 25 characters  | validation: maxLength 25
        - name: referenceProductInstanceId | type: string | description: GUID of a different product instance that you can use to offer your customers time-limited free access to an additional product or service. For example, Wix offers a 1-year free domain registration to all customers who purchase a Premium plan. The referenced product instance must have either status `"PENDING"` or `"ACTIVE"`. You can use each product instance only a single time as reference instance.  | validation: format GUID
     - name: createdDate | type: string | description: Date and time the package was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the package was last updated.  | read-only: true | validation: format date-time


```

### Examples

### Query packages
```curl
curl -X POST \
'www.wixapis.com/resellers/v1/packages/query' \
-H 'wix-account-id: <ACCOUNT_ID>' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
    "query": {
        "filter": {
            "productInstances.status": {
                "$hasAll": ["Enabled"]
            }
        },
        "fields": ["id"],
        "fieldsets": ["id"]
    }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.packages.packages.queryPackages(query)
 Description: Retrieves a list of packages, given the provided paging, filtering, and sorting.   You must pass the GUID of the Wix account that the packages belong to in the header of the call. The call returns packages that belong to the parent account, regardless if you pass the GUID of a parent or sub-account. In case you want to retrieve only packages that belong to a sub-account, you must pass the sub-account GUID as `filter` in the `query` object like this:  ```json { "query": { "filter": { "accountId": { "$eq": "<SUB_ACCOUNT_ID>" } } } } ```  Query Packages runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order - `cursorPaging.limit` is `100`  By default `pagingMetadata.cursors` are returned, unless you specifically pass `query.paging`.  The maximum for `cursorPaging.limit` is `100`.  If you pass a cursor token that you have received in a previous Query Package response, passing additional sort or filter information results in an invalid cursor error. Since the received cursor token already holds all the needed information for sort and filter. Changing the sort and filter properties during the span of a cursor query isn't supported. But you can provide a different limit.  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).  > **Important**: This call requires an account level API key and cannot be > authenticated with the standard authorization header.
 # 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: PackagesQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `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.  Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting).  
           - 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: _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: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: accountId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: externalId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances | operators: none | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.instanceId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.siteId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.catalogProductId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.status | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.failure | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.failure.code | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.failure.message | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.type | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.cycleDuration | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.cycleDuration.unit | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.billingInfo.cycleDuration.count | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances._createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances._updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: productInstances.countryCode | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryPackagesResponse>
  - name: metadata | type: PagingMetadataV2 | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is 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
  - name: packages | type: array<Package> | description: Retrieved packages.  Max: 1000 packages  | validation: minItems 0, maxItems 1000
     - name: _id | type: string | description: Package GUID.  | read-only: true | validation: format GUID
     - name: accountId | type: string | description: Wix account GUID. See [Account Level APIs](https://dev.wix.com/docs/rest/account-level/about-account-level-apis.md) for more details.  | read-only: true | validation: format GUID
     - name: externalId | type: string | description: External reference. For example, an external subscription GUID. This field isn't validated by Wix.  Max: 100 characters  | validation: maxLength 100
     - name: productInstances | type: array<ProductInstance> | description: Product instances that are included in the package.  Min: 1 product instance Max: 1000 product instances  | validation: minItems 1, maxItems 1000
        - ONE-OF: 
           - name: billingInfo | type: Cycle | description: Billing information for the contract between the reseller and Wix.  
              - name: type | type: CycleDescriptorType | description: Payment type.  
                     - enum:
                     -     ONE_TIME: The reseller pays Wix in a single payment.
                     -     RECURRING: The reseller pays Wix on a recurring schedule.
              - name: cycleDuration | type: Interval | description: Duration of the billing cycle. Available only for `RECURRING` payments.  
                 - name: unit | type: IntervalUnit | description: Unit of the billing cycle.  
                         - enum:
                         -     DAY: Day
                         -     WEEK: Week
                         -     MONTH: Month
                         -     YEAR: Year
                 - name: count | type: integer | description: Count of units that make up the billing cycle.  | validation: minimum 1
        - name: instanceId | type: string | description: GUID of the instance of the resold Wix service. **Note:** Differs from the `catalogProductId`. Allows you to identify different instances of the same product in a package.  | read-only: true | validation: format GUID
        - name: siteId | type: string | description: GUID of the Wix site that the product instance is assigned to. See the [Query Sites API](https://dev.wix.com/api/rest/account-level-apis/sites/query-sites) for more information.  | validation: format GUID
        - name: catalogProductId | type: string | description: Product GUID, as defined in the Wix Premium Product Catalog. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more details about available Wix services.  | validation: format GUID
        - name: status | type: Status | description: Status of the product instance.  | read-only: true 
             - enum:
             -     PENDING: The product instance isn't yet available to the customer.
             -     ENABLED: The customer can use the product instance.
             -     CANCELED: The product instance isn't any longer available to the customer.
             -     FAILED: The product instance couldn't be delivered successfully and has never been available to the customer.
             -     AWAITING_ACTION: The product instance isn't yet available to the customer, because an external provider or the customer must take an action.
        - name: failure | type: FailureReason | description: Failure object. Only present for status `FAILED`. Describes why the product instance `FAILED`.  | read-only: true 
           - name: code | type: FailureReasonCode | description: Failure code.  
                 - enum:
                 -     DELIVERY_TIMEOUT: The product instance couldn't be created because the Resellers API timed out.
                 -     EXTERNAL_FAILURE: The product instance couldn't be created because an external process failed.
           - name: message | type: string | description: Failure message.  
        - name: _createdDate | type: Date | description: Date and time the product instance was created.  | read-only: true 
        - name: _updatedDate | type: Date | description: Date and time the product instance was last updated.  | read-only: true 
        - name: countryCode | type: string | description: Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. Specifies where customers can claim vouchers that may come with the product. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) to get more information about vouchers and supported locations.  | validation: format COUNTRY
        - name: expirationDate | type: Date | description: Date and time the product instance expires in `YYYY-MM-DDThh:mm:ss.sssZ` format. Used only for instances that don't auto renew at the end of the current billing cycle.  | read-only: true 
        - name: discountCode | type: string | description: Discount code indicating that the reseller provisioned the product instance during a sale. Wix doesn't guarantee that a discount code reduces the price between Wix and the reseller, even when it's valid. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more information.  Max: 25 characters  | validation: maxLength 25
        - name: referenceProductInstanceId | type: string | description: GUID of a different product instance that you can use to offer your customers time-limited free access to an additional product or service. For example, Wix offers a 1-year free domain registration to all customers who purchase a Premium plan. The referenced product instance must have either status `"PENDING"` or `"ACTIVE"`. You can use each product instance only a single time as reference instance.  | validation: format GUID
     - name: _createdDate | type: Date | description: Date and time the package was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the package was last updated.  | read-only: true 


```

### Examples

### Query packages with an API key
```javascript
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { packages } from "@wix/packages";

const wixClient = createClient({
 modules: { packages },
 auth: ApiKeyStrategy({
    apiKey: "MY-API-KEY",
  }),
});

async function queryPackages() {
  const { items } = await packages.queryPackages().find();
}

```

### queryPackages (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 { packages } from '@wix/packages';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function queryPackages(query) {
  const response = await myWixClient.packages.queryPackages(query);
};
```

---