Alokai

createEmptyCart

Create an empty cart.

Signature

declare function createEmptyCart(
	context: Context,
	customHeaders?: CustomHeaders
): Promise<FetchResult<CreateEmptyCartMutation>>;

Parameters

NameRequiredTypeDescription
contextRequiredContext
customHeadersOptionalCustomHeaders

Referenced Types

Examples

Simple usage:

import { sdk } from '~/sdk.config.ts';

// create an empty cart
const cart = await sdk.magento.createEmptyCart();

// cart id can be accessed from the response
const cartId = cart.data.createEmptyCart;

On this page