Line Items Mutations

CreateLineItem

Create a line item

Parameters

input - LineItemInput
Data of the line item
mutation CreateLineItem($input: LineItemInput!) {
  CreateLineItem(input: $input) {
    id
    location { id label }
    variant { id label }
    quantity
    price
    drop_shipping
    parent_id
    weight
    description
    kit_line_item_id
    type
    customer_id
  }
}
{
  "input": {
    "location_id": "100001",
    "variant_id": "100002",
    "quantity": 5.0,
    "price": 25.50,
    "drop_shipping": 0,
    "weight": 500,
    "description": "Product line item",
    "type": "normal",
    "customer_id": 100003
  }
}
{
  "data": {
    "CreateLineItem": {
      "id": 100004,
      "location": { "id": 100001, "label": "Main Warehouse" },
      "variant": { "id": 100002, "label": "Product Variant" },
      "quantity": 5.0,
      "price": 25.50,
      "drop_shipping": 0,
      "weight": 500,
      "description": "Product line item",
      "kit_line_item_id": null,
      "type": "normal",
      "customer_id": 100003
    }
  }
}

UpdateLineItem

Update a line item

Parameters

id - ID
Id of the line item
input - LineItemInput
Data of the line item
mutation UpdateLineItem($id: ID!, $input: LineItemInput!) {
  UpdateLineItem(id: $id, input: $input) {
    id
    location { id label }
    variant { id label }
    quantity
    price
    drop_shipping
    parent_id
    weight
    description
    kit_line_item_id
    type
    customer_id
  }
}
{
  "id": 100004,
  "input": {
    "quantity": 10.0,
    "price": 30.00,
    "description": "Updated product line item"
  }
}
{
  "data": {
    "UpdateLineItem": {
      "id": 100004,
      "location": { "id": 100001, "label": "Main Warehouse" },
      "variant": { "id": 100002, "label": "Product Variant" },
      "quantity": 10.0,
      "price": 30.00,
      "drop_shipping": 0,
      "weight": 500,
      "description": "Updated product line item",
      "kit_line_item_id": null,
      "type": "normal",
      "customer_id": 100003
    }
  }
}

DeleteLineItem

Delete a line item

Parameters

id - ID
Id of the line item
mutation DeleteLineItem($id: ID!) {
  DeleteLineItem(id: $id)
}
{
  "id": 100004
}
{
  "data": { "DeleteLineItem": true }
}

LineItemInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
temporary_id - ID
Temporary ID for kits and packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
apply_discount_rules - Boolean
Whether to apply discount rules to this line item.
replace_label - Boolean
Replace label flag
discount_type - DiscountType
Type of discount
discount - Float
Discount amount
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount

LineItemCreditNoteInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
calculate_price_from_components - Boolean
Calculate price from components
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
replace_label - Boolean
Replace label flag
temporary_id - ID
Temporary ID for kits and packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
discount - Float
Discount amount
discount_type - DiscountType
Type of discount
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount
ecotax - Float
Eco-tax amount
total - Float
Total amount
tax_codes - [TaxCodeInput]
Tax codes for the line item
location - LocationInput
Location data

LineItemEstimateInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
calculate_price_from_components - Boolean
Calculate price from components
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
replace_label - Boolean
Replace label flag
discount_type - DiscountType
Type of discount
discount - Float
Discount amount
tax_amount - Float
Tax amount
ecotax - Float
Eco-tax amount
tax_codes - [TaxCodeInput]
Tax codes for the line item
temporary_id - ID
Temporary ID for kits and packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount

LineItemPurchaseInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
temporary_id - ID
Temporary ID for kits and packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
replace_label - Boolean
Replace label flag
calculate_price_from_components - Boolean
Calculate price from components
discount_type - DiscountType
Type of discount
discount - Float
Discount amount
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount
apply_discount_rules - Boolean
Whether to apply discount rules to this line item.
tax_amount - Float
Tax amount
ecotax - Float
Eco-tax amount
tax_codes - [TaxCodeInput]
Tax codes for the line item

LineItemPurchaseReceiptInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
bin_location - String
Bin location identifier
temporary_id - ID
Temporary ID for kits and packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
replace_label - Boolean
Replace label flag
calculate_price_from_components - Boolean
Calculate price from components
discount_type - DiscountType
Type of discount
discount - Float
Discount amount
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount
apply_discount_rules - Boolean
Whether to apply discount rules to this line item.
tax_amount - Float
Tax amount
ecotax - Float
Eco-tax amount
tax_codes - [TaxCodeInput]
Tax codes for the line item
customer - CustomerInput
Customer data

LineItemProductReturnInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
temporary_id - ID
Temporary ID for kits & packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data

LineItemOrderInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
temporary_id - ID
Temporary ID for kits & packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
replace_label - Boolean
Replace label flag
calculate_price_from_components - Boolean
Calculate price from components
discount_type - DiscountType
Type of discount
discount - Float
Discount amount
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount
apply_discount_rules - Boolean
Whether to apply discount rules to this line item.
tax_amount - Float
Tax amount
ecotax - Float
Eco-tax amount
tax_codes - [TaxCodeInput]
Tax codes for the line item

LineItemInvoiceInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
calculate_price_from_components - Boolean
Calculate price from components
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
replace_label - Boolean
Replace label flag
temporary_id - ID
Temporary ID for kits & packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
discount_type - DiscountType
Type of discount
discount - Float
Discount amount
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount
tax_amount - Float
Tax amount
ecotax - Float
Eco-tax amount
tax_codes - [TaxCodeInput]
Tax codes for the line item

LineItemShippingOrderInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
temporary_id - ID
Temporary ID for kits & packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
calculate_price_from_components - Boolean
Calculate price from components
discount_type - DiscountType
Type of discount
discount - Float
Discount amount
tax_amount - Float
Tax amount
ecotax - Float
Eco-tax amount
tax_codes - [TaxCodeInput]
Tax codes for the line item
billed_quantity - Float
Billed quantity
unbilled_quantity - Float
Unbilled quantity
paid_quantity - Float
Paid quantity
unpaid_quantity - Float
Unpaid quantity

LineItemStockAdjustmentInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
drop_shipping - Int
Drop shipping flag (0 or 1)
weight - Int
Weight of the line item
description - String
Description of the line item
parent_id - Int
Parent line item ID
kit_line_item_id - ID
Kit line item ID
temporary_id - ID
Temporary ID for kits & packaging
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
replace_label - Boolean
Replace label flag

LineItemRefundInput data type

id - ID
Identifier (optional)
location_id - String
Location identifier
location - LocationInput
Location data (when using @belongsTo)
variant_id - String
Variant identifier
variant - VariantInput
Variant data
quantity - Float
Quantity of the line item
price - Float
Price of the line item
calculate_price_from_components - Boolean
Calculate price from components
drop_shipping - Int
Drop shipping flag (0 or 1)
parent_id - Int
Parent line item ID
weight - Int
Weight of the line item
description - String
Description of the line item
replace_label - Boolean
Replace label flag
temporary_id - ID
Temporary ID for kits & packaging
kit_line_item_id - ID
Kit line item ID
type - LineItemType
Line item type. Default: normal.
batch_numbers - [BatchNumberLineItemInput]
Batch numbers for the line item
serial_numbers - [SerialNumberLineItemInput]
Serial numbers for the line item
serial_number_text - String
Raw serial number text (alternative to structured input)
customer - CustomerInput
Customer data
discount - Float
Discount amount
discount_type - DiscountType
Type of discount
discount_rule_id - ID
Discount rule ID
discount_rule_amount - Float
Discount rule amount
ecotax - Float
Eco-tax amount
total - Float
Total amount
tax_codes - [TaxCodeInput]
Tax codes for the line item
location - LocationInput
Location data

LineItemsFilter data type

column - String
Column name to filter on
operator - String
Filter operator (e.g. EQ, GT, LIKE)
value - Mixed
Filter value

Enums

LineItemType

ValueDescription
normalStandard product line item (default).
kitKit/bundle line item.
custom_productCustom product (variant_id = -1).
depositDeposit line item.
shipping_costShipping cost line item.
global_discountGlobal discount line item.
packagingPackaging line item.

DiscountType

ValueDescription
amountFixed discount amount.
percentagePercentage-based discount.