> 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

> **Deprecated.** This method is deprecated. Cart V2 has no equivalent method. Cart V2 has no separate checkout step: prepare the cart, then call Place Order directly. Planned removal date: 2027-02-01.

# CreateCheckoutFromCurrentCart

# Package: purchaseFlow

# Namespace: CurrentCartService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart/create-checkout-from-current-cart.md

## Permission Scopes:
Manage Orders: SCOPE.DC-STORES.MANAGE-ORDERS

## Introduction

Creates a checkout from the current site visitor's cart.

If a checkout was already created from the current cart,
that checkout will be updated with any new information from the cart.

>**Notes:**
>+ `channelType` is a required field.
>+ This method requires [visitor or member authentication](https://dev.wix.com/docs/overview/auth-permissions/identities.md).

---

## REST API

### Schema

```
 Method: createCheckoutFromCurrentCart
 Description: Creates a checkout from the current site visitor's cart.  If a checkout was already created from the current cart, that checkout will be updated with any new information from the cart.  >**Notes:** >+ `channelType` is a required field. >+ This method requires [visitor or member authentication](https://dev.wix.com/docs/overview/auth-permissions/identities.md).
 URL: https://www.wixapis.com/ecom/v1/carts/current/create-checkout
 Method: POST
 Method parameters:
   param name: billingAddress | type: Address | description: Physical address  
        - name: country | type: string | description: Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.  | validation: format COUNTRY
        - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.  | validation: maxLength 50
        - name: city | type: string | description: City name.  | validation: maxLength 50
        - name: postalCode | type: string | description: Postal or zip code.  | validation: maxLength 50
        - name: streetAddress | type: StreetAddress | description: Street address.  
           - name: number | type: string | description: Street number.  
           - name: name | type: string | description: Street name.  
        - name: addressLine | type: string | description: Main address line (usually street name and number).  | validation: maxLength 150
        - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains apt, suite, floor.  | validation: maxLength 100
        - name: geocode | type: AddressLocation | description: Geocode object containing latitude and longitude coordinates.  
           - name: latitude | type: number | description: Address latitude.  | validation: format double
           - name: longitude | type: number | description: Address longitude.  | validation: format double
   param name: channelType | type: ChannelType    
      - enum:
           UNSPECIFIED - Unspecified sales channel. This value is not supported.
           WEB - A web client.
           POS - [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395).
           EBAY - [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop).
           AMAZON - [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop).
           OTHER_PLATFORM - Other sales platform.
           WIX_APP_STORE - [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview).
           WIX_INVOICES - Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings)
           BACKOFFICE_MERCHANT - Wix merchant backoffice.
           WISH - Wish sales channel.
           CLASS_PASS - [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass).
           GLOBAL_E - Global-E sales channel.
           FACEBOOK - [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops).
           ETSY - [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel).
           TIKTOK - [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel).
           FAIRE_COM - [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app).
           PAYPAL_AGENTIC_CHECKOUT - PayPal Agentic Checkout sales channel.
           STRIPE_AGENTIC_CHECKOUT - Stripe Agentic Checkout sales channel.
   param name: email | type: email | description: Required when setting billing or shipping address and user is not logged in.  | validation: format EMAIL
   param name: selectedShippingOption | type: SelectedShippingOption    
        - name: carrierId | type: string | description: Carrier GUID.  | validation: format GUID
        - name: code | type: string | description: Selected shipping option code. For example, "usps_std_overnight".  | validation: minLength 1, maxLength 100
   param name: shippingAddress | type: Address | description: Physical address  
        - name: country | type: string | description: Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.  | validation: format COUNTRY
        - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.  | validation: maxLength 50
        - name: city | type: string | description: City name.  | validation: maxLength 50
        - name: postalCode | type: string | description: Postal or zip code.  | validation: maxLength 50
        - name: streetAddress | type: StreetAddress | description: Street address.  
        - name: addressLine | type: string | description: Main address line (usually street name and number).  | validation: maxLength 150
        - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains apt, suite, floor.  | validation: maxLength 100
        - name: geocode | type: AddressLocation | description: Geocode object containing latitude and longitude coordinates.  
 Return type: CreateCheckoutResponse
  - name: checkoutId | type: string | description: The newly created checkout's GUID.  


```

### Examples

### Create a checkout from the current site visitor's cart
```curl
curl -X POST \
 'https://www.wixapis.com/ecom/v1/carts/current/create-checkout' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
    "channelType": "EBAY"
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.currentCart.createCheckoutFromCurrentCart(options)
 Description: Creates a checkout from the current site visitor's cart.  If a checkout was already created from the current cart, that checkout will be updated with any new information from the cart.  >**Notes:** >+ `channelType` is a required field. >+ This method requires [visitor or member authentication](https://dev.wix.com/docs/overview/auth-permissions/identities.md).
 Method parameters:
   param name: options | type: CreateCheckoutFromCurrentCartOptions  none  
        - name: channelType | type: ChannelType | description: __Required.__ Sales channel type.  
             - enum:
             -     UNSPECIFIED: Unspecified sales channel. This value is not supported.
             -     WEB: A web client.
             -     POS: [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395).
             -     EBAY: [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop).
             -     AMAZON: [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop).
             -     OTHER_PLATFORM: Other sales platform.
             -     WIX_APP_STORE: [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview).
             -     WIX_INVOICES: Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings)
             -     BACKOFFICE_MERCHANT: Wix merchant backoffice.
             -     WISH: Wish sales channel.
             -     CLASS_PASS: [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass).
             -     GLOBAL_E: Global-E sales channel.
             -     FACEBOOK: [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops).
             -     ETSY: [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel).
             -     TIKTOK: [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel).
             -     FAIRE_COM: [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app).
             -     PAYPAL_AGENTIC_CHECKOUT: PayPal Agentic Checkout sales channel.
             -     STRIPE_AGENTIC_CHECKOUT: Stripe Agentic Checkout sales channel.
        - name: shippingAddress | type: Address | description: Shipping address. Used for calculating tax and shipping (when applicable).  
           - name: country | type: string | description: Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.  | validation: format COUNTRY
           - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.  | validation: maxLength 50
           - name: city | type: string | description: City name.  | validation: maxLength 50
           - name: postalCode | type: string | description: Postal or zip code.  | validation: maxLength 50
           - name: streetAddress | type: StreetAddress | description: Street address.  
              - name: number | type: string | description: Street number.  
              - name: name | type: string | description: Street name.  
           - name: addressLine | type: string | description: Main address line (usually street name and number).  | validation: maxLength 150
           - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains apt, suite, floor.  | validation: maxLength 100
           - name: geocode | type: AddressLocation | description: Geocode object containing latitude and longitude coordinates.  
              - name: latitude | type: number | description: Address latitude.  
              - name: longitude | type: number | description: Address longitude.  
        - name: billingAddress | type: Address | description: Billing address. Used for calculating tax if all the items in the cart are not shippable.  
        - name: selectedShippingOption | type: SelectedShippingOption | description: Selected shipping option.  Pass this field only when there is no existing shipping option in the cart.  
           - name: carrierId | type: string | description: Carrier GUID.  | validation: format GUID
           - name: code | type: string | description: Selected shipping option code. For example, "usps_std_overnight".  | validation: minLength 1, maxLength 100
        - name: email | type: string | description: Required when setting billing or shipping address and user is not logged in.  | validation: format EMAIL
 Return type: PROMISE<CreateCheckoutResponse>
  - name: checkoutId | type: string | description: The newly created checkout's GUID.  


```

### Examples

### Create a checkout from the current cart
```javascript
/**************************************
 * Backend code - my-backend-file.web.js/ts *
 *************************************/

import { Permissions, webMethod } from '@wix/web-methods';
import { currentCart } from '@wix/ecom';

export const myCreateCheckoutFromCurrentCartFunction = webMethod(Permissions.Anyone, async (options) => {
  try {
    const checkoutId = await currentCart.createCheckoutFromCurrentCart(options);
    console.log('Success! Checkout created, checkoutId:', checkoutId);
    return checkoutId;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
});

/*************
 * Page code *
 ************/

import { myCreateCheckoutFromCurrentCartFunction } from 'backend/my-backend-file.web';

// Sample options object:
const options = {
  // channelType is a required field
  "channelType": "WEB",
  "email": "janedoe@example.com",
  "shippingAddress": {
    "addressLine1": "235 West 23rd Street",
    "addressLine2": "3rd floor",
    "city": "New York",
    "country": "US",
    "postalCode": "10011",
    "streetAddress": {
      "name": "West 23rd Street",
      "number": "235"
    },
    "subdivision": "US-NY"
  }
};

myCreateCheckoutFromCurrentCartFunction(options)
  .then((checkoutId) => {
    console.log('Success! Checkout created, checkoutId:', checkoutId);
    return checkoutId;
  })
  .catch((error) => {
    console.error(error);
    // Handle the error
  });

/* Promise resolves to:
 *
 * {"checkoutId": "a43420aa-986b-456a-a2f7-7ea5c80e9007"}
 *
 */
```

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

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


async function createCheckoutFromCurrentCart(options) {
  const response = await myWixClient.currentCart.createCheckoutFromCurrentCart(options);
};
```

---