Update SKU using order update mutiation?

Hey there, I’m fairly new to this and wanted to ask if you can update the SKU of an order out with another SKU using the order update mutation before the order ships?

Hello @Metrelli!

By updating the SKU, do you mean deleting a line item and adding a different one?

Have a nice day!
TomasFD

Hey @tomasfd,

If a line item is the product shipped, then yup! Is that possible to delete and add a new one before it gets fulfilled?

Hello @metrelli!

If the order is already wholly fulfilled, you won’t be able to add more line items.

If it is pending or partially fulfilled, you can do the following:

  1. Add the line item you want with a query like this:
mutation{
  order_add_line_items(
    data:{
      order_id:"string"
      line_items:[{
        sku:"string"
        quantity:int
        price:"string"
        partner_line_item_id:"string"
        product_name:"string"
      }]      
  	}
  ){
    complexity
    request_id
  }
}
  1. Remove the line item you don’t want anymore:
mutation{
  order_remove_line_items(
    data:{
      order_id:"string"
      line_item_ids:"string"
    }
  ){
    complexity
    request_id
  }
}

Please let me know if this doesn’t help.

Have a nice day!
TomasfD