younifyd
Menu

Storefront: Create Cart

Create a new shopping cart in BigCommerce Storefront via GraphQL — the mutation is editable, so you decide exactly what comes back

Use it in a workflow

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the Storefront: Create Cart action (under bigcommerce).
  3. Fill in the fields below, then reference the result from later steps as {{storefrontCreateCart.response.data}}.

Fields

querystring

Editable GraphQL mutation sent to the Storefront API.

Default "mutation BCCreateCart($input: CreateCartInput!) {\n cart {\n createCart(input: $input) {\n cart {\n entityId\n lineItems {\n physicalItems {\n entityId name quantity\n imageUrl\n originalPrice { value currencyCode }\n extendedSalePrice { value currencyCode }\n selectedOptions { name value }\n }\n digitalItems { entityId name quantity originalPrice { value currencyCode } }\n }\n amount { value currencyCode }\n discountedAmount { value currencyCode }\n discounts { entityId discountedAmount { value currencyCode } }\n }\n errors {\n ... on CartItemProductNotFoundError { message }\n ... on CartItemVariantNotFoundError { message }\n }\n }\n }\n}"

variablesstring

JSON object of mutation variables — set input.lineItems, input.currencyCode, input.locale.

Default "{\n \"input\": {\n \"lineItems\": [\n { \"quantity\": 1, \"productEntityId\": 123, \"variantEntityId\": 456 }\n ],\n \"currencyCode\": \"USD\",\n \"locale\": \"en\"\n }\n}"

fullResponseboolean

Return BigCommerce's whole { data, errors } body and status unchanged — for passing a response straight back to a GraphQL client. When off, data is unwrapped (read fields at response.data.<field>) and GraphQL errors fail the step.

Default false

forwardAllHeadersboolean

If enabled, all headers from the incoming request will be forwarded to BigCommerce. Headers below override forwarded ones.

Default false

headerskeyvalue

HTTP headers to include in the request to BigCommerce

Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.

Storefront: Create Cart — BigCommerce Storefront — Documentation