Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jun 11, 2024
1 parent 91a1354 commit 2273e75
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
22 changes: 22 additions & 0 deletions api-specs/api/examples/Cart/MyCartAddLineItemAction.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
}
3 changes: 1 addition & 2 deletions api-specs/api/types/me/updates/MyCartAddLineItemAction.raml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2273e75

Please sign in to comment.