---
schema_version: "1"
id: e2454046b446df2f6aa1c59e210b5bfe78aa458d86946f8f363aab74865af735
title: Apply Adjustment
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/standard_cart/std_comms-apply-adjustment.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/std_comms-apply-adjustment.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 539aaf8e5de7a7cee30e682f9ab01ed02a705a628d061dd7969714515d59ef10
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Apply Adjustment

Apply an adjustment (such as a discount, markup, or override) to a price for a cart and line item, which are specified by the cartId and id parameters.

```nolang
POST /v2/cpq/carts/{cart_ID}/items/{ID}/pricing
```

The caller can add the new `skipCartRefresh` parameter to the applyAdjustments API call. If `skipCartRefresh` is set to True, the `getCartsItems` API will not be triggered. If it is omitted or set to False, getCartsItems will be triggered.
The getCartsItems API runs pricing on the cart after adjustments are applied. Skipping this call significantly improves API performance.

To execute pricing after applyAdjustments, you can either call getCartLineItemPrices (available under the actions node in the response) or invoke getCartsItems separately.

## Remote Method

```nolang
applyAdjustment
```

## Example Request

```nolang
POST /services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items/{itemId}/pricing
{
  "adjustments": [
    {
      "DetailType": "ADJUSTMENT",
      "Field": "vlocity_cmt__OneTimeCharge__c",
      "PricingVariableCode": "OT_STD_PRC",
      "AdjustmentType": "Adjustment",
      "AdjustmentMethod": "Percent",
      "AdjustmentValue": -50
    }
  ],
  "skipCartRefresh": true
}
```

## Example Result

```nolang
{
   "totalSize": 1,
   "messages": [],
   "records": [
      {
         "messages": [],
         "actions": {
            "addtocart": {
               "rest": {
                  "params": {
                     "items": [
                        {
                        "quantity": 1,
                        "parentId": "80246000000hhNzAAI",
                        "itemId": "01u46000001Z8aCAAS"
                     }
                  ],
                  "cartId": "80146000000h5jmAAA",
                  "price": true,
                  "validate": true,
                  "includeAttachment": false,
                  "pagesize": 20,
                  "lastRecordId": null,
                  "query": null
               },
               "method": "POST",
               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items"
            },
            "remote": {
               "params": {
                  "methodName": "postCartsItems",
                  "items": [
                     {
                        "quantity": 1,
                        "parentId": "80246000000hhNzAAI",
                        "itemId": "01u46000001Z8aCAAS"
                     }
                  ],
                  "cartId": "80146000000h5jmAAA",
                  "price": true,
                  "validate": true,
                  "includeAttachment": false,
                  "pagesize": 20,
                  "lastRecordId": null,
                  "query": null
               }
            },
            "client": {
               "params": {}
            }
         },
         "updateitems": {
            "rest": {
               "params": {
                  "items": [
                     {
                        "itemId": "80246000000hhNzAAI"
                     }
                  ],
                  "filters": null,
                  "fields": null,
                  "cartId": "80146000000h5jmAAA",
                  "price": true,
                  "validate": true,
                  "includeAttachment": false,
                  "pagesize": 20,
                  "lastRecordId": null,
                  "query": null
               },
               "method": "PUT",
               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items"
            },
            "remote": {
               "params": {
                  "methodName": "putCartsItems",
                  "items": [
                     {
                        "itemId": "80246000000hhNzAAI"
                     }
                  ],
                  "filters": null,
                  "fields": null,
                  "cartId": "80146000000h5jmAAA",
                  "price": true,
                  "validate": true,
                  "includeAttachment": false,
                  "pagesize": 20,
                  "lastRecordId": null,
                  "query": null
               }
            },
            "client": {
               "params": {}
            }
         },
         "deleteitem": {
            "rest": {
               "params": {},
               "method": "DELETE",
               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI?pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI"
            },
            "remote": {
               "params": {
                  "methodName": "deleteCartsItems",
                  "id": "80246000000hhNzAAI",
                  "filters": null,
                  "fields": null,
                  "cartId": "80146000000h5jmAAA",
                  "price": true,
                  "validate": true,
                  "includeAttachment": false,
                  "pagesize": 20,
                  "lastRecordId": null,
                  "query": null
               }
            },
            "client": {
               "params": {}
            }
         },
         "cloneitem": {
            "rest": {
               "params": {
                  "items": [
                     {
                        "itemId": "80246000000hhNzAAI"
                     }
                  ],
                  "id": "80246000000hhNzAAI",
                  "cartId": "80146000000h5jmAAA"
               },
               "method": "POST",
               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone"
            },
            "remote": {
               "params": {
                  "methodName": "cloneItems",
                     "items": [
                        {
                           "itemId": "80246000000hhNzAAI"
                        }
                     ],
                     "id": "80246000000hhNzAAI",
                     "cartId": "80146000000h5jmAAA"
                  }
               },
               "client": {
                  "params": {}
                     }
               },
```

**note:** An entire result can be thousands of lines long. This example has been truncated.

## API Troubleshooting

Use the table in this topic to diagnose problems that occur when executing the the API.

| Error Message                                | Description                                                                             |
| -------------------------------------------- | --------------------------------------------------------------------------------------- |
| A virtual price cannot be adjusted.          | This error message is displayed if you try to adjust a base price of a virtual product. |
| Cannot apply adjustment without base charge. | This error message is displayed:<ul>                                                    |

     <li>If you try to adjust the base price of a product that hasn't been initialized. For example, If you haven't assigned a Recurring Charge Price List Entry to a product, and you try to apply an adjustment to the RecurringCharge, the API returns the error message.

</li>
  
     <li>If you try to adjust a calculated price, the API returns the error message.

Calculated prices are derived from other base prices. For example, the UnitPrice of a product is calculated based on the base price of the product and the quantity of the product.If you want to adjust base prices that haven't been initialized, you can set the `CheckVariableBasePrice` CPQ Custom Setting to `False`. This setting allows you to make adjustments to the base prices, but it can lead to unexpected results.</li>

  </ul>|

**note:** Adjustments can be made without a PriceListEntryID.
