From 3e7b1f833f6c09283fe8925d1be1fc46079842b8 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Tue, 27 Oct 2020 00:27:17 -0500 Subject: [PATCH] Add channel id when creating a cart --- lib/bigcommerce/api/cart/handlers/add-item.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/bigcommerce/api/cart/handlers/add-item.ts b/lib/bigcommerce/api/cart/handlers/add-item.ts index c37abeb63..25ae3880e 100644 --- a/lib/bigcommerce/api/cart/handlers/add-item.ts +++ b/lib/bigcommerce/api/cart/handlers/add-item.ts @@ -20,6 +20,9 @@ const addItem: CartHandlers['addItem'] = async ({ method: 'POST', body: JSON.stringify({ line_items: [parseCartItem(item)], + ...(!cartId && config.storeChannelId + ? { channel_id: config.storeChannelId } + : {}), }), } const { data } = cartId