order Edit Add Custom Item
Requires access scope. Also: To use the GraphQL Admin API to edit orders, your app needs to request the access scope for a Shopify store.
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 the mutation.
Learn more about adding custom line items.
Arguments
- id (ID!)
- locationId (ID)
- price (MoneyInput!)
- quantity (Int!)
- requiresShipping (Boolean)
- taxable (Boolean)
- title (String!)
- •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 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 requiresShippingrequires•Boolean
Shipping Whether the custom item requires shipping. Defaults to
false.- Anchor to taxabletaxable•Boolean
Whether the custom item is taxable. Defaults to
true.- Anchor to titletitle•String!required
The name of the custom item to add.
- calculatedLineItem (CalculatedLineItem)
- calculatedOrder (CalculatedOrder)
- orderEditSession (OrderEditSession)
- userErrors ([UserError!]!)
- Anchor to calculatedLineItemcalculated•Calculated
Line Item Line Item The custom line item that will be added to the order based on the current edits.
- Anchor to calculatedOrdercalculated•Calculated
Order Order An order with the edits applied but not saved.
- Anchor to orderEditSessionorder•Order
Edit Session Edit Session The order edit session with the edits applied but not saved.
- Anchor to userErrorsuser•[User
Errors Error!]! non-null The list of errors that occurred from executing the mutation.