Poq.SDK.Node

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

BasketsClient.postBasketsReference() method

Creates a new basket based on a basket reference. The returned basket will be a copy of the basket in the reference. The basket in the reference must be a basket of an anonymous customer and the provided customer_id in the reference must match the anonymous customer in the basket. There is a check that an authenticated customer for whom a basket is being copied doesnt already have a basket. In case customer_id not matching a BasketNotFoundException will be returned as fault. All personal data like payment instruments and coupons will not be copied over to the new basket. When authenticated via JWT, a customer can only have one open basket and a CustomerBasketsQuotaExceededException is thrown, when the customer tries to create a second basket. Before using this endpoint to create a basket for a JWT-authenticated customer, verify that they dont already have one.

Signature:

postBasketsReference(body: BasketReference, options?: RequestOptions): Promise<PoqResponse<Basket>>;

Parameters

Parameter Type Description
body BasketReference  
options RequestOptions (Optional) Override http request option.

Returns:

Promise<PoqResponse<Basket>>