---
schema_version: "1"
id: 2b378ad7f58d7bfe36820d51fcbd8453822b83fe343ff9240218e9b87498c23a
title: Apply Adjustment
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-apply-adjustment.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-apply-adjustment.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c60ccf0c9fe6333b5c8db6f84f5b30e6527da0d113ea225d9e2f5d177b431b10
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.

The <!-- broken link-->PricingElementServiceImplementation supports this API.


```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
```

## 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/{ID}/pricing` |


## 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.
