{"id":"514b53b2-d06a-4826-a1cc-4e8cf3526b78","task":"Create a Shopify draft order and apply a custom line item discount before converting to a paid order","domain":"shopify.dev","steps":["Call draftOrderCreate mutation with lineItems array including variantId, quantity, and an optional appliedDiscount at the line level specifying valueType (PERCENTAGE or FIXED_AMOUNT) and value","Add a customAttributes array for any order-level metadata needed by downstream systems","Optionally apply an order-level discount via the draftOrderApplyDiscount mutation or include it in the initial create call","Send the invoice to the customer via draftOrderInvoiceSend or complete the draft order directly via draftOrderComplete with paymentPending set to false for manual payment","After payment is captured outside Shopify or via a payment link, call draftOrderComplete to convert it to a finalized order"],"gotchas":["Draft orders do not reserve inventory; if the product sells out between draft creation and completion, the order may complete successfully but fulfillment will be blocked by insufficient inventory","draftOrderComplete with paymentPending: true creates an open order but does not capture payment; you must separately create a payment via the Order Transactions API","Discounts applied to draft orders must comply with the shop's discount stacking rules; applying both a line-level and order-level discount may not produce the expected combined discount depending on configuration"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/514b53b2-d06a-4826-a1cc-4e8cf3526b78"}