Draft orders
Orders put together by hand: phone and wholesale orders, custom items, special prices. Email the customer an invoice to pay online, or complete the draft to turn it into an order.
Endpoints#
- GET
/draft_orders.jsonList draft orders - GET
/draft_orders/count.jsonCount draft orders - GET
/draft_orders/{id}.jsonGet a draft order - POST
/draft_orders.jsonCreate a draft order - PUT
/draft_orders/{id}.jsonUpdate a draft order - DELETE
/draft_orders/{id}.jsonDelete a draft order - POST
/draft_orders/{id}/send_invoice.jsonEmail the invoice - PUT
/draft_orders/{id}/complete.jsonComplete a draft order
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
The draft order object#
What the endpoints below return for one draft order, and the payload of the draft_orders/create, draft_orders/update webhooks.
{
"id": "cm2drft0001",
"name": "#D3",
"status": "open",
"email": "[email protected]",
"phone": null,
"currency": "USD",
"line_items": [
{
"id": "cm2dlin0001",
"product_id": "cm2prod0001",
"variant_id": "cm2vari0001",
"title": "Linen shirt",
"variant_title": "M / Sand",
"sku": "LINEN-M-SND",
"quantity": 6,
"price": "58.00",
"custom": false,
"gift_card": false,
"requires_shipping": true,
"taxable": true
},
{
"id": "cm2dlin0002",
"product_id": null,
"variant_id": null,
"title": "Custom embroidery",
"variant_title": null,
"sku": null,
"quantity": 6,
"price": "12.00",
"custom": true,
"gift_card": false,
"requires_shipping": false,
"taxable": true
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10",
"amount": "42.00"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"subtotal_price": "420.00",
"total_discounts": "42.00",
"total_shipping_price": "15.00",
"total_tax": "0.00",
"total_price": "393.00",
"tax_exempt": false,
"note": "Team shirts for the studio",
"tags": "wholesale",
"customer": {
"id": "cm2cust0002",
"email": "[email protected]",
"first_name": "Jordan",
"last_name": "Brooks"
},
"shipping_address": {
"first_name": "Jordan",
"last_name": "Brooks",
"name": "Jordan Brooks",
"company": "Brooks Studio",
"address1": "77 Elm Avenue",
"address2": null,
"city": "Austin",
"province": "Texas",
"zip": "78701",
"country": "United States",
"country_code": "US",
"phone": null
},
"invoice_url": "https://demo.storeloom.example/invoices/…",
"invoice_sent_at": null,
"order_id": null,
"completed_at": null,
"created_at": "2026-10-23T09:00:00.000Z",
"updated_at": "2026-10-23T09:00:00.000Z"
}List draft orders#
/draft_orders.jsonread_draft_orders| Parameter | Description |
|---|---|
limit, page_info, since_id, ids, fields | Pagination and selection, as for orders. |
status | open, invoice_sent or completed. |
created_at_min / created_at_max, updated_at_min / updated_at_max | ISO 8601 bounds. |
curl "https://store.weftgrid.com/api/admin/2026-10/draft_orders.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"draft_orders": [
{
"id": "cm2drft0001",
"name": "#D3",
"status": "open",
"email": "[email protected]",
"phone": null,
"currency": "USD",
"line_items": [
{
"id": "cm2dlin0001",
"product_id": "cm2prod0001",
"variant_id": "cm2vari0001",
"title": "Linen shirt",
"variant_title": "M / Sand",
"sku": "LINEN-M-SND",
"quantity": 6,
"price": "58.00",
"custom": false,
"gift_card": false,
"requires_shipping": true,
"taxable": true
},
{
"id": "cm2dlin0002",
"product_id": null,
"variant_id": null,
"title": "Custom embroidery",
"variant_title": null,
"sku": null,
"quantity": 6,
"price": "12.00",
"custom": true,
"gift_card": false,
"requires_shipping": false,
"taxable": true
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10",
"amount": "42.00"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"subtotal_price": "420.00",
"total_discounts": "42.00",
"total_shipping_price": "15.00",
"total_tax": "0.00",
"total_price": "393.00",
"tax_exempt": false,
"note": "Team shirts for the studio",
"tags": "wholesale",
"customer": {
"id": "cm2cust0002",
"email": "[email protected]",
"first_name": "Jordan",
"last_name": "Brooks"
},
"shipping_address": {
"first_name": "Jordan",
"last_name": "Brooks",
"name": "Jordan Brooks",
"company": "Brooks Studio",
"address1": "77 Elm Avenue",
"address2": null,
"city": "Austin",
"province": "Texas",
"zip": "78701",
"country": "United States",
"country_code": "US",
"phone": null
},
"invoice_url": "https://demo.storeloom.example/invoices/…",
"invoice_sent_at": null,
"order_id": null,
"completed_at": null,
"created_at": "2026-10-23T09:00:00.000Z",
"updated_at": "2026-10-23T09:00:00.000Z"
}
]
}Count draft orders#
/draft_orders/count.jsonread_draft_orders| Parameter | Description |
|---|---|
status, ids, created_at_*, updated_at_* | Same filters as the list. |
curl "https://store.weftgrid.com/api/admin/2026-10/draft_orders/count.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"count": 2
}Get a draft order#
/draft_orders/{id}.jsonread_draft_orderscurl "https://store.weftgrid.com/api/admin/2026-10/draft_orders/$DRAFT_ORDER_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"draft_order": {
"id": "cm2drft0001",
"name": "#D3",
"status": "open",
"email": "[email protected]",
"phone": null,
"currency": "USD",
"line_items": [
{
"id": "cm2dlin0001",
"product_id": "cm2prod0001",
"variant_id": "cm2vari0001",
"title": "Linen shirt",
"variant_title": "M / Sand",
"sku": "LINEN-M-SND",
"quantity": 6,
"price": "58.00",
"custom": false,
"gift_card": false,
"requires_shipping": true,
"taxable": true
},
{
"id": "cm2dlin0002",
"product_id": null,
"variant_id": null,
"title": "Custom embroidery",
"variant_title": null,
"sku": null,
"quantity": 6,
"price": "12.00",
"custom": true,
"gift_card": false,
"requires_shipping": false,
"taxable": true
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10",
"amount": "42.00"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"subtotal_price": "420.00",
"total_discounts": "42.00",
"total_shipping_price": "15.00",
"total_tax": "0.00",
"total_price": "393.00",
"tax_exempt": false,
"note": "Team shirts for the studio",
"tags": "wholesale",
"customer": {
"id": "cm2cust0002",
"email": "[email protected]",
"first_name": "Jordan",
"last_name": "Brooks"
},
"shipping_address": {
"first_name": "Jordan",
"last_name": "Brooks",
"name": "Jordan Brooks",
"company": "Brooks Studio",
"address1": "77 Elm Avenue",
"address2": null,
"city": "Austin",
"province": "Texas",
"zip": "78701",
"country": "United States",
"country_code": "US",
"phone": null
},
"invoice_url": "https://demo.storeloom.example/invoices/…",
"invoice_sent_at": null,
"order_id": null,
"completed_at": null,
"created_at": "2026-10-23T09:00:00.000Z",
"updated_at": "2026-10-23T09:00:00.000Z"
}
}Create a draft order#
/draft_orders.jsonwrite_draft_ordersline_items are catalog variants, { variant_id, quantity, price? } (price defaults to the variant's; gift cards always sell at their own price), or custom items, { title, price, quantity, sku?, requires_shipping?, taxable? }.
applied_discount ({ title?, value_type, value }, with value_type percentage or fixed_amount) applies to the whole draft except gift cards; shipping_line is { title, price }; customer takes the { id } of an existing customer. Totals use the store's tax settings unless tax_exempt is true.
Fires draft_orders/create.
{
"draft_order": {
"customer": {
"id": "cm2cust0002"
},
"line_items": [
{
"variant_id": "cm2vari0001",
"quantity": 6
},
{
"title": "Custom embroidery",
"price": "12.00",
"quantity": 6,
"requires_shipping": false
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"note": "Team shirts for the studio",
"tags": [
"wholesale"
]
}
}curl -X POST "https://store.weftgrid.com/api/admin/2026-10/draft_orders.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"draft_order": {
"customer": {
"id": "cm2cust0002"
},
"line_items": [
{
"variant_id": "cm2vari0001",
"quantity": 6
},
{
"title": "Custom embroidery",
"price": "12.00",
"quantity": 6,
"requires_shipping": false
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"note": "Team shirts for the studio",
"tags": [
"wholesale"
]
}
}'Example responseShowHide
{
"draft_order": {
"id": "cm2drft0001",
"name": "#D3",
"status": "open",
"email": "[email protected]",
"phone": null,
"currency": "USD",
"line_items": [
{
"id": "cm2dlin0001",
"product_id": "cm2prod0001",
"variant_id": "cm2vari0001",
"title": "Linen shirt",
"variant_title": "M / Sand",
"sku": "LINEN-M-SND",
"quantity": 6,
"price": "58.00",
"custom": false,
"gift_card": false,
"requires_shipping": true,
"taxable": true
},
{
"id": "cm2dlin0002",
"product_id": null,
"variant_id": null,
"title": "Custom embroidery",
"variant_title": null,
"sku": null,
"quantity": 6,
"price": "12.00",
"custom": true,
"gift_card": false,
"requires_shipping": false,
"taxable": true
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10",
"amount": "42.00"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"subtotal_price": "420.00",
"total_discounts": "42.00",
"total_shipping_price": "15.00",
"total_tax": "0.00",
"total_price": "393.00",
"tax_exempt": false,
"note": "Team shirts for the studio",
"tags": "wholesale",
"customer": {
"id": "cm2cust0002",
"email": "[email protected]",
"first_name": "Jordan",
"last_name": "Brooks"
},
"shipping_address": {
"first_name": "Jordan",
"last_name": "Brooks",
"name": "Jordan Brooks",
"company": "Brooks Studio",
"address1": "77 Elm Avenue",
"address2": null,
"city": "Austin",
"province": "Texas",
"zip": "78701",
"country": "United States",
"country_code": "US",
"phone": null
},
"invoice_url": "https://demo.storeloom.example/invoices/…",
"invoice_sent_at": null,
"order_id": null,
"completed_at": null,
"created_at": "2026-10-23T09:00:00.000Z",
"updated_at": "2026-10-23T09:00:00.000Z"
}
}Update a draft order#
/draft_orders/{id}.jsonwrite_draft_ordersFields you leave out keep their values; send null to remove the customer, address, discount or shipping line. line_items, when sent, replace all lines. Completed drafts can't change. Fires draft_orders/update.
line_items are catalog variants, { variant_id, quantity, price? } (price defaults to the variant's; gift cards always sell at their own price), or custom items, { title, price, quantity, sku?, requires_shipping?, taxable? }.
applied_discount ({ title?, value_type, value }, with value_type percentage or fixed_amount) applies to the whole draft except gift cards; shipping_line is { title, price }; customer takes the { id } of an existing customer. Totals use the store's tax settings unless tax_exempt is true.
{
"draft_order": {
"line_items": [
{
"variant_id": "cm2vari0001",
"quantity": 8
}
],
"applied_discount": null
}
}curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/draft_orders/$DRAFT_ORDER_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"draft_order": {
"line_items": [
{
"variant_id": "cm2vari0001",
"quantity": 8
}
],
"applied_discount": null
}
}'Example responseShowHide
{
"draft_order": {
"id": "cm2drft0001",
"name": "#D3",
"status": "open",
"email": "[email protected]",
"phone": null,
"currency": "USD",
"line_items": [
{
"id": "cm2dlin0001",
"product_id": "cm2prod0001",
"variant_id": "cm2vari0001",
"title": "Linen shirt",
"variant_title": "M / Sand",
"sku": "LINEN-M-SND",
"quantity": 6,
"price": "58.00",
"custom": false,
"gift_card": false,
"requires_shipping": true,
"taxable": true
},
{
"id": "cm2dlin0002",
"product_id": null,
"variant_id": null,
"title": "Custom embroidery",
"variant_title": null,
"sku": null,
"quantity": 6,
"price": "12.00",
"custom": true,
"gift_card": false,
"requires_shipping": false,
"taxable": true
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10",
"amount": "42.00"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"subtotal_price": "420.00",
"total_discounts": "42.00",
"total_shipping_price": "15.00",
"total_tax": "0.00",
"total_price": "393.00",
"tax_exempt": false,
"note": "Team shirts for the studio",
"tags": "wholesale",
"customer": {
"id": "cm2cust0002",
"email": "[email protected]",
"first_name": "Jordan",
"last_name": "Brooks"
},
"shipping_address": {
"first_name": "Jordan",
"last_name": "Brooks",
"name": "Jordan Brooks",
"company": "Brooks Studio",
"address1": "77 Elm Avenue",
"address2": null,
"city": "Austin",
"province": "Texas",
"zip": "78701",
"country": "United States",
"country_code": "US",
"phone": null
},
"invoice_url": "https://demo.storeloom.example/invoices/…",
"invoice_sent_at": null,
"order_id": null,
"completed_at": null,
"created_at": "2026-10-23T09:00:00.000Z",
"updated_at": "2026-10-23T09:00:00.000Z"
}
}Delete a draft order#
/draft_orders/{id}.jsonwrite_draft_ordersCompleted drafts are kept with their order and can't be deleted. Fires draft_orders/delete.
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/draft_orders/$DRAFT_ORDER_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{}Email the invoice#
/draft_orders/{id}/send_invoice.jsonwrite_draft_ordersEmails a link where the customer can review the draft and pay, by card when Stripe is connected or with the store's other payment methods. to defaults to the draft's email; custom_message is added to the email. The draft's status becomes invoice_sent. Fires draft_orders/update.
{
"draft_order_invoice": {
"to": "[email protected]",
"custom_message": "Here's the invoice for the team shirts."
}
}curl -X POST "https://store.weftgrid.com/api/admin/2026-10/draft_orders/$DRAFT_ORDER_ID/send_invoice.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"draft_order_invoice": {
"to": "[email protected]",
"custom_message": "Here'\''s the invoice for the team shirts."
}
}'Example responseShowHide
{
"draft_order_invoice": {
"to": "[email protected]",
"custom_message": "Here's the invoice for the team shirts.",
"invoice_url": "https://demo.storeloom.example/invoices/…"
}
}Complete a draft order#
/draft_orders/{id}/complete.jsonwrite_draft_ordersTurns the draft into an order at the draft's prices: stock is taken, the customer is recorded and gets the order confirmation email (unless the store has turned it off). By default the payment is recorded now (gateway manual); pass payment_pending=true, as a query parameter or in the body, to leave the order waiting for payment.
The draft needs an email, and a shipping address when anything ships. The response is the completed draft; its order_id is the new order. Fires orders/create (and orders/paid) and draft_orders/update.
Recording the payment for a draft that sells gift cards needs the write_gift_cards scope (403 otherwise); with payment_pending=true it doesn't.
| Parameter | Description |
|---|---|
payment_pending | true to leave the order unpaid (default false). |
curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/draft_orders/$DRAFT_ORDER_ID/complete.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"draft_order": {
"id": "cm2drft0001",
"name": "#D3",
"status": "completed",
"email": "[email protected]",
"phone": null,
"currency": "USD",
"line_items": [
{
"id": "cm2dlin0001",
"product_id": "cm2prod0001",
"variant_id": "cm2vari0001",
"title": "Linen shirt",
"variant_title": "M / Sand",
"sku": "LINEN-M-SND",
"quantity": 6,
"price": "58.00",
"custom": false,
"gift_card": false,
"requires_shipping": true,
"taxable": true
},
{
"id": "cm2dlin0002",
"product_id": null,
"variant_id": null,
"title": "Custom embroidery",
"variant_title": null,
"sku": null,
"quantity": 6,
"price": "12.00",
"custom": true,
"gift_card": false,
"requires_shipping": false,
"taxable": true
}
],
"applied_discount": {
"title": "Wholesale",
"value_type": "percentage",
"value": "10",
"amount": "42.00"
},
"shipping_line": {
"title": "Express (1–2 days)",
"price": "15.00"
},
"subtotal_price": "420.00",
"total_discounts": "42.00",
"total_shipping_price": "15.00",
"total_tax": "0.00",
"total_price": "393.00",
"tax_exempt": false,
"note": "Team shirts for the studio",
"tags": "wholesale",
"customer": {
"id": "cm2cust0002",
"email": "[email protected]",
"first_name": "Jordan",
"last_name": "Brooks"
},
"shipping_address": {
"first_name": "Jordan",
"last_name": "Brooks",
"name": "Jordan Brooks",
"company": "Brooks Studio",
"address1": "77 Elm Avenue",
"address2": null,
"city": "Austin",
"province": "Texas",
"zip": "78701",
"country": "United States",
"country_code": "US",
"phone": null
},
"invoice_url": "https://demo.storeloom.example/invoices/…",
"invoice_sent_at": null,
"order_id": "cm2ordr0002",
"completed_at": "2026-10-24T08:00:00.000Z",
"created_at": "2026-10-23T09:00:00.000Z",
"updated_at": "2026-10-23T09:00:00.000Z"
}
}