# updateLineItemById (https://developer.godaddy.com/en/docs/references/rest/orders/line-item/mutations/updateLineItemById)

***

title: updateLineItemById
description: "Updates a line item in a draft order"
full: true
----------

mutation

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

Updates a line item in a draft order

## Required headers

| Header       | Required | Description                                                                                                                     |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `x-store-id` | Yes      | ID of the store the operation targets. Omitting it returns HTTP 200 with a GraphQL error: `extensions.code: "UNAUTHENTICATED"`. |

Go to [Authentication](https://developer.godaddy.com/docs/api-users/auth) for credential setup.

## Arguments

* `input` `UpdateLineItemByIdInput!` **required**
  * `id` `ID!` **required** — Global ID in format `LineItem_\<KSUID\>`
  * `orderId` `ID!` **required** — Global ID in format `Order_\<KSUID\>`
  * `details` `LineItemInputDetailsInfo` **optional**
  * `discounts` `[DiscountInput!]` **optional**
  * `externalId` `String` **optional**
  * `fees` `[FeeInput!]` **optional**
  * `fulfillmentChannelId` `String` **optional**
  * `fulfillmentMode` `LineItemModeInput` **optional** — Possible fulfillment modes for a line item
  * `metafields` `[OrderMetafieldInput!]` **optional**
  * `name` `String` **optional**
  * `notes` `[NoteInput!]` **optional**
  * `productId` `String` **optional**
  * `quantity` `Float` **optional**
  * `serviceEndsAt` `DateTime` **optional**
  * `serviceStartAt` `DateTime` **optional**
  * `shipping` `LineItemInputShippingInfo` **optional**
  * `skuId` `String` **optional** — Deprecated: This field is going to be removed. Remove and add a LineItem again instead.
  * `tags` `[String!]` **optional**
  * `taxes` `[TaxInput!]` **optional**
  * `totals` `TotalsInput` **optional**
  * `type` `LineItemTypesInput` **optional** — Possible types for a line item
  * `unitAmount` `MoneyInput` **optional**

## Possible returns

* `LineItem` `LineItem`

- `createdAt` `DateTime` **nullable** — The datetime when the line item was created in our system
- `details` `LineItemDetails` **nullable**
- `discounts` `[Discount!]` **nullable** — Discounts for a line item
- `externalId` `String` **nullable** — Default value is undefined
- `fees` `[Fee!]` **nullable** — Fees for a line item
- `fulfilledAt` `DateTime` **nullable** — The datetime when the line item was fulfilled
- `fulfillmentChannelId` `String` **nullable** — ID for the channel where the fulfillment of this item will occur
- `fulfillmentMode` `LineItemMode` **nullable** — Possible fulfillment modes for a line item
- `id` `ID!` **non-null** — Unique identifier for the line item
- `metafields` `[OrderMetafield!]` **nullable** — Metafields that allow clients to store source data for a line item. For example, a `SERVICE` line item could add the booking details for the line item here
- `name` `String` **nullable** — Name of the line item used for display purposes to the merchant and customer
- `notes` `[Note!]` **nullable** — Notes for a line item
- `orderVersion` `String` **nullable**
- `productId` `String` **nullable** — Reference to a Product as defined by the Catalog (v1) service. Can be set to null.
- `quantity` `Float` **nullable** — Quantity purchased by the customer. Note this could be a float value (e.g. 2.3 Kgs)
- `returnedAt` `DateTime` **nullable** — The datetime when the line item was returned
- `returnQuantity` `Float` **nullable** — Quantity of items returned for an order
- `returnTotals` `LineItemReturnTotals` **nullable** — Grouped return totals for a line item
- `serviceEndsAt` `DateTime` **nullable** — Datetime used to mark the end of service for a STAY or SERVICE line item
- `serviceStartAt` `DateTime` **nullable** — Datetime used to mark the start of service for a STAY or SERVICE line item
- `shipping` `ShippingInfo` **nullable** — Snapshotted shipping info associated to the line item. If not present, we assume the line item's shipping info is identical to the order's main shipping info
- `skuId` `String` **nullable** — Reference to a SKU as defined by the Catalog (v2 or later) service. Can be set to null.
- `status` `LineItemStatus` **nullable** — Possible fulfillment statuses for a line item
- `tags` `[String!]` **nullable** — Comma delimited string of attributes for a line item. A tag should be an attribute of the line item that does not change
- `taxes` `[Tax!]` **nullable** — Taxes for a line item
- `totals` `LineItemTotals` **nullable** — Grouped totals for a line item
- `type` `LineItemTypes` **nullable** — Type of a line item.
- `unitAmount` `Money` **nullable** — Price for each unit. Stored as an integer in the currency's lowest denomination (e.g. cents for USD)
- `updatedAt` `DateTime` **nullable** — The datetime when the line item was last updated in our system
- `deprecatedNote` `String` **nullable** deprecated — Merchant note for a line item Deprecated: Replaced by the notes array
