---
schema_version: "1"
id: 53177fd88009ffc553cf5c8a6abaf5ed978c97d23a2385a6a9f01b9f62c93f9f
title: Checkout Items in a Cart
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/standard_cart/std_comms-checkout-items-in-cart.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/std_comms-checkout-items-in-cart.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ae6ee0c0125d7cd1c13ae5f28a1584d9a7f3a32ac47af010e221a8eae24c521d
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Checkout Items in a Cart

## Overview

The Checkout API finalizes a CPQ cart by performing all mandatory validations, pricing recalculations, asset‑generation steps and transaction commits required to create a ready‑to‑bill Order. <br>
It is the logical culmination of the add → configure → price → validate → checkout pattern common to digital‑commerce and assisted‑selling flows.

Based on the header object, submit the object to create the quote, order, or assets.

- If the header object is Opportunity, submit the opportunity to create a quote.

- If the header object is Quote, submit the quote to create an order.

- If the header object is Order, submit the order to create assets.

These APIs replace the following methods in [OmniCPQServiceWrapper](https://developer.salesforce.com/docs/industries/cme/comms-cpq-apis-to-replace-omnicpqservicewrapper.md):

- Submit Opportunity replaces OmniCPQServceWrapper `submitOpportunity`.

- Submit Order replaces OmniCPQServiceWrapper `submitOrder`.

- Submit Quote replaces OmniCPQServiceWrapper `submitQuote`.

## Odin Bifurcation

The call path depends on the OdinAPIHandler interface chosen at runtime:

- OdinAPIAutoAssetizeHandler – routes directly to Java core classes (CheckoutAction, CheckoutServiceImpl) for high‑volume assetisation use‑cases.
- Any other implementation – executes entirely in Apex inside the managed package, allowing org‑specific extensions before/after core logic.

```
POST /v2/cpq/carts/{cart_Id}/items/checkout
```

For more information, see [OmniCPQServiceWrapper](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_omnicpqservicewrapper_661885.htm). <!-- Update when the Dev Docs topics migrate.-->

This API supports the guest user enhancements that Salesforce introduced with the Winter ‘21 release. To encrypt and decrypt data for guest users, use the `UserSecurity` class with this API. See Guest User Technical Details.

For additional information, ​see UserSecurity Class and CPQ and Digital Commerce Changes for Guest Users.


## Rest Handler

```
APICheckoutItemsCartsCPQV2
```

## Rest Method

```
checkoutItems
```

## Remote Service

```
CpqAppHandler
```

## Remote Method

```
checkout
```

## Apex Remote Input Map

```
Map<String, Object> inputMap = new Map<String, Object>{
    'cartId' => '{CART_ID}'
};
Map<String, Object> outputMap = new Map<String, Object>();
Map<String, Object> optionsMap = new Map<String, Object>();
CpqAppHandler handler = new CpqAppHandler();
handler.invokeMethod('checkout', inputMap, outputMap, optionsMap);
```

ContextId is required for the Checkout Items in Cart remote action, which is used in the [Guided Selling OmniScript](https://help.salesforce.com/s/articleView?id=ind.comms_guided_selling_omniscript_using_cpq_apis.htm).

## Package

Communication (vlocity_cmt)

## API Parameters and Response Format

For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary).


## Resource Information

| Response Format | JSON                                                                   |
| --------------- | ---------------------------------------------------------------------- |
| Resource URL    | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_Id}/items/checkout` |

## Example Request

```
POST
/v2/cpq/carts/{cart_Id}/items/checkout

{
   "validate": true,
   "assetizeFullBundlePerRoot": false,
   "validateSubmittedXLI": false
}
```

## Example Responses

```
{
  "totalSize": 1,
  "messages": [
    {
      "code": "SUBMIT-1008",
      "severity": "INFO",
      "message": "Order 801xx000003H0JTAA0 was assetized and activated."
    }
  ],
  "records": [
    {
      "messages": [

      ],
      "displaySequence": -1,
      "clonedObjectIds": "["02ixx0000004N2AAAU"]",
      "id": "001xx000003H0HrAAK",
      "objectType": "Account"
    }
  ]
}
```

**note:** 'objectType' conveys the type of the object that was created by the Checkout process.<br>
For Eg: If Checkout is performed from an Opportunity, the objectType will be Quote.
