Hi all,
We’re building a B2B/wholesale flow that creates Shopify draft orders via the GraphQL Admin API (draftOrderCreate, version 2025-07).
The constraint: the wholesale customer should see only their final wholesale price on the draft order’s invoice — no retail price crossed out, no “discount −$X” line.
What we ended up doing (the only approach we found): every line item is a custom line — no variantId, just title + originalUnitPrice + customAttributes carrying the variant link:
mutation OrderProcessingDraftOrderCreate($input: DraftOrderInput!) {
draftOrderCreate(input: $input) {
draftOrder { id invoiceUrl }
userErrors { field message }
}
}
{
"input": {
"lineItems": [
{
"title": "Wholesale Product · Black / Large",
"quantity": 2,
"originalUnitPrice": "20.00",
"taxable": true,
"requiresShipping": true,
"sku": "SKU123",
"customAttributes": [
{ "key": "_variant_id", "value": "12345" },
{ "key": "_variant_gid", "value": "gid://shopify/ProductVariant/12345" },
{ "key": "_product_gid", "value": "gid://shopify/Product/678" },
{ "key": "_sku", "value": "SKU123" }
]
}
],
"acceptAutomaticDiscounts": false,
"purchasingEntity": { "customerId": "gid://shopify/Customer/9999" }
}
}
This works perfectly for the invoice UX — the customer sees Wholesale Product · Black / Large — $20 × 2 = $40, full stop. No retail price comparison.
The problem: when the customer pays the invoice URL and the draft order converts to a real order, inventory is not deducted. The variant’s available count stays the same. We understand why — the line has no variantId, so Shopify has nothing to debit. reserveInventoryUntil also doesn’t apply for the same reason (no inventory binding).
What we’ve tried / ruled out:
- Switching to variant-backed line items +
appliedDiscount— works for inventory, but renders a “−$X” discount line on the invoice, which leaks the retail price to wholesale customers. We don’t want that. appliedDiscount.description: "Wholesale price"— softens the language, but the original price + discount split still shows.- Cart Transform — can split/merge/update existing lines but can’t add new ones, so doesn’t help here.
- Searching the schema for an
originalUnitPriceOverride-style field on variant-backed lines — couldn’t find one in 2025-07.
Specific questions:
- Is there any current Admin API mechanism that lets us provide a
variantIdAND a customoriginalUnitPriceon the same draft-order line, so Shopify keeps the inventory binding? (i.e., variant-backed line, but with the price overridden — like a “negotiated price” without rendering the discount line.) - If not, is the recommended pattern to subscribe to
ORDERS_CREATE(orORDERS_PAID), read a custom attribute back to the variant, and callinventoryAdjustQuantitiesto manually debit stock? Are there any pitfalls with this approach (e.g., race conditions with overselling, multi-location handling, refund/cancel restock parity)? - Is anyone aware of a planned API change that would allow per-line price override on variant-backed draft order lines without surfacing a discount line on the invoice? Is this on the roadmap?
- For shops with
tracked: trueinventory items, what’s the rightname/reasoncombo oninventoryAdjustQuantitiesfor “this is a sale debit, not an admin correction” — i.e., the same semantics Shopify itself uses internally when an order pays? We’ve been consideringname: "available", reason: "correction"but worried that pollutes inventory history.
Happy to share more of our setup if it helps.
Thanks!