Hi,
I am creating order using orderCreate - GraphQL Admin API, I am passing Billing address, Shipping address, Line items and discountcode in input variable. Order gets created but its marked as Shipping not required.
Below is my 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
}
please help me what I am missing to remove this shipping not required


