Order Created Using GraphQL Randomly not allowing edit

I created order using orderCreate - GraphQL Admin. I need to edit the order so I am using orderEditBegin - GraphQL Admin, mostly it allows to edit the order but randomly I am getting error message of “The order cannot be edited.”.

Can you help what can be the reason its preventing order edit begin to edit the order ? I am editing order created from app only.

1 Like

Hey @Maulik_Shah_RAB, thanks for the screenshot. To help replicate and diagnose this, can you share:

  • The full orderCreate and orderEditBegin mutations you’re using (with PII removed)
  • The API version you’re using
  • Approximate timing between when you create the order and when you attempt to edit it

This will help us understand if there’s a pattern with exchange orders specifically or if it’s related to the mutation structure.

You can also review the requirements here for an order to be edited:

Order Create


mutation orderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {
  orderCreate(order: $order, options: $options) {
				userErrors {
				  field
				  message
				}
				order {
				  id
				  name
				  email
				  tags
				  note
				  discountCodes   
				}
  }
}

Input variables:

order = new
  {
      email = request.OrderRequest.Email,
      lineItems = request.OrderRequest.Items.Select(item => new
      {
          quantity = (int)item.Quantity,
          variantId = "gid://shopify/ProductVariant/" + item.VariantId,
          
      }).ToList(),
      billingAddress = new
      {
          firstName = request.OrderRequest.BillingAddress.Firstname,
          lastName = request.OrderRequest.BillingAddress.Lastname,
          address1 = request.OrderRequest.BillingAddress.Address1,
          city = request.OrderRequest.BillingAddress.City,
          province = request.OrderRequest.BillingAddress.Province,
          country = request.OrderRequest.BillingAddress.Country,
          zip = request.OrderRequest.BillingAddress.Zip
      },
      shippingAddress = new
      {
          firstName = request.OrderRequest.ShippingAddress.Firstname,
          lastName = request.OrderRequest.ShippingAddress.Lastname,
          address1 = request.OrderRequest.ShippingAddress.Address1,
          city = request.OrderRequest.ShippingAddress.City,
          province = request.OrderRequest.ShippingAddress.Province,
          country = request.OrderRequest.ShippingAddress.Country,
          zip = request.OrderRequest.ShippingAddress.Zip
      },
      note = request.OrderRequest.Note,
      tags = request.OrderRequest.Tags.Split(",").ToList(),
      discountCode = request.OrderRequest.DiscountCodes.Count > 0 ? new
      {
          itemPercentageDiscountCode = request.OrderRequest.DiscountCodes.Any(x => x.Type == "percentage") ? new
          {
              code = request.OrderRequest.DiscountCodes.FirstOrDefault(x => x.Type == "percentage")?.Code,
              percentage = HelperFunctions.ParseDecimal(request.OrderRequest.DiscountCodes.FirstOrDefault(x => x.Type == "percentage")?.Amount)
          } : null
      } : null
  }

Order Edit

 var mutation = @"
		mutation orderEditBegin($id: ID!) {
		  orderEditBegin(id: $id) {
			calculatedOrder {
			  id
			   lineItems(first: 100) {
				edges {
				  node {
					id
					quantity
					variant {
					  id
					  title
					}
				  }
				}
			  }
			}
			userErrors {
			  field
			  message
			}
		  }
		}";

Input variable:

id = orderId 

API Version :2025-10

Estimated time : around 30 second - 1 minute. But I tried after few minutes as well.

Thanks for sharing those details. I had suspected that it was related to the discount, however I attempted to reproduce this using orderCreate with a 100% itemPercentageDiscountCode (resulting in a $0 total) followed immediately by orderEditBegin, but all of my attempts succeeded without errors.

Can you run this query on an order that failed to edit to see if it’s marked as editable, and if so, the reason:

query checkOrder($id: ID!) {
  order(id: $id) {
    merchantEditable
    merchantEditableErrors
  }
}

If it returns as editable, to dig deeper, can you share the x-request-id from the response headers of both the create and edit mutations. I’ll see if I can find anything specific in our logs.