@plentymarkets/shop-api / doAddCartItemBySku
Function: doAddCartItemBySku() ​
Defined in: api/doAddCartItemBySku/index.ts:25
Method doAddCartItemBySku - Adds a product to the cart by its SKU.
Parameters ​
context ​
PlentysystemsIntegrationContext
params ​
Returns ​
Remarks ​
- Calls /rest/storefront/cart/items/
- The SKU is the variation number of the product. Only active variations that are visible for the client are found.
- Fails with a not found error if no variation has the SKU.
Example ​
ts
const { data } = await useSdk().plentysystems.doAddCartItemBySku({
sku: 'SKU-1100',
quantity: 1
});