> 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

# QueryAbandonedCheckouts

# Package: checkout

# Namespace: AbandonedCheckoutService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/abandoned-checkout/query-abandoned-checkouts?apiView=SDK.md

## Permission Scopes:
Read Orders: SCOPE.DC-STORES.READ-ORDERS

## Introduction

Retrieves a list of abandoned checkouts, given the provided paging, filtering, and sorting. Up to 100 abandoned checkouts can be returned per request.

To learn how to query abandoned checkouts, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).

---

## REST API

### Schema

```
 Method: queryAbandonedCheckouts
 Description: Retrieves a list of abandoned checkouts, given the provided paging, filtering, and sorting. Up to 100 abandoned checkouts can be returned per request.  To learn how to query abandoned checkouts, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
 URL: https://www.wixapis.com/ecom/v1/abandoned-checkout/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: 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: status | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.contactId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.email | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.visitorId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.memberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.userId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryAbandonedCheckoutsResponse
  - name: abandonedCheckouts | type: array<AbandonedCheckout> | description: List of abandoned checkouts.  
     - name: id | type: string | description: Abandoned checkout GUID.  | validation: format GUID
     - name: createdDate | type: string | description: Date and time the abandoned checkout was created.  | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the abandoned checkout was updated.  | validation: format date-time
     - name: checkoutId | type: string | description: The associated checkout GUID.  | validation: format GUID
     - name: cartId | type: string | description: The associated cart GUID.  | validation: format GUID
     - name: status | type: Status | description: Status of the abandoned checkout.  
         - enum:
         -     ABANDONED: Abandoned.
         -     RECOVERED: Recovered.
     - name: buyerLanguage | type: string | description: Language for communication with the buyer. Defaults to the site language. For a site that supports multiple languages, this is the language the buyer selected.  
     - name: buyerInfo | type: BuyerInfo | description: Buyer information.  
        - ONE-OF: 
           - name: visitorId | type: string | description: Visitor GUID (if the site visitor is **not** a site member).  | validation: format GUID
           - name: memberId | type: string | description: Member GUID (if the site visitor is a site member).  | validation: format GUID
           - name: userId | type: string | description: User GUID (if the site visitor is a site owner or collaborator).  | validation: format GUID
        - name: contactId | type: string | description: Contact GUID. For more information, see the Contacts API.  | read-only: true | validation: format GUID
        - name: email | type: string | description: Buyer email address.  | validation: maxLength 50, format EMAIL
     - name: contactDetails | type: FullAddressContactDetails | description: Contact details.  
        - name: firstName | type: string | description: First name.  | validation: maxLength 100
        - name: lastName | type: string | description: Last name.  | validation: maxLength 100
        - name: phone | type: string | description: Phone number.  | validation: format PHONE
        - name: company | type: string | description: Company name.  | validation: maxLength 1000
        - name: vatId | type: VatId | description: Tax information (for Brazil only). If GUID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed.  
           - name: id | type: string | description: Customer's tax GUID.  
           - name: type | type: VatType | description: Tax type.  Supported values: + `CPF`: for individual tax payers + `CNPJ`: for corporations  
                 - enum:
                 -     UNSPECIFIED: 
                 -     CPF: CPF - for individual tax payers.
                 -     CNPJ: CNPJ - for corporations
     - name: currency | type: string | description: The store's currency.  | validation: format CURRENCY
     - name: conversionCurrency | type: string | description: Currency the buyer used in checkout.  | validation: format CURRENCY
     - name: totalPrice | type: MultiCurrencyPrice | description: Total price after discounts, gift cards, and tax.  
        - name: amount | type: string | description: Amount.  | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
        - name: convertedAmount | type: string | description: Converted amount.  | read-only: true | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
        - name: formattedAmount | type: string | description: Amount formatted with currency symbol.  | read-only: true 
        - name: formattedConvertedAmount | type: string | description: Converted amount formatted with currency symbol.  | read-only: true 
     - name: activities | type: array<Activity> | description: List of all automation activities performed by [Wix Automations](https://dev.wix.com/docs/rest/business-management/automations/introduction.md) regarding the abandoned checkout. Wix Automations updates the `activities` field for each activity in the automation flow. Only relevant if the site owner set up [automations in the Dashboard](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-1-create-a-new-automation). Read more about `activities` in the Abandoned Checkouts introduction.  | read-only: true | validation: maxItems 20
        - name: createdDate | type: string | description: Date and time the automation activity was created.  | validation: format date-time
        - name: type | type: ActivityType | description: Automation activity type.  
             - enum:
             -     SCHEDULED: Scheduled.
             -     EMAIL_SENT: Email sent.
             -     EMAIL_NOT_SENT: Email not sent.
             -     NOTIFICATION_SENT: Notification sent.
             -     TASK_CREATED: Task created.
             -     AUTOMATION_SKIPPED: Automation skipped.
     - name: checkoutRecoveredDate | type: string | description: Date and time the abandoned checkout was recovered.  | validation: format date-time
     - name: checkoutUrl | type: string | description: Checkout URL.  | validation: format WEB_URL
     - name: subtotalPrice | type: MultiCurrencyPrice | description: Subtotal price of all line items, before discounts and before tax.  
     - name: lineItems | type: array<LineItem> | description: Line items.  | read-only: true | validation: minItems 1, maxItems 300
        - name: id | type: string | description: Line item GUID.  | read-only: true | validation: format GUID
        - name: quantity | type: integer | description: Item quantity.  | validation: minimum 1, maximum 100000
        - name: catalogReference | type: CatalogReference | description: Catalog and item reference. Holds GUIDs for the item and the catalog it came from, as well as further optional info. Optional for custom line items, which don't trigger the Catalog service plugin.  
           - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  | validation: minLength 1, maxLength 36
           - name: appId | type: string | description: GUID of the app providing the catalog.  You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).  For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`  | validation: minLength 1
           - name: options | type: object | description: Additional item details in `key:value` pairs.  Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.  For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md).  
        - name: productName | type: ProductName | description: Item name. + Stores - `product.name` + Bookings - `service.info.name` + Events - `ticket.name`  | read-only: true 
           - name: original | type: string | description: __Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  Min: 1 character. Max: 200 characters.  | validation: minLength 1, maxLength 200
           - name: translated | type: string | description: Item name translated into the buyer's language.  Min: 1 character. Max: 400 characters. Default: Same as `original`.  | validation: minLength 1, maxLength 400
        - name: price | type: MultiCurrencyPrice | description: Item price **after** catalog-defined discount and line item discounts.  | read-only: true 
        - name: priceBeforeDiscounts | type: MultiCurrencyPrice | description: Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided.  | read-only: true 
        - name: descriptionLines | type: array<DescriptionLine> | description: Line item description lines. Used for displaying the cart, checkout and order.  | read-only: true | validation: maxItems 300
           - ONE-OF: 
              - name: plainText | type: PlainTextValue | description: Description line plain text value.  
                 - name: original | type: string | description: Description line plain text value in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: maxLength 600
                 - name: translated | type: string | description: Description line plain text value translated into the buyer's language.  Default: Same as `original`.  | validation: maxLength 600
              - name: colorInfo | type: Color | description: Description line color value.  
                 - name: original | type: string | description: Description line color name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: maxLength 500
                 - name: translated | type: string | description: Description line color name translated into the buyer's language.  Default: Same as `original`.  | validation: maxLength 500
                 - name: code | type: string | description: HEX or RGB color code for display.  
           - name: name | type: DescriptionLineName | description: Description line name.  
              - name: original | type: string | description: Description line name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: maxLength 100
              - name: translated | type: string | description: Description line name translated into the buyer's language.  Default: Same as `original`.  | validation: maxLength 200
        - name: image | type: Image | description: Line item image details.  | read-only: true 
           - name: id | type: string | description: WixMedia image GUID.  | validation: maxLength 400
           - name: url | type: string | description: Image URL.  | validation: format WEB_URL
           - name: height | type: integer | description: Original image height.  | read-only: true 
           - name: width | type: integer | description: Original image width.  | read-only: true 
           - name: altText | type: string | description: Image alt text.  | validation: maxLength 200
        - name: physicalProperties | type: PhysicalProperties | description: Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability.  | read-only: true 
           - name: weight | type: number | description: Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request.  | validation: format double
           - name: sku | type: string | description: Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).  | validation: maxLength 40
           - name: shippable | type: boolean | description: Whether this line item is shippable.  
           - name: productDimensions | type: Dimensions | description: Product dimensions (length, width, height of the physical product).  
              - name: length | type: string | description: Length. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
              - name: width | type: string | description: Width. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
              - name: height | type: string | description: Height. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
              - name: unit | type: DimensionsUnit | description: Unit of measurement for dimensions (length, width, height).  
                     - enum:
                     -     UNKNOWN_DIMENSIONS_UNIT: 
                     -     MM: Millimeters.
                     -     CM: Centimeters.
                     -     M: Meters.
                     -     IN: Inches.
                     -     FT: Feet.
                     -     YD: Yards.
           - name: packageDimensions | type: Dimensions | description: Package dimensions (length, width, height of the shipping package).  
     - name: appliedDiscounts | type: array<AppliedDiscount> | description: Applied discounts.  | read-only: true | validation: maxItems 100
        - ONE-OF: 
           - name: coupon | type: Coupon | description: Coupon details.  
              - name: id | type: string | description: Coupon GUID.  | validation: maxLength 50
              - name: code | type: string | description: Coupon code.  | validation: maxLength 50
              - name: amount | type: MultiCurrencyPrice | description: Coupon value.  
              - name: name | type: string | description: Coupon name.  | validation: maxLength 60
           - name: merchantDiscount | type: MerchantDiscount | description: Merchant discount.  
              - name: amount | type: MultiCurrencyPrice | description: Discount value.  
              - name: percentage | type: number | description: Discount Percentage. Will be calculated from items price before other discounts.  | validation: minimum 1, maximum 100, format double
           - name: discountRule | type: DiscountRule | description: Discount rule  
              - name: id | type: string | description: Discount rule GUID  | validation: format GUID
              - name: name | type: DiscountRuleName | description: Discount rule name  
                 - name: original | type: string | description: Original discount rule name (in site's default language).  | validation: minLength 1, maxLength 256
                 - name: translated | type: string | description: Translated discount rule name according to buyer language. Defaults to `original` when not provided.  | validation: minLength 1, maxLength 500
              - name: amount | type: MultiCurrencyPrice | description: Discount value.  
        - name: discountType | type: DiscountType | description: Discount type.  
             - enum: GLOBAL, SPECIFIC_ITEMS, SHIPPING
        - name: lineItemIds | type: array<string> | description: IDs of line items the discount applies to.  | validation: maxItems 300, format GUID
  - name: metadata | type: PagingMetadataV2 | description: Details on the paged set of results returned.  
     - 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


```

### Examples

### Query Abandoned Checkouts
```curl
curl -X POST https://www.wixapis.com/ecom/v1/abandoned-checkout/query  \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "query": {
      "sort": [
        {
          "fieldName": "createdDate",
          "order": "DESC"
        }
      ],
      "filter": {
        "contactDetails.firstName": "John"
      },
      "paging": {
        "limit": 20,
        "offset": 0
      }
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.abandonedCheckouts.queryAbandonedCheckouts(query)
 Description: Retrieves a list of abandoned checkouts, given the provided paging, filtering, and sorting. Up to 100 abandoned checkouts can be returned per request.  To learn how to query abandoned checkouts, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
 # 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: AbandonedCheckoutQuery   | 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: _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: status | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.contactId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.email | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.visitorId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.memberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: buyerInfo.userId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryAbandonedCheckoutsResponse>
  - name: abandonedCheckouts | type: array<AbandonedCheckout> | description: List of abandoned checkouts.  
     - name: _id | type: string | description: Abandoned checkout GUID.  | validation: format GUID
     - name: _createdDate | type: Date | description: Date and time the abandoned checkout was created.  
     - name: _updatedDate | type: Date | description: Date and time the abandoned checkout was updated.  
     - name: checkoutId | type: string | description: The associated checkout GUID.  | validation: format GUID
     - name: cartId | type: string | description: The associated cart GUID.  | validation: format GUID
     - name: status | type: Status | description: Status of the abandoned checkout.  
         - enum:
         -     ABANDONED: Abandoned.
         -     RECOVERED: Recovered.
     - name: buyerLanguage | type: string | description: Language for communication with the buyer. Defaults to the site language. For a site that supports multiple languages, this is the language the buyer selected.  
     - name: buyerInfo | type: BuyerInfo | description: Buyer information.  
        - ONE-OF: 
           - name: visitorId | type: string | description: Visitor GUID (if the site visitor is **not** a site member).  | validation: format GUID
           - name: memberId | type: string | description: Member GUID (if the site visitor is a site member).  | validation: format GUID
           - name: userId | type: string | description: User GUID (if the site visitor is a site owner or collaborator).  | validation: format GUID
        - name: contactId | type: string | description: Contact GUID. For more information, see the Contacts API.  | read-only: true | validation: format GUID
        - name: email | type: string | description: Buyer email address.  | validation: maxLength 50, format EMAIL
     - name: contactDetails | type: FullAddressContactDetails | description: Contact details.  
        - name: firstName | type: string | description: First name.  | validation: maxLength 100
        - name: lastName | type: string | description: Last name.  | validation: maxLength 100
        - name: phone | type: string | description: Phone number.  | validation: format PHONE
        - name: company | type: string | description: Company name.  | validation: maxLength 1000
        - name: vatId | type: VatId | description: Tax information (for Brazil only). If GUID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed.  
           - name: _id | type: string | description: Customer's tax GUID.  
           - name: type | type: VatType | description: Tax type.  Supported values: + `CPF`: for individual tax payers + `CNPJ`: for corporations  
                 - enum:
                 -     UNSPECIFIED: 
                 -     CPF: CPF - for individual tax payers.
                 -     CNPJ: CNPJ - for corporations
     - name: currency | type: string | description: The store's currency.  | validation: format CURRENCY
     - name: conversionCurrency | type: string | description: Currency the buyer used in checkout.  | validation: format CURRENCY
     - name: totalPrice | type: MultiCurrencyPrice | description: Total price after discounts, gift cards, and tax.  
        - name: amount | type: string | description: Amount.  | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
        - name: convertedAmount | type: string | description: Converted amount.  | read-only: true | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
        - name: formattedAmount | type: string | description: Amount formatted with currency symbol.  | read-only: true 
        - name: formattedConvertedAmount | type: string | description: Converted amount formatted with currency symbol.  | read-only: true 
     - name: activities | type: array<Activity> | description: List of all automation activities performed by [Wix Automations](https://dev.wix.com/docs/rest/business-management/automations/introduction.md) regarding the abandoned checkout. Wix Automations updates the `activities` field for each activity in the automation flow. Only relevant if the site owner set up [automations in the Dashboard](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-1-create-a-new-automation). Read more about `activities` in the Abandoned Checkouts introduction.  | read-only: true | validation: maxItems 20
        - name: _createdDate | type: Date | description: Date and time the automation activity was created.  
        - name: type | type: ActivityType | description: Automation activity type.  
             - enum:
             -     SCHEDULED: Scheduled.
             -     EMAIL_SENT: Email sent.
             -     EMAIL_NOT_SENT: Email not sent.
             -     NOTIFICATION_SENT: Notification sent.
             -     TASK_CREATED: Task created.
             -     AUTOMATION_SKIPPED: Automation skipped.
     - name: checkoutRecoveredDate | type: Date | description: Date and time the abandoned checkout was recovered.  
     - name: checkoutUrl | type: string | description: Checkout URL.  | validation: format WEB_URL
     - name: subtotalPrice | type: MultiCurrencyPrice | description: Subtotal price of all line items, before discounts and before tax.  
     - name: lineItems | type: array<LineItem> | description: Line items.  | read-only: true | validation: minItems 1, maxItems 300
        - name: _id | type: string | description: Line item GUID.  | read-only: true | validation: format GUID
        - name: quantity | type: integer | description: Item quantity.  | validation: minimum 1, maximum 100000
        - name: catalogReference | type: CatalogReference | description: Catalog and item reference. Holds GUIDs for the item and the catalog it came from, as well as further optional info. Optional for custom line items, which don't trigger the Catalog service plugin.  
           - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  | validation: minLength 1, maxLength 36
           - name: appId | type: string | description: GUID of the app providing the catalog.  You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).  For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`  | validation: minLength 1
           - name: options | type: object | description: Additional item details in `key:value` pairs.  Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.  For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md).  
        - name: productName | type: ProductName | description: Item name. + Stores - `product.name` + Bookings - `service.info.name` + Events - `ticket.name`  | read-only: true 
           - name: original | type: string | description: __Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  Min: 1 character. Max: 200 characters.  | validation: minLength 1, maxLength 200
           - name: translated | type: string | description: Item name translated into the buyer's language.  Min: 1 character. Max: 400 characters. Default: Same as `original`.  | validation: minLength 1, maxLength 400
        - name: price | type: MultiCurrencyPrice | description: Item price **after** catalog-defined discount and line item discounts.  | read-only: true 
        - name: priceBeforeDiscounts | type: MultiCurrencyPrice | description: Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided.  | read-only: true 
        - name: descriptionLines | type: array<DescriptionLine> | description: Line item description lines. Used for displaying the cart, checkout and order.  | read-only: true | validation: maxItems 300
           - ONE-OF: 
              - name: plainText | type: PlainTextValue | description: Description line plain text value.  
                 - name: original | type: string | description: Description line plain text value in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: maxLength 600
                 - name: translated | type: string | description: Description line plain text value translated into the buyer's language.  Default: Same as `original`.  | validation: maxLength 600
              - name: colorInfo | type: Color | description: Description line color value.  
                 - name: original | type: string | description: Description line color name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: maxLength 500
                 - name: translated | type: string | description: Description line color name translated into the buyer's language.  Default: Same as `original`.  | validation: maxLength 500
                 - name: code | type: string | description: HEX or RGB color code for display.  
           - name: name | type: DescriptionLineName | description: Description line name.  
              - name: original | type: string | description: Description line name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: maxLength 100
              - name: translated | type: string | description: Description line name translated into the buyer's language.  Default: Same as `original`.  | validation: maxLength 200
        - name: image | type: string | description: Line item image details.  | read-only: true 
        - name: physicalProperties | type: PhysicalProperties | description: Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability.  | read-only: true 
           - name: weight | type: number | description: Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request.  
           - name: sku | type: string | description: Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).  | validation: maxLength 40
           - name: shippable | type: boolean | description: Whether this line item is shippable.  
           - name: productDimensions | type: Dimensions | description: Product dimensions (length, width, height of the physical product).  
              - name: length | type: string | description: Length. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
              - name: width | type: string | description: Width. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
              - name: height | type: string | description: Height. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
              - name: unit | type: DimensionsUnit | description: Unit of measurement for dimensions (length, width, height).  
                     - enum:
                     -     UNKNOWN_DIMENSIONS_UNIT: 
                     -     MM: Millimeters.
                     -     CM: Centimeters.
                     -     M: Meters.
                     -     IN: Inches.
                     -     FT: Feet.
                     -     YD: Yards.
           - name: packageDimensions | type: Dimensions | description: Package dimensions (length, width, height of the shipping package).  
     - name: appliedDiscounts | type: array<AppliedDiscount> | description: Applied discounts.  | read-only: true | validation: maxItems 100
        - ONE-OF: 
           - name: coupon | type: Coupon | description: Coupon details.  
              - name: _id | type: string | description: Coupon GUID.  | validation: maxLength 50
              - name: code | type: string | description: Coupon code.  | validation: maxLength 50
              - name: amount | type: MultiCurrencyPrice | description: Coupon value.  
              - name: name | type: string | description: Coupon name.  | validation: maxLength 60
           - name: merchantDiscount | type: MerchantDiscount | description: Merchant discount.  
              - name: amount | type: MultiCurrencyPrice | description: Discount value.  
              - name: percentage | type: number | description: Discount Percentage. Will be calculated from items price before other discounts.  | validation: minimum 1, maximum 100
           - name: discountRule | type: DiscountRule | description: Discount rule  
              - name: _id | type: string | description: Discount rule GUID  | validation: format GUID
              - name: name | type: DiscountRuleName | description: Discount rule name  
                 - name: original | type: string | description: Original discount rule name (in site's default language).  | validation: minLength 1, maxLength 256
                 - name: translated | type: string | description: Translated discount rule name according to buyer language. Defaults to `original` when not provided.  | validation: minLength 1, maxLength 500
              - name: amount | type: MultiCurrencyPrice | description: Discount value.  
        - name: discountType | type: DiscountType | description: Discount type.  
             - enum: GLOBAL, SPECIFIC_ITEMS, SHIPPING
        - name: lineItemIds | type: array<string> | description: IDs of line items the discount applies to.  | validation: maxItems 300, format GUID
  - name: metadata | type: PagingMetadataV2 | description: Details on the paged set of results returned.  
     - 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


```

### Examples

### queryAbandonedCheckouts
```javascript
import { abandonedCheckouts } from '@wix/ecom';

async function queryAbandonedCheckouts(query) {
  const response = await abandonedCheckouts.queryAbandonedCheckouts(query);
};
```

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

async function myQueryAbandonedCheckoutsMethod(query) {
  const elevatedQueryAbandonedCheckouts = auth.elevate(abandonedCheckouts.queryAbandonedCheckouts);
  const response = await elevatedQueryAbandonedCheckouts(query);
}
```

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

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


async function queryAbandonedCheckouts(query) {
  const response = await myWixClient.abandonedCheckouts.queryAbandonedCheckouts(query);
};
```

---