About the eCommerce Abandoned Checkouts API

An abandoned checkout is created when:

  • A customer begins an eCommerce Checkout process but doesn't complete it (for example, after closing their browser tab before putting in their payment details and making a payment).

  • A customer who is also a site member creates a cart and closes their browser tab before proceeding to the checkout page. (Wix eCommerce creates an abandoned checkout entity with the cart details).

The Abandoned Checkouts API allows you to help a customer recover their abandoned checkout. When a customer completes their checkout and makes a purchase, the checkout becomes an order.

An abandoned checkout contains buyer details, prices, reference to the initial cart or checkout, a URL for accessing the abandoned checkout, and more.

The eCommerce Abandoned Checkouts API provides functionality for retrieving information about an abandoned checkout. You can also listen for events when an abandoned checkout is created and recovered.

Terminology

  • Recovered: When a customer returns to their abandoned checkout and completes the checkout.

  • Activities: This property is only relevant if the Wix user set up automations in the Dashboard. The activities property is a list of all automation activities performed by Wix Automations regarding the abandoned checkout. Wix Automations updates the activities field for each activity in the automation flow. For example, if a Wix user set up an automation to send a notification to a site visitor an hour after their abandoned checkout is created, Wix automations does the following:

    • Updates the activities field to SCHEDULED when the abandoned checkout is created.
    • Updates the activities field to NOTIFICATION_SENT after an hour, when the notification is sent to the site visitor.

    Other actvities include:

    • EMAIL_SENT
    • EMAIL_NOT_SENT
    • TASK_CREATED
Did this help?

Setup

@wix/ecom

To use the AbandonedCheckouts API, install the @wix/ecom package.

Install the package

Follow the installation instructions for your development environment.

Development environmentInstallation method
Wix sites (editor or IDE)Use the package manager.
Wix sites (local IDE)Run wix install @wix/ecom` using the Wix CLI.
Blocks appsUse the same installation method as Wix sites.
CLI and self-hosted appsRun npm install @wix/ecomoryarn add @wix/ecom.
Headless sites and appsRun npm install @wix/ecomoryarn add @wix/ecom.

Import the package

To import the package in your code:

Copy
Did this help?

Abandoned Checkouts: Sample Use Case & Flow

This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation. use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your app's implementation.

Redirect a site visitor with an abandoned checkout back to their checkout page

If a site visitor starts a checkout but doesn't complete it, you can redirect them to their checkout page. You can also check whether the site visitor has recovered their abandoned checkout and completed the purchase.

To redirect the site visitor to their checkout page:

  1. Use onAbandonedCheckoutCreated() to listen for when an abandoned checkout is created (a checkout was not completed).

  2. Save the newly created abandoned checkout's ID (entityId field) and checkoutUrl from the above event's payload. Then send a marketing campaign with the checkoutURL to your site visitor, redirecting them to their checkout page.

  3. After the marketing campaign, call Get Abandoned Checkout with the abandoned checkout's ID. Then check the status field in the response to see if the abandoned checkout has been recovered.

Did this help?

deleteAbandonedCheckout( )


Deletes an abandoned checkout.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Orders
Manage Restaurants - all permissions
Picasso private app mega scope
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
abandonedCheckoutIdstringRequired

Id of the abandoned checkout to delete

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?