You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
bindCart
Creates a bind between the provided customer ID and an anonymous cart.
This method sends a POST request to the bindCart endpoint of the Alokai Middleware. In turn, it exchanges data with the bindCart endpoint exposed by the SAP OCC API Customer Controller.
Signature
export declare function bindCart<Res extends string = string>(
props: BindCartProps,
options?: MethodOptions
): Promise<Res>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | BindCartProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions | Options that can be passed to additionally configure the request or customize the logic in a plugin. |
Returns
Returns array of customer suggestions
Referenced Types
BindCartProps- MethodOptions
Examples
Binding a customer ID to an anonymous cart
import { sdk } from '~/sdk';
await sdk.commerce.bindCart({ cartId: '123-123-123', customerId: 'john.doe@email.com'});