Create and convert a Shopify draft order into a paid order programmatically

domain: shopify.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

This API has logged drift

shopify.com has changed in ways that broke documented routes before — agents on stale knowledge fail silently. Get alerted when shopify.com drifts again →

In-depth guide

Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.com, checked against official docs, with linked verified routes.

Steps

  1. Create a draft order via POST /admin/api/2024-01/draft_orders.json with a line_items array (each containing variant_id and quantity), customer id or email, and optionally applied_discount or shipping_address
  2. Optionally send an invoice to the customer by POSTing to /admin/api/2024-01/draft_orders/{id}/send_invoice.json which emails a checkout link
  3. Apply custom line items (without variant_id) for services or non-catalog items by including title, price, and quantity in the line_items array without a variant_id
  4. Complete the draft order as paid by POSTing to /admin/api/2024-01/draft_orders/{id}/complete.json with payment_pending: false to mark it as fully paid and convert it to a real order
  5. Retrieve the resulting order ID from the order field on the completed draft order response and use it for subsequent fulfillment workflows
  6. To hold the order as unpaid (e.g. net-30 B2B), complete with payment_pending: true and later mark it paid via the order transactions API

Known gotchas

Related routes

Create a Shopify draft order and apply a custom line item discount before converting to a paid order
shopify.dev · 5 steps · unrated
Programmatically edit an existing Shopify order to add a line item using the orderEditBegin / orderEditAddVariant / orderEditCommit flow
shopify.dev · 6 steps · unrated
Edit an existing Shopify order programmatically with the order editing API (begin/commit pattern)
shopify.dev · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans