Accepting credit cards, warehouses, and shipping and fulfilling orders
Hi there,
I am creating order on Shopify store using node with GQL Apis here is my code to create order:
const orderPayload = { query: ` mutation CreateOrder($order: OrderCreateOrderInput!) { orderCreate(order: $order) { order { id name totalPriceSet { shopMoney { amount currencyCode } } billingAddress { address1 city province country zip } shippingAddress { address1 city province country zip } } userErrors { field message } } } `, variables: { order: { email: orderData.customer.email, lineItems: lineItemsData.map((item) => ({ variantId: `gid://shopify/ProductVariant/${item.variant_id}`, quantity: item.quantity, })), billingAddress: { address1: orderData.order.billing_address.address1, address2: orderData.order.billing_address.address2, city: orderData.order.billing_address.city, company: orderData.order.billing_address.company, country: orderData.order.billing_address.country, province: orderData.order.billing_address.province, zip: orderData.order.billing_address.zip, firstName: orderData.customer.first_name, lastName: orderData.customer.last_name, phone: orderData.customer.phone, }, shippingAddress: { address1: orderData.order.shipping_address.address1, address2: orderData.order.shipping_address.address2, city: orderData.order.shipping_address.city, company: orderData.order.shipping_address.company, country: orderData.order.shipping_address.country, province: orderData.order.shipping_address.province, zip: orderData.order.shipping_address.zip, firstName: orderData.customer.first_name, lastName: orderData.customer.last_name, phone: orderData.customer.phone, }, financialStatus: "PENDING", // Set financial status as PENDING }, }, };
In second step i am marking it as paid, here is my code:
const mutationPayload = { query: ` mutation MarkAsPaid($input: OrderMarkAsPaidInput!) { orderMarkAsPaid(input: $input) { order { id name } userErrors { field message } } } `, variables: { input: { id: `gid://shopify/Order/${orderId}`, // Global ID format for the order }, }, };
Now the thing is why in my order it is saying Shipping not required:
When i was working with REST APIs it was showing Shipping in Delivery method.
Can anyone help in this
Solved! Go to the solution
This is an accepted solution.
In the variable we need to add requireShipping status true.
lineItems: lineItemsData.map((item) => ({
variantId: `gid://shopify/ProductVariant/${item.variant_id}`,
quantity: item.quantity,
requiresShipping: true,
})),
I don’t need to provide proof in this case. Simply, it’s not my personal store, I’m a developer. We are building an app for our company, and in certain scenarios, we need to create orders on the store registered with us. Previously, I implemented this using our business logic with REST API, and it worked perfectly. However, as the industry shifts from REST to GraphQL, I’ve transitioned to using GraphQL for this process.
I’ve completed most of the implementation but encountered a missing piece. I’ve done some research, but as a MERN stack developer working on Shopify specifically for this project, I’m still seeking clarity on this issue. If you can understand this from a developer’s perspective, I would appreciate your guidance. Thank you!
This is an accepted solution.
In the variable we need to add requireShipping status true.
lineItems: lineItemsData.map((item) => ({
variantId: `gid://shopify/ProductVariant/${item.variant_id}`,
quantity: item.quantity,
requiresShipping: true,
})),
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025