Poq.SDK.Node

Home > @poq/sdk-sfcc > BasketsClient > postBasketsByIDItems

BasketsClient.postBasketsByIDItems() method

Adds new items to a basket. The added items are associated with the specified shipment. If no shipment id is specified, the added items are associated with the default shipment. Considered values from the request body, for each item are: product_id: a valid product id. This is the id of the product to be added to the basket. If the product is already in the basket, the API either increments the quantity of the existing product line item or creates a new product line item, based on the site preference ‘Add Product Behavior. For option products and product bundles containing variation masters, the API creates a new product line item regardless of the site preference. shipment_id: a valid shipment id (optional). This is the id of the shipment in which the product item is created. quantity: a number between 0.01 and 999. This is the quantity of the product to order. inventory_id: a valid inventory id (optional). This is the id of the inventory from which the item is allocated. bonus_discount_line_item_id: a valid bonus discount line item id (optional). This is the id of the bonus discount line item for which the added product is a selected bonus product. option_items/option_value_id: a valid option value id. This is an option value for an option item of an option product. This is only possible if the product item is an option product. To set option values, you must specify a collection of option items in the option_items property. These option items must contain option_id and option_value_id. Also, the values you specify must be valid for the option product that this product item represents. Otherwise, the server throws an InvalidProductOptionItemException or an InvalidProductOptionValueItemException. custom properties in the form c_<CUSTOM_NAME>: the custom property must correspond to a custom attribute (<CUSTOM_NAME>) defined for ProductLineItem. The value of this property must be valid for the type of custom attribute defined for ProductLineItem.

Signature:

postBasketsByIDItems(basketId: string, body: Array<ProductItem>, options?: RequestOptions): Promise<PoqResponse<Basket>>;

Parameters

Parameter Type Description
basketId string The id of the basket to be modified.
body Array<ProductItem>  
options RequestOptions (Optional) Override http request option.

Returns:

Promise<PoqResponse<Basket>>