Support

addLineItemBySkuId

View as Markdown

Adds a line item from catalog using the skuId

mutation

Requires one of commerce.order:create, commerce.order:update, commerce.order:cancel, or commerce.order:complete (use the scope that matches the operation).

Adds a line item from catalog using the skuId

The SKU must have at least one price. Unpriced SKUs fail with INTERNAL_SERVER_ERROR.

Required headers

HeaderRequiredDescription
x-store-idYesID of the store the operation targets. Omitting it returns HTTP 200 with a GraphQL error: extensions.code: "UNAUTHENTICATED".

Go to Authentication for credential setup.

Arguments

  • input AddLineItemInput! required
    • fulfillmentMode LineItemModeInput! required — Possible fulfillment modes for a line item
    • orderId ID! required — Global ID in format Order_\<KSUID\>
    • quantity Int! required
    • skuId String! required
    • status LineItemStatusInput! required — Possible fulfillment statuses for a line item
    • details AddLineItemDetailsInput optional
    • fulfillmentChannelId String optional
    • metafields [OrderMetafieldInput!] optional
    • name String optional
    • updateQuantity Boolean optional — Controls whether the new quantity should be used to replace (true) or sum with the existing line item quantity (false)

Possible returns

  • LineItem LineItem

Last updated on

How is this guide?