create_draft_order
Create a new draft order for editable carts or quotes. Add product variants or custom items, then attach a customer or send an invoice URL for payment.
Instructions
Create a new draft order — Shopify's term for an editable cart/quote not yet placed as an order. Each line item is EITHER a variant reference (variantId + quantity) for catalog products, OR a custom item (title + originalUnitPrice + quantity) for one-off charges or services not in the catalog. Optionally attach a customer, email, internal note, tags, and choose whether to copy the customer's default address. Returns the new draft's GID and an invoice URL the customer can use to pay. Drafts stay OPEN until you call complete_draft_order or send the invoice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lineItems | Yes | At least one line item. Each item is EITHER a variant reference (just variantId + quantity) OR a custom item (title + originalUnitPrice + quantity, no variantId). Mixing both shapes in one item is rejected by the refine() validator. | |
| customerId | No | GID of an existing customer to attach to the draft. Get one from list_customers. Optional — drafts can be customer-less and converted to a guest checkout. | |
| No | Email address for the order. Useful when you don't have a customer record yet but want to email the invoice URL. | ||
| note | No | Internal note visible to staff only (not the customer). | |
| tags | No | Tags to apply to the draft for filtering/segmentation. | |
| useCustomerDefaultAddress | No | If true and customerId is set, copy the customer's default shipping address onto the draft. |