Calculated Line Item
Requires access scope.
A line item involved in order editing that may be newly added or have new changes applied.
Anchor to FieldsFields
- Anchor to calculatedDiscountAllocationscalculated•[Calculated
Discount Allocations Discount Allocation!]! non-null The discounts that have been allocated onto the line item by discount applications.
- Anchor to customAttributescustom•[Attribute!]!
Attributes non-null A list of attributes that represent custom features or special requests.
- Anchor to discountedUnitPriceSetdiscounted•Money
Unit Price Set Bag! non-null The price of a single quantity of the line item with line item discounts applied, in shop and presentment currencies. Discounts applied to the entire order aren't included in this price.
- Anchor to editableQuantityeditable•Int!
Quantity non-null The total number of items that can be edited.
- Anchor to editableQuantityBeforeChangeseditable•Int!
Quantity Before Changes non-null The editable quantity prior to any changes made in the current edit.
- Anchor to editableSubtotalSeteditable•Money
Subtotal Set Bag! non-null The total price of editable lines in shop and presentment currencies.
- Anchor to hasStagedLineItemDiscounthas•Boolean!
Staged Line Item Discount non-null Whether the calculated line item has a staged discount.
- •ID!non-null
A globally-unique ID.
- Anchor to imageimage•Image
The image object associated to the line item's variant.
- Anchor to originalUnitPriceSetoriginal•Money
Unit Price Set Bag! non-null The variant unit price in shop and presentment currencies, without any discounts applied.
- Anchor to quantityquantity•Int!non-null
The total number of items.
- Anchor to restockablerestockable•Boolean!non-null
Whether the line item can be restocked or not.
- Anchor to restockingrestocking•Boolean!non-null
Whether the changes on the line item will result in a restock.
- •String
The variant SKU number.
- Anchor to stagedChangesstaged•[Order
Changes Staged Change!]! non-null A list of changes that affect this line item.
- Anchor to titletitle•String!non-null
The title of the product.
- Anchor to uneditableSubtotalSetuneditable•Money
Subtotal Set Bag! non-null The total price of uneditable lines in shop and presentment currencies.
- Anchor to variantvariant•Product
Variant The product variant associated with this line item. The value is null for custom line items and items where the variant has been deleted.
- Anchor to variantTitlevariant•String
Title The title of the variant.
- Anchor to discountAllocationsdiscount•[Discount
Allocations Allocation!]! non-nullDeprecated
Anchor to MutationsMutations
- •mutation
Adds a custom line item to an existing
Order. Custom line items represent products or services not in your catalog, such as gift wrapping, installation fees, or one-off charges.Creates a
with the specified title, price, and quantity. Changes remain in the edit session until you commit them with themutation.Learn more about adding custom line items.
- •ID!required
The ID of the calculated order or the order edit session to edit. This is the edit to which the custom item is added.
- Anchor to titletitle•String!required
The name of the custom item to add.
- Anchor to locationIdlocation•ID
Id The ID of the retail location (if applicable) from which the custom item is sold. Used for tax calculations. A default location will be chosen automatically if none is provided.
- Anchor to priceprice•Money
Input! required The unit price of the custom item. This value can't be negative.
- Anchor to quantityquantity•Int!required
The quantity of the custom item. This value must be greater than zero.
- Anchor to taxabletaxable•Boolean
Whether the custom item is taxable. Defaults to
true.- Anchor to requiresShippingrequires•Boolean
Shipping Whether the custom item requires shipping. Defaults to
false.
Arguments
- •ID!
- •mutation
Applies a discount to a
during an order edit session. The discount can be either a fixed amount or percentage value.To modify pricing on specific line items, use this mutation after starting an order edit with the
mutation. The changes remain staged until you commit them with themutation.Learn more about editing existing orders.
- •ID!required
The ID of the calculated order or the order edit session to edit.
- Anchor to lineItemIdline•ID!
Item Id required The ID of the calculated line item to add the discount to.
- Anchor to discountdiscount•Order
Edit Applied Discount Input! required The discount to add to the line item.
Arguments
- •ID!
- •mutation
Adds a
as a line item to anOrderthat's being edited. The mutation respects the variant's contextual pricing.You can specify a
Locationto check for inventory availability and control whether duplicate variants are allowed. Thequantitymust be a positive value.Learn more about editing existing orders.
- •ID!required
The ID of the calculated order or the order edit session to edit.
- Anchor to variantIdvariant•ID!
Id required The ID of the variant to add.
- Anchor to locationIdlocation•ID
Id The ID of the location to check for inventory availability. A default location ID is chosen automatically if none is provided.
- Anchor to quantityquantity•Int!required
The quantity of the item to add to the order. Must be a positive value.
- Anchor to allowDuplicatesallow•Boolean
Duplicates Default:false Whether the mutation can create a line item for a variant that's already on the calculated order.
Arguments
- •ID!
- •mutation
Sets the quantity of a line item on an order that's being edited. Use this mutation to increase, decrease, or remove items by adjusting their quantities.
Setting the quantity to zero effectively removes the line item from the order. The item still exists as a data structure with zero quantity. When decreasing quantities, you can optionally restock the removed items to inventory by setting the
restockparameter totrue.Learn more about editing workflows for existing orders.
- •ID!required
The ID of the calculated order or the order edit session to edit. The edit changes the quantity on the line item.
- Anchor to lineItemIdline•ID!
Item Id required The ID of the calculated line item to edit.
- Anchor to quantityquantity•Int!required
The new quantity to set for the line item. This value cannot be negative.
- Anchor to restockrestock•Boolean
Whether or not to restock the line item when the updated quantity is less than the original quantity.
- Anchor to locationIdlocation•ID
Id Deprecated
Arguments
- •ID!
- •mutationDeprecated
- •ID!required
The ID of the calculated order or the order edit session to edit. This is the edit from which the line item discount is removed.
- Anchor to discountApplicationIddiscount•ID!
Application Id required The ID of the calculated discount application to remove.
Arguments
- •ID!