Hi everyone,
I’m calling the draftOrderCreate GraphQL Admin API and having trouble adding a shipping fee.
The draft order is created successfully when I exclude the shippingLines field from the input. However, when I include it, I receive the following error:
message: ‘Variable $input of type DraftOrderInput! was provided invalid value for shippingLines (Field is not defined on DraftOrderInput)’
Here is the input I’m using:
input: {
customerId: “gid://shopify/Customer/123456789”,
note: “”,
email: “test@test.com”,
taxExempt: false,
tags: [“Over Credit Limit”],
lineItems: [
{
title: “Custom product”,
originalUnitPrice: 14.99,
quantity: 5,
variantId: “gid://shopify/ProductVariant/123456789”
}
],
billingAddress: {
province: “ON”,
country: “CA”
},
shippingAddress: {
address1: “123 Main St”,
city: “Waterloo”,
province: “Ontario”,
country: “Canada”,
zip: “A1A 1A1”
},
shippingLines: {
title: “Standard Shipping”,
price: 29.8
}
}
Could someone please advise what I’m doing wrong or suggest the correct way to include a shipping fee?
Thanks in advance!