Create a draft order with custom prices
Create a quote or B2B order with draftOrderCreate: override a variant’s price with priceOverride and add custom line items with their own price.
- API
- Admin GraphQL API
- Operation
- draftOrderCreate
- Access scope
- write_draft_orders
- Replaces (REST)
- POST /admin/api/draft_orders.json
- API version
- 2026-10
- Last checked
In short
To create an order at a negotiated price, call draftOrderCreate with lineItems. For catalog products, pass variantId and priceOverride with the new unit price. For anything outside the catalog, leave out variantId and pass title, quantity and originalUnitPriceWithCurrency. The draft returns an invoiceUrl the customer can pay at; draftOrderComplete turns it into an order directly.
How to use it
- List catalog items with variantId, quantity and priceOverride in the draft’s currency.
- Add custom items (services, fees) with title, quantity, originalUnitPriceWithCurrency, taxable and requiresShipping.
- Send CreateQuote and check userErrors.
- Send the customer the invoiceUrl, or the invoice email with draftOrderInvoiceSend, or complete the draft with draftOrderComplete if payment is handled elsewhere.
Code
draft-order-create.graphqlmutation CreateQuote($input: DraftOrderInput!) {
draftOrderCreate(input: $input) {
draftOrder {
id
name
invoiceUrl
totalPriceSet {
presentmentMoney {
amount
currencyCode
}
}
lineItems(first: 10) {
nodes {
title
quantity
custom
originalUnitPriceWithCurrency {
amount
currencyCode
}
}
}
}
userErrors {
field
message
}
}
}
draft-order-create.variables.json{
"input": {
"email": "buyer@example.com",
"note": "Wholesale quote, valid for 14 days",
"tags": ["quote"],
"lineItems": [
{
"variantId": "gid://shopify/ProductVariant/1111111111",
"quantity": 20,
"priceOverride": {"amount": "35.00", "currencyCode": "EUR"}
},
{
"title": "Custom embroidery",
"quantity": 20,
"originalUnitPriceWithCurrency": {"amount": "4.50", "currencyCode": "EUR"},
"requiresShipping": false,
"taxable": true
}
]
}
}
draft-order-create.response.json{
"data": {
"draftOrderCreate": {
"draftOrder": {
"id": "gid://shopify/DraftOrder/1234567890",
"name": "#D12",
"invoiceUrl": "https://your-store.myshopify.com/1234567890/invoices/abcdef0123456789",
"totalPriceSet": {
"presentmentMoney": {
"amount": "790.00",
"currencyCode": "EUR"
}
},
"lineItems": {
"nodes": [
{"title": "Linen shirt", "quantity": 20, "custom": false, "originalUnitPriceWithCurrency": {"amount": "49.00", "currencyCode": "EUR"}},
{"title": "Custom embroidery", "quantity": 20, "custom": true, "originalUnitPriceWithCurrency": {"amount": "4.50", "currencyCode": "EUR"}}
]
}
},
"userErrors": []
}
}
}
Written by Lintel. MIT license: free to use in your own store and in client work.
Limits and edge cases
- priceOverride replaces the catalog price; appliedDiscount keeps the original price and adds a discount to the line.
- originalUnitPriceWithCurrency is ignored when variantId is set, and all prices in one draft must use its presentment currency.
- Draft orders don’t reserve stock unless you pass reserveInventoryUntil.
- Price overrides can’t be applied to bundle components.
Questions
- How do I give one customer a special price in Shopify?
- Create a draft order with priceOverride on the line item and send the customer the invoice link. For permanent B2B prices, use catalogs and price lists instead.
- How do I add a custom line item to a draft order?
- Leave out variantId and pass title, quantity and originalUnitPriceWithCurrency. Set requiresShipping and taxable as needed.
- What is the difference between priceOverride and appliedDiscount?
- priceOverride sets a new unit price. appliedDiscount keeps the original price and applies a fixed or percentage discount to the line.
Shopify documentation
- Validated against the Admin or Storefront API schema for version 2026-10 on the date shown. Check the version in your request URL.
- IDs and store addresses in the examples are placeholders. Replace them with your own.
- Admin API calls need an access token from your app. Never put an Admin API token in a storefront or theme.
- MIT license. Use the code in your own store or in client work.
Need this built, tested and maintained for your store? See API integrations.
