Update Product
curl --request PUT \
--url https://api.launchmystore.io/api/v1/products/:id.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"body_html": "<string>",
"handle": "<string>",
"status": "<string>",
"tags": [
{}
],
"images": [
{}
],
"variants": [
{
"id": {},
"price": {},
"compare_at_price": {},
"inventory_quantity": 123,
"sku": "<string>",
"weight": 123,
"weight_unit": "<string>"
}
]
}
'import requests
url = "https://api.launchmystore.io/api/v1/products/:id.json"
payload = {
"title": "<string>",
"body_html": "<string>",
"handle": "<string>",
"status": "<string>",
"tags": [{}],
"images": [{}],
"variants": [
{
"id": {},
"price": {},
"compare_at_price": {},
"inventory_quantity": 123,
"sku": "<string>",
"weight": 123,
"weight_unit": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
body_html: '<string>',
handle: '<string>',
status: '<string>',
tags: [{}],
images: [{}],
variants: [
{
id: {},
price: {},
compare_at_price: {},
inventory_quantity: 123,
sku: '<string>',
weight: 123,
weight_unit: '<string>'
}
]
})
};
fetch('https://api.launchmystore.io/api/v1/products/:id.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/products/:id.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'body_html' => '<string>',
'handle' => '<string>',
'status' => '<string>',
'tags' => [
[
]
],
'images' => [
[
]
],
'variants' => [
[
'id' => [
],
'price' => [
],
'compare_at_price' => [
],
'inventory_quantity' => 123,
'sku' => '<string>',
'weight' => 123,
'weight_unit' => '<string>'
]
]
]),
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/products/:id.json"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"body_html\": \"<string>\",\n \"handle\": \"<string>\",\n \"status\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"images\": [\n {}\n ],\n \"variants\": [\n {\n \"id\": {},\n \"price\": {},\n \"compare_at_price\": {},\n \"inventory_quantity\": 123,\n \"sku\": \"<string>\",\n \"weight\": 123,\n \"weight_unit\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.launchmystore.io/api/v1/products/:id.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"body_html\": \"<string>\",\n \"handle\": \"<string>\",\n \"status\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"images\": [\n {}\n ],\n \"variants\": [\n {\n \"id\": {},\n \"price\": {},\n \"compare_at_price\": {},\n \"inventory_quantity\": 123,\n \"sku\": \"<string>\",\n \"weight\": 123,\n \"weight_unit\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/products/:id.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"body_html\": \"<string>\",\n \"handle\": \"<string>\",\n \"status\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"images\": [\n {}\n ],\n \"variants\": [\n {\n \"id\": {},\n \"price\": {},\n \"compare_at_price\": {},\n \"inventory_quantity\": 123,\n \"sku\": \"<string>\",\n \"weight\": 123,\n \"weight_unit\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyProducts
Update Product
Update an existing product
PUT
/
api
/
v1
/
products
/
:id.json
Update Product
curl --request PUT \
--url https://api.launchmystore.io/api/v1/products/:id.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"body_html": "<string>",
"handle": "<string>",
"status": "<string>",
"tags": [
{}
],
"images": [
{}
],
"variants": [
{
"id": {},
"price": {},
"compare_at_price": {},
"inventory_quantity": 123,
"sku": "<string>",
"weight": 123,
"weight_unit": "<string>"
}
]
}
'import requests
url = "https://api.launchmystore.io/api/v1/products/:id.json"
payload = {
"title": "<string>",
"body_html": "<string>",
"handle": "<string>",
"status": "<string>",
"tags": [{}],
"images": [{}],
"variants": [
{
"id": {},
"price": {},
"compare_at_price": {},
"inventory_quantity": 123,
"sku": "<string>",
"weight": 123,
"weight_unit": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
body_html: '<string>',
handle: '<string>',
status: '<string>',
tags: [{}],
images: [{}],
variants: [
{
id: {},
price: {},
compare_at_price: {},
inventory_quantity: 123,
sku: '<string>',
weight: 123,
weight_unit: '<string>'
}
]
})
};
fetch('https://api.launchmystore.io/api/v1/products/:id.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/products/:id.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'body_html' => '<string>',
'handle' => '<string>',
'status' => '<string>',
'tags' => [
[
]
],
'images' => [
[
]
],
'variants' => [
[
'id' => [
],
'price' => [
],
'compare_at_price' => [
],
'inventory_quantity' => 123,
'sku' => '<string>',
'weight' => 123,
'weight_unit' => '<string>'
]
]
]),
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/products/:id.json"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"body_html\": \"<string>\",\n \"handle\": \"<string>\",\n \"status\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"images\": [\n {}\n ],\n \"variants\": [\n {\n \"id\": {},\n \"price\": {},\n \"compare_at_price\": {},\n \"inventory_quantity\": 123,\n \"sku\": \"<string>\",\n \"weight\": 123,\n \"weight_unit\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.launchmystore.io/api/v1/products/:id.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"body_html\": \"<string>\",\n \"handle\": \"<string>\",\n \"status\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"images\": [\n {}\n ],\n \"variants\": [\n {\n \"id\": {},\n \"price\": {},\n \"compare_at_price\": {},\n \"inventory_quantity\": 123,\n \"sku\": \"<string>\",\n \"weight\": 123,\n \"weight_unit\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/products/:id.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"body_html\": \"<string>\",\n \"handle\": \"<string>\",\n \"status\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"images\": [\n {}\n ],\n \"variants\": [\n {\n \"id\": {},\n \"price\": {},\n \"compare_at_price\": {},\n \"inventory_quantity\": 123,\n \"sku\": \"<string>\",\n \"weight\": 123,\n \"weight_unit\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyUpdate Product
Updates an existing product. Only include the fields you want to update. Requires thewrite_products scope. The body can be flat or wrapped in
{ "product": { ... } }.
Request
curl -X PUT "https://api.launchmystore.io/api/v1/products/482910.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"product": {
"title": "Classic T-Shirt - Updated",
"tags": ["cotton", "casual", "bestseller"],
"variants": [
{ "id": 731204, "price": "22.00" },
{ "id": 731205, "inventory_quantity": 12 }
]
}
}'
const response = await fetch('https://api.launchmystore.io/api/v1/products/482910.json', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
product: {
title: 'Classic T-Shirt - Updated',
tags: ['cotton', 'casual', 'bestseller'],
variants: [
{ id: 731204, price: '22.00' },
{ id: 731205, inventory_quantity: 12 }
]
}
})
});
Path Parameters
Body Parameters
All body parameters are optional. Any field not listed below is ignored.Changes to existing variants. Each entry updates one variant:
- with
id(the variant’s numericidor its UUIDkey) — that variant. Anidthat is not a variant of this product is rejected with422. - without
id, in the first position — the product’s first variant (position1).
id after the first are ignored: this endpoint does not
add or remove variants (create the product with all its variants instead).
Option values (title, option1–option3) of an existing variant are not
changed here.The first variant’s price and stock are also copied to the product itself,
as on create.Show Variant Object
Show Variant Object
The original (“was”) price. Only kept when higher than
price;
null removes it.Response
Returns the updated product as a bareproduct object — the same shape as
Get Product. Money values are decimal strings,
id is the numeric product id and product_id the UUID. vendor and
product_type are not stored and are returned as empty strings.
Example Response
{
"product": {
"id": 482910,
"product_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"title": "Classic T-Shirt - Updated",
"handle": "classic-t-shirt",
"body_html": "<p>A comfortable cotton t-shirt.</p>",
"status": "active",
"vendor": "",
"product_type": "",
"tags": ["cotton", "casual", "bestseller"],
"variants": [
{
"id": 731204,
"key": "5b1d3c2e-8a4f-4e2b-9c1d-7e6f5a4b3c2d",
"product_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"title": "Small",
"price": "22.00",
"compare_at_price": "30.00",
"inventory_quantity": 50,
"position": 1,
"available": true
},
{
"id": 731205,
"key": "6c2e4d3f-9b5a-4f3c-8d2e-8f7a6b5c4d3e",
"product_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"title": "Medium",
"price": "25.00",
"compare_at_price": null,
"inventory_quantity": 12,
"position": 2,
"available": true
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-25T15:00:00Z"
}
}
Error Response
Errors are returned as a standarderrors object:
{
"errors": {
"base": ["variants[0].id 999 is not a variant of this product"]
}
}
Error Codes
| Status | Description |
|---|---|
401 | Invalid or missing access token |
403 | App doesn’t have the write_products scope |
404 | Product with the specified ID does not exist |
422 | Invalid request body, or a variant id that is not on this product |