> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify: Create Draft Order

Create a draft order in your Shopify store for later completion. Supports line items, customer info, shipping address, discounts, and notes. Ideal for: quotes, pending orders, manual review workflows, B2B invoicing. Required scope: `write_draft_orders` or `write_quick_sale`.

![Shopify: Create Draft Order logo](https://ai-icon.b3.fun/logo/shopify)
Catalog action Integrations shopify

Create a draft order in your Shopify store for later completion. Supports line items, customer info, shipping address, discounts, and notes. Ideal for: quotes, pending orders, manual review workflows, B2B invoicing. Required scope: `write_draft_orders` or `write_quick_sale`.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `shopify-create-draft-order` |
| Category | Integrations |
| Connector | `shopify` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `shopify`, `ecommerce`, `orders`, `write` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `lineItems` | `array` | Yes | Array of line items for the draft order |
| `email` | `string` | No | Customer email address |
| `customerId` | `string` | No | Existing customer GID \(e.g., gid://shopify/Customer/123\) |
| `shippingAddress` | `object` | No | Shipping address for the draft order |
| `appliedDiscount` | `object` | No | Discount to apply to the draft order |
| `note` | `string` | No | Optional note for the draft order |
| `tags` | `array` | No | Tags to add to the draft order |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | `boolean` | Yes | Whether the draft order was created successfully |
| `data` | `object` | No | Created draft order data |
| `exports` | `object` | No | Exported values from the action |

## Examples

**Workflow node**

```json
{
  "type": "shopify-create-draft-order",
  "payload": {
    "lineItems": [
      {
        "variantId": "example-variantId",
        "quantity": 1
      }
    ]
  },
  "children": [],
  "connector": {
    "type": "shopify",
    "id": "conn_shopify"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/shopify-create-draft-order/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "lineItems": [
      {
        "variantId": "example-variantId",
        "quantity": 1
      }
    ]
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.