Skip to main content
POST
/
api
/
v1
/
orders
Create Order
curl --request POST \
  --url https://api.launchmystore.io/api/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "phone": "<string>",
  "customer_id": "<string>",
  "line_items": [
    {
      "variant_id": "<string>",
      "quantity": 123,
      "price": 123,
      "properties": [
        {}
      ]
    }
  ],
  "shipping_address": {
    "first_name": "<string>",
    "last_name": "<string>",
    "company": "<string>",
    "address1": "<string>",
    "address2": "<string>",
    "city": "<string>",
    "province": "<string>",
    "country": "<string>",
    "zip": "<string>",
    "phone": "<string>"
  },
  "billing_address": {},
  "financial_status": "<string>",
  "discount_codes": [
    {
      "code": "<string>"
    }
  ],
  "shipping_line": {
    "title": "<string>",
    "price": 123,
    "code": "<string>"
  },
  "note": "<string>",
  "tags": [
    {}
  ],
  "send_receipt": true,
  "send_fulfillment_receipt": true,
  "inventory_behaviour": "<string>"
}
'
{
  "success": true,
  "data": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Create Order

Creates a new order programmatically. This is useful for importing orders from external systems or creating orders on behalf of customers.

Request

curl -X POST "https://api.launchmystore.io/api/v1/orders" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "customer@example.com",
    "line_items": [
      {
        "variant_id": "var_xyz789",
        "quantity": 2
      }
    ],
    "shipping_address": {
      "first_name": "John",
      "last_name": "Doe",
      "address1": "123 Main St",
      "city": "New York",
      "province": "NY",
      "country": "US",
      "zip": "10001"
    },
    "financial_status": "paid"
  }'

Body Parameters

email
string
required
Customer email address
phone
string
Customer phone number
customer_id
string
Existing customer ID (if not provided, a customer may be created)
line_items
array
required
Array of line items for the order
shipping_address
object
required
Shipping address for the order
billing_address
object
Billing address (defaults to shipping address if not provided)
financial_status
string
default:"pending"
Payment status: pending, paid, partially_paid
discount_codes
array
Array of discount codes to apply
shipping_line
object
Shipping method details
note
string
Order notes
tags
array
Array of tags for the order
send_receipt
boolean
default:"true"
Whether to send order confirmation email
send_fulfillment_receipt
boolean
default:"true"
Whether to send shipping notification emails
inventory_behaviour
string
default:"decrement_obeying_policy"
Inventory handling: bypass, decrement_ignoring_policy, decrement_obeying_policy

Response

success
boolean
Whether the request succeeded
data
object
The created order object (same structure as Get Order response)

Example Response

{
  "success": true,
  "data": {
    "id": "ord_new456",
    "order_number": 1002,
    "email": "customer@example.com",
    "status": "confirmed",
    "financial_status": "paid",
    "fulfillment_status": "unfulfilled",
    "currency": "USD",
    "subtotal_price": 5000,
    "total_tax": 450,
    "total_shipping": 500,
    "total_discounts": 0,
    "total_price": 5950,
    "line_items": [
      {
        "id": "li_new123",
        "variant_id": "var_xyz789",
        "title": "Classic T-Shirt",
        "variant_title": "Small / Black",
        "quantity": 2,
        "price": 2500
      }
    ],
    "shipping_address": {
      "first_name": "John",
      "last_name": "Doe",
      "address1": "123 Main St",
      "city": "New York",
      "province": "NY",
      "country": "US",
      "zip": "10001"
    },
    "created_at": "2024-01-25T10:00:00Z",
    "updated_at": "2024-01-25T10:00:00Z"
  }
}

Error Codes

CodeDescription
UNAUTHORIZEDInvalid or missing access token
FORBIDDENApp doesn’t have write_orders scope
VALIDATION_ERRORInvalid request body
INSUFFICIENT_INVENTORYNot enough inventory for one or more items
INVALID_DISCOUNTDiscount code is invalid or expired