Delete Applied Promo Items

Delete applied promotion items from cart.

DELETE /v2/cpq/carts/{cart_ID}/promotions

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. For additional information, ​see UserSecurity Class and CPQ and Digital Commerce Changes for Guest Users.

NOTE:

  • This API runs eligibility check against all promotions added to the cart during the deletion of a selected promotion.
  • When the applied promotion is Cancelled/Disconnected before the expiration date, ensure to parallely maintain the following fields.
    • vlocity_cmt__CommitmentEndDate__c for Order Applied Promotion with end-dated
    • vlocity_cmt__EstimatedEndDate__c for Order Pricing with end-dated

Remote Method

deletePromotionItems

REST Handler

APIPromotionsCartsCpqV2

Apex Remote Service

CpqAppHandler

Apex Remote Input Map

{
 "id": "a2Lf40000008nL5EAI",
 "cartId": "801f40000012NEIAA2",
 "methodName": "deleteAppliedPromoItems",
 "price": true,
 "validate": true
}

Package

Communication (vlocity_cmt)

API Parameters and Response Format

For API parameter names and descriptions, see Cart-Based API Swagger Reference.

Resource Information

Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions

Example Request

DELETE
/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000012NEIAA2/promotions

Request Body:
{
 "id": "a2Lf40000008nL5EAI",
 "cartId": "801f40000012NEIAA2",
 "methodName": "deleteAppliedPromoItems",
 "price": true,
 "validate": true
}

Example Response

{
  "totalSize": 0,
  "messages": [
    {
      "severity": "INFO",
      "messageId": null,
      "message": "Successfully deleted.",
      "code": "152",
      "bundleId": null,
      "actions": {}
    }
  ],
  "actions": {
    "itemdeleted": {
      "rest": {
        "params": {},
        "method": null,
        "link": null
      },
      "remote": {
        "params": {}
      },
      "client": {
        "params": {
          "items": [
            {
              "message": "add TestProd-12 bundle has been deleted from the cart.",
              "Id": "a2Lf40000008nL5EAI"
            }
          ]
        }
      }
    }
  }
}

Add with noResponseNeeded=true

{
  "totalSize": 0,
  "messages": [
    {
      "code": "150",
      "severity": "INFO",
      "message": "Successfully added."
    }
  ],
  "actions": {
    "itempricesupdated": {
      "rest": {
        "params": {},
        "method": "GET",
        "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H4WlAAK/price?price=false&cartId=801xx000003H4WlAAK"
      },
      "remote": { "params": {} },
      "client": { "params": {} }
    }
  }
}