data-src=../../../includes/saas-only.md
Cart item custom price
The cart item custom price capability lets admins and integrations override the catalog price of an item in Adobe Commerce as a Cloud Service by using the custom_price extension attribute with the add and update cart item REST endpoints.
These endpoints are designed for:
- Integrations that set prices calculated outside of Commerce
- Admin workflows, such as editing an order, that change the price of a cart line
Authentication
All requests that include custom_price require an admin or integration bearer token. Requests that include custom_price with a customer token are rejected. Guest cart endpoints are not available in Adobe Commerce as a Cloud Service.
Limitations
- Bundle products with dynamic pricing — Not supported, because the price is calculated from the prices of their child products. Bundle products with fixed pricing are supported.
- B2B negotiable quotes — Not supported. Use
PUT /V1/negotiableQuote/:quoteIdto set negotiated prices.
REST API reference
/V1/carts/:cartId/items/V1/carts/:cartId/items/:itemId/V1/carts/:cartId/itemscustom_price/V1/carts/:cartIdcustom_price on each itemField reference
The custom_price attribute is part of the extension_attributes object of the cartItem payload.
extension_attributes.custom_price0 adds the item for free.item_idAdd an item at a custom price
POST /V1/carts/:cartId/items adds a new item to the cart and applies the custom price to each unit.
Request body:
{
"cartItem": {
"sku": "t-shirt",
"qty": 1,
"quote_id": 17,
"extension_attributes": {
"custom_price": 15.00
}
}
}
Response (200):
Returns the cart item with the applied price in extension_attributes.custom_price.
Change the price of an existing cart item
PUT /V1/carts/:cartId/items/:itemId changes the price of a cart line. Use GET /V1/carts/:cartId/items to find the item_id of the line.
data-variant=info
data-slots=text
custom_price but without an item_id, the request is rejected and the existing cart line is left unchanged. To add units to an existing line at a new price, send its item_id with the new total quantity.Request body:
{
"cartItem": {
"item_id": 8,
"sku": "hat",
"qty": 1,
"quote_id": 17,
"extension_attributes": {
"custom_price": 5.00
}
}
}
Response (200):
Returns the cart item with the applied price in extension_attributes.custom_price.
Retrieve custom prices
GET /V1/carts/:cartId/items and GET /V1/carts/:cartId return the custom_price for each cart item.
Response (200):
Each cart item that has a custom price includes it in the extension_attributes object.
{
"item_id": 8,
"sku": "hat",
"qty": 1,
"extension_attributes": {
"custom_price": 5
}
}
Error handling
If a request fails for any reason, the cart is left exactly as it was before the request. A successful response always means that the custom price was applied.
Setting a custom price is not permitted for this account.custom_price must be a finite, non-negative number.custom_price is not supported for this product type.custom_price is not supported on a negotiable quote. Use the negotiable quote API to set negotiated prices.item_id is suppliedThis product is already on the cart. To change the price of that line, supply its item_id; ...The item could not be added with the requested custom price.Non-numeric custom_price values, such as "not-a-price", are rejected by REST type validation with a 400 response before the price check runs.