diff --git a/api-specs/api/examples/Cart/MyCartAddLineItemAction.json b/api-specs/api/examples/Cart/MyCartAddLineItemAction.json new file mode 100644 index 000000000..ab36dd130 --- /dev/null +++ b/api-specs/api/examples/Cart/MyCartAddLineItemAction.json @@ -0,0 +1,22 @@ +{ + "action": "addLineItem", + "productId": "{{product-id}}", + "variantId": 2, + "quantity": 1, + "supplyChannel": { + "typeId": "channel", + "id": "{{channel-id}}" + }, + "distributionChannel": { + "typeId": "channel", + "id": "{{channel-id}}" + }, + "shippingDetails": { + "targets": [ + { + "addressKey": "AddressKeyStringFromAddress", + "quantity": 2 + } + ] + } +} diff --git a/api-specs/api/types/me/updates/MyCartAddLineItemAction.raml b/api-specs/api/types/me/updates/MyCartAddLineItemAction.raml index f56965555..629950030 100644 --- a/api-specs/api/types/me/updates/MyCartAddLineItemAction.raml +++ b/api-specs/api/types/me/updates/MyCartAddLineItemAction.raml @@ -3,11 +3,10 @@ type: MyCartUpdateAction displayName: MyCartAddLineItemAction discriminatorValue: addLineItem -example: !include ../../../examples/Cart/CartAddLineItemAction.json +example: !include ../../../examples/Cart/MyCartAddLineItemAction.json description: | If the Cart contains a [LineItem](ctp:api:type:LineItem) for a Product Variant with the same [LineItemMode](ctp:api:type:LineItemMode), [Custom Fields](/../api/projects/custom-fields), supply and distribution channel, then only the quantity of the existing Line Item is increased. If [LineItem](ctp:api:type:LineItem) `shippingDetails` is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up. - A new Line Item is added when the `externalPrice` or `externalTotalPrice` is set in this update action. The [LineItem](ctp:api:type:LineItem) price is set as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). If the Tax Rate is not set, a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned.