---
schema_version: "1"
id: 22d92a8f2e79f8b2d38a7ff315f7bb283401b2778c7d500939c73551cff21620
title: Run Pricing for Items to Cart
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-run-pricing-for-items-to-cart.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-run-pricing-for-items-to-cart.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 17b890206b496cf92329ca780991e60bd1f5a687930fb65ed1f7e9332c1a524e
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Run Pricing for Items to Cart

Return the pricing information for each line item by invoking pricing rules. If line items are specified, they are priced. If line items are not specified, all of the items in the cart are priced.

```nolang
POST /v2/cpq/carts/{cart_ID}/price
```

**note:** If the value for `pagesize` parameter is not provided, it defaults to 20. To fetch or price more than 20 items, specify `pagesize` explicitly.

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.


## Remote Method

```nolang
priceCart
```

## REST Handler

```nolang
APIPriceCartsCpqV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```


## Apex Remote Input Map

Where `items` specifies the associated line item IDs.

```nolang
{
  "methodName": "priceCart",
  "cartId": "801360000008eNU",
  "items": ["80279000000Y5C9AAK", "80279000000Y5CAAA0"]
}
```

## 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}/price` |


## Example Request

```nolang
POST
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/price
```

## Example Response

```nolang
{
   "totalSize": 1,
   "messages": [],
   "records": [{
      "messages": [],
      "displaySequence": -1,
      "details": {
         "totalSize": 1,
         "messages": [],
         "records": [{
            "messages": [],
            "actions": {
               "checkout": {
                  "rest": {
                     "params": {},
                     "method": "POST",
                     "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/checkout"
                  },
                  "remote": {
                     "params": {
                        "cartId": "80141000000Cg8HAAS",
                        "methodName": "checkout"
                     }
                  },
                  "client": {
                     "params": {}
                  }
               }
            },
            "displaySequence": -1,
            "Id": "80141000000Cg8HAAS",
            "Status": "Draft",
            "OrderNumber": "00000965",
            "Account.Name": "Telco test",
            "EffectiveRecurringTotal__c": 0.00,
            "EffectiveOneTimeTotal__c": 5.00,
            "EffectiveOrderTotal__c": 5.00,
            "ObjectType": "Order"
         }]
      },
      "sites": {
         "totalSize": 0,
         "messages": [{
         "severity": "ERROR",
         "messageId": null,
         "message": "No Results Found.",
         "code": "101",
         "actions": {}
      }],
      "actions": {
         "newsite": {
            "rest": {
               "params": {},
               "method": "POST",
               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/sites"
            },
            "remote": {
               "params": {
                  "type": "Service",
                  "methodName": "newSite"
               }
            },
            "client": {
               "params": {}
            }
         }
      }
   }
   }]
}
```
