Create Order
curl --request POST \
--url https://api.launchmystore.io/api/v1/orders.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"line_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"price": 123,
"title": "<string>"
}
],
"customer": {
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"note": "<string>",
"tags": [
{}
]
}
'import requests
url = "https://api.launchmystore.io/api/v1/orders.json"
payload = {
"line_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"price": 123,
"title": "<string>"
}
],
"customer": {
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"note": "<string>",
"tags": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
line_items: [
{
product_id: '<string>',
variant_id: '<string>',
quantity: 123,
price: 123,
title: '<string>'
}
],
customer: {
id: '<string>',
email: '<string>',
first_name: '<string>',
last_name: '<string>',
phone: '<string>'
},
shipping_address: {
first_name: '<string>',
last_name: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
phone: '<string>'
},
billing_address: {},
note: '<string>',
tags: [{}]
})
};
fetch('https://api.launchmystore.io/api/v1/orders.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/orders.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'line_items' => [
[
'product_id' => '<string>',
'variant_id' => '<string>',
'quantity' => 123,
'price' => 123,
'title' => '<string>'
]
],
'customer' => [
'id' => '<string>',
'email' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>'
],
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'phone' => '<string>'
],
'billing_address' => [
],
'note' => '<string>',
'tags' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/orders.json"
payload := strings.NewReader("{\n \"line_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"title\": \"<string>\"\n }\n ],\n \"customer\": {\n \"id\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"note\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.launchmystore.io/api/v1/orders.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"line_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"title\": \"<string>\"\n }\n ],\n \"customer\": {\n \"id\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"note\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/orders.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"line_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"title\": \"<string>\"\n }\n ],\n \"customer\": {\n \"id\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"note\": \"<string>\",\n \"tags\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyOrders
Create Order
Create a new order
POST
/
api
/
v1
/
orders.json
Create Order
curl --request POST \
--url https://api.launchmystore.io/api/v1/orders.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"line_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"price": 123,
"title": "<string>"
}
],
"customer": {
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"note": "<string>",
"tags": [
{}
]
}
'import requests
url = "https://api.launchmystore.io/api/v1/orders.json"
payload = {
"line_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"price": 123,
"title": "<string>"
}
],
"customer": {
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"note": "<string>",
"tags": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
line_items: [
{
product_id: '<string>',
variant_id: '<string>',
quantity: 123,
price: 123,
title: '<string>'
}
],
customer: {
id: '<string>',
email: '<string>',
first_name: '<string>',
last_name: '<string>',
phone: '<string>'
},
shipping_address: {
first_name: '<string>',
last_name: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
phone: '<string>'
},
billing_address: {},
note: '<string>',
tags: [{}]
})
};
fetch('https://api.launchmystore.io/api/v1/orders.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/orders.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'line_items' => [
[
'product_id' => '<string>',
'variant_id' => '<string>',
'quantity' => 123,
'price' => 123,
'title' => '<string>'
]
],
'customer' => [
'id' => '<string>',
'email' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>'
],
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'phone' => '<string>'
],
'billing_address' => [
],
'note' => '<string>',
'tags' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/orders.json"
payload := strings.NewReader("{\n \"line_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"title\": \"<string>\"\n }\n ],\n \"customer\": {\n \"id\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"note\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.launchmystore.io/api/v1/orders.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"line_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"title\": \"<string>\"\n }\n ],\n \"customer\": {\n \"id\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"note\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/orders.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"line_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"title\": \"<string>\"\n }\n ],\n \"customer\": {\n \"id\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"note\": \"<string>\",\n \"tags\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyCreate Order
Creates a new order programmatically. This is useful for importing orders from external systems or creating orders on behalf of customers.The new order is always created with
status: "pending". Totals
(subtotal_price / total_price) are derived purely from each line
item’s price × quantity — there is no inventory deduction, no
discount-code resolution, and no tax/shipping calculation on this
endpoint. Send a price on each line item if you need a non-zero total.Request
curl -X POST "https://api.launchmystore.io/api/v1/orders.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"line_items": [
{
"variant_id": "var_xyz789",
"quantity": 2,
"price": 2500
}
],
"customer": {
"email": "customer@example.com"
},
"shipping_address": {
"first_name": "John",
"last_name": "Doe",
"address1": "123 Main St",
"city": "New York",
"province": "NY",
"country": "US",
"zip": "10001"
},
"note": "Imported from external system"
}'
const response = await fetch('https://api.launchmystore.io/api/v1/orders.json', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
line_items: [
{
variant_id: 'var_xyz789',
quantity: 2,
price: 2500
}
],
customer: {
email: 'customer@example.com'
},
shipping_address: {
first_name: 'John',
last_name: 'Doe',
address1: '123 Main St',
city: 'New York',
province: 'NY',
country: 'US',
zip: '10001'
},
note: 'Imported from external system'
})
});
Body Parameters
Any field not listed below is ignored (stripped before the order is created).Array of line items for the order. Must contain at least one item.
Show Line Item Object
Show Line Item Object
Product ID.
Product variant ID.
Quantity to order (minimum
1).Price per item. Used directly to compute the order subtotal
(
price × quantity). If omitted, the item contributes 0 to the total.Item title to store on the line.
Shipping address for the order. Used to populate the order’s address,
city, state, country, ZIP and phone.
Show Address Object
Show Address Object
First name
Last name
Street address line 1
Street address line 2
City
State/Province
Province code
Country
Country code
Postal/ZIP code
Phone number
Billing address. Same shape as
shipping_address.Order note.
Array of tag strings. Accepted by the request but not currently persisted.
Response
On success (201 Created) the created order is returned under order,
including its line items. The order is created with
financial_status: "pending" and fulfillment_status: "unfulfilled".
Money fields are decimal strings; there is no top-level status field.
Example Response
{
"order": {
"id": "ord_new456",
"order_number": 1002,
"email": "customer@example.com",
"financial_status": "pending",
"fulfillment_status": "unfulfilled",
"subtotal_price": "50.00",
"total_price": "50.00",
"line_items": [
{
"id": "li_new123",
"variant_id": "var_xyz789",
"title": "Classic T-Shirt",
"quantity": 2,
"price": "25.00",
"line_price": "50.00"
}
],
"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"
}
}
{
"errors": {
"base": ["line_items should not be empty"]
}
}
Error Codes
| Status | Description |
|---|---|
400 | Invalid request body (e.g. line_items empty, or a line item missing product_id/quantity) |
401 | Invalid or missing access token |
403 | App doesn’t have the write_orders scope |
500 | Unexpected server error while creating the order |
⌘I