> 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.

# CreateCheckout

# Package: purchaseFlow

# Namespace: CartService

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

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

## Introduction

Creates a checkout from a cart.

If a checkout for the specified cart already exists, that checkout is
updated with any new information from the cart.

> **Note:** `channelType` is a required field.

---

## REST API

### Schema

```
 Method: createCheckout
 Description: Creates a checkout from a cart.  If a checkout for the specified cart already exists, that checkout is updated with any new information from the cart.  > **Note:** `channelType` is a required field.
 URL: https://www.wixapis.com/ecom/v1/carts/{id}/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 a billing or shipping address if the site visitor isn't 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.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CUSTOM_LINE_ITEM_MUST_HAVE_EXACTLY_ONE_PROPERTIES_TYPE | Description: Custom line item must have exactly 1 properties type.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CUSTOM_LINE_ITEM_ONLY_ACCEPTS_PAYMENTS_ONLINE_AND_OFFLINE | Description: Custom line items only accept online and offline payment options.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_MUST_ACCEPT_PAYMENTS_TO_CREATE_CHECKOUT | Description: Site must accept payments to create a checkout.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: LINE_ITEM_WITH_ZERO_QUANTITY | Description: Line item `quantity` must be at least 1.


```

### Examples

### Create a checkout from a cart
```curl
curl -X POST \
 'https://www.wixapis.com/ecom/v1/carts/f97a2939-b1f3-41f2-9fc5-7ecea2060991/create-checkout' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
    "channelType": "EBAY"
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.cart.createCheckout(_id, options)
 Description: Creates a checkout from a cart.  If a checkout for the specified cart already exists, that checkout is updated with any new information from the cart.  > **Note:** `channelType` is a required field.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  _id
 Method parameters: 
   param name: _id | type: string | description: Cart GUID. | required: true | validation: format GUID
   param name: options | type: CreateCheckoutOptions  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 a billing or shipping address if the site visitor isn't logged in.  | validation: format EMAIL
 Return type: PROMISE<CreateCheckoutResponse>
  - name: checkoutId | type: string | description: The newly created checkout's GUID.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CUSTOM_LINE_ITEM_MUST_HAVE_EXACTLY_ONE_PROPERTIES_TYPE | Description: Custom line item must have exactly 1 properties type.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CUSTOM_LINE_ITEM_ONLY_ACCEPTS_PAYMENTS_ONLINE_AND_OFFLINE | Description: Custom line items only accept online and offline payment options.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_MUST_ACCEPT_PAYMENTS_TO_CREATE_CHECKOUT | Description: Site must accept payments to create a checkout.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: LINE_ITEM_WITH_ZERO_QUANTITY | Description: Line item `quantity` must be at least 1.


```

### Examples

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

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

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

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

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

// Sample cartId:
const cartId = '96a61a4b-6b61-47d1-a039-0213a8230ccd';

// 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"
  }
};

myCreateCheckoutFunction(cartId, 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"}
 *
 */
```

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

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


async function createCheckout(_id,options) {
  const response = await myWixClient.cart.createCheckout(_id,options);
};
```

---