Draft Order GraphQL: originalUnitPrice ignored when variantId is present

Hi,

I’m trying to create a draft order using GraphQL with the following request parameters in .NET:

var draftOrderInput = new
{
    input = new
    {
        taxExempt = order.TotalTax == 0,
        email = order.Email,
        note = order.Number,
        billingAddress = new
        {
            firstName = order.BillingAddress.FirstName,
            lastName = order.BillingAddress.LastName,
            address1 = order.BillingAddress.Address1,
            address2 = order.BillingAddress.Address2,
            ...
        },
        shippingAddress = new
        {
            firstName = order.ShippingAddress.FirstName,
            lastName = order.ShippingAddress.LastName,
            address1 = order.ShippingAddress.Address1,
            address2 = order.ShippingAddress.Address2,
            ...
        },
        lineItems = order.LineItems.Select(item => new
        {
            variantId = item.VariantId,
            title = item.Title,
            quantity = item.Quantity,
            originalUnitPrice = item.Price,
            sku = item.Sku,
            taxable = item.Taxable,
        }).ToList(),
    },
};

After creating the draft order, I then complete it.

Problem:
The value I pass in originalUnitPrice (e.g. 210) is ignored when variantId is included. Shopify automatically assigns the default product price (e.g. 100 from the store catalog) instead.

What I need:
I need to override the price with the value passed in originalUnitPrice while still keeping the variantId so inventory is tracked correctly.

1 Like

Hey @Joseph_Anderson

What you are seeing is expected. The originalUnitPrice field gets ignored when variantId is present.

For your case, you can use priceOverride instead of originalUnitPrice for existing variants. Here’s the GraphQL structure:


lineItems: [{
  variantId: "gid://shopify/ProductVariant/123", 
  quantity: 1,
  priceOverride: {
    amount: "210.00",
    currencyCode: "USD"
  }
}]