Update Variant
curl --request PATCH \
--url https://api.launchmystore.io/variants/update-single-variant/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": "<string>",
"price": 123,
"discountPrice": 123,
"stock": 123,
"stockStatus": "<string>",
"skuId": "<string>",
"weight": 123,
"weightUnit": "<string>"
}
'import requests
url = "https://api.launchmystore.io/variants/update-single-variant/{id}"
payload = {
"name": "<string>",
"value": "<string>",
"price": 123,
"discountPrice": 123,
"stock": 123,
"stockStatus": "<string>",
"skuId": "<string>",
"weight": 123,
"weightUnit": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
value: '<string>',
price: 123,
discountPrice: 123,
stock: 123,
stockStatus: '<string>',
skuId: '<string>',
weight: 123,
weightUnit: '<string>'
})
};
fetch('https://api.launchmystore.io/variants/update-single-variant/{id}', 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/variants/update-single-variant/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'value' => '<string>',
'price' => 123,
'discountPrice' => 123,
'stock' => 123,
'stockStatus' => '<string>',
'skuId' => '<string>',
'weight' => 123,
'weightUnit' => '<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/variants/update-single-variant/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"price\": 123,\n \"discountPrice\": 123,\n \"stock\": 123,\n \"stockStatus\": \"<string>\",\n \"skuId\": \"<string>\",\n \"weight\": 123,\n \"weightUnit\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.launchmystore.io/variants/update-single-variant/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"price\": 123,\n \"discountPrice\": 123,\n \"stock\": 123,\n \"stockStatus\": \"<string>\",\n \"skuId\": \"<string>\",\n \"weight\": 123,\n \"weightUnit\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/variants/update-single-variant/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"price\": 123,\n \"discountPrice\": 123,\n \"stock\": 123,\n \"stockStatus\": \"<string>\",\n \"skuId\": \"<string>\",\n \"weight\": 123,\n \"weightUnit\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"state": "success",
"message": null,
"data": {
"varientId": "8f1c2d34-...",
"productId": "prod_xyz789",
"name": "Size",
"value": "Medium",
"price": 24.99,
"discountPrice": 24.99,
"stock": 75,
"stockStatus": "IN_STOCK",
"skuId": "TSHIRT-RED-M-UPDATED",
"weight": 0.2,
"weightUnit": "kg",
"mainImageUrl": "https://assets.launchmystore.io/...",
"updatedAt": "2024-01-25T10:30:00.000Z"
}
}
Variants
Update Variant
Update an existing variant
PATCH
/
variants
/
update-single-variant
/
{id}
Update Variant
curl --request PATCH \
--url https://api.launchmystore.io/variants/update-single-variant/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": "<string>",
"price": 123,
"discountPrice": 123,
"stock": 123,
"stockStatus": "<string>",
"skuId": "<string>",
"weight": 123,
"weightUnit": "<string>"
}
'import requests
url = "https://api.launchmystore.io/variants/update-single-variant/{id}"
payload = {
"name": "<string>",
"value": "<string>",
"price": 123,
"discountPrice": 123,
"stock": 123,
"stockStatus": "<string>",
"skuId": "<string>",
"weight": 123,
"weightUnit": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
value: '<string>',
price: 123,
discountPrice: 123,
stock: 123,
stockStatus: '<string>',
skuId: '<string>',
weight: 123,
weightUnit: '<string>'
})
};
fetch('https://api.launchmystore.io/variants/update-single-variant/{id}', 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/variants/update-single-variant/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'value' => '<string>',
'price' => 123,
'discountPrice' => 123,
'stock' => 123,
'stockStatus' => '<string>',
'skuId' => '<string>',
'weight' => 123,
'weightUnit' => '<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/variants/update-single-variant/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"price\": 123,\n \"discountPrice\": 123,\n \"stock\": 123,\n \"stockStatus\": \"<string>\",\n \"skuId\": \"<string>\",\n \"weight\": 123,\n \"weightUnit\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.launchmystore.io/variants/update-single-variant/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"price\": 123,\n \"discountPrice\": 123,\n \"stock\": 123,\n \"stockStatus\": \"<string>\",\n \"skuId\": \"<string>\",\n \"weight\": 123,\n \"weightUnit\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/variants/update-single-variant/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"price\": 123,\n \"discountPrice\": 123,\n \"stock\": 123,\n \"stockStatus\": \"<string>\",\n \"skuId\": \"<string>\",\n \"weight\": 123,\n \"weightUnit\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"state": "success",
"message": null,
"data": {
"varientId": "8f1c2d34-...",
"productId": "prod_xyz789",
"name": "Size",
"value": "Medium",
"price": 24.99,
"discountPrice": 24.99,
"stock": 75,
"stockStatus": "IN_STOCK",
"skuId": "TSHIRT-RED-M-UPDATED",
"weight": 0.2,
"weightUnit": "kg",
"mainImageUrl": "https://assets.launchmystore.io/...",
"updatedAt": "2024-01-25T10:30:00.000Z"
}
}
There is no per-variant update endpoint on the OAuth App API (
/api/v1/).- For the first variant only, an installed app can update
price,compare_at_price, andinventory_quantitythroughPUT /api/v1/products/{id}.jsonby passing avariants[0]object — those values are mirrored onto the product. Per-variant attributes (option value, SKU, weight, image) are not addressable that way. - To update an arbitrary variant by ID, use the merchant admin route
documented here (
PATCH /variants/update-single-variant/{id}). It is also what the MCPupdate_varianttool calls.
Authentication
Merchant JWT (Authorization: Bearer <merchant-token>); roles
MERCHANT, STAFF_ADMIN, SUPER_ADMIN, or MANAGER.
Request Format
Content-Type: multipart/form-data. A variant image may be attached as the
mainImage file field; all other fields are sent as form fields.
Path Parameters
string
required
The variant ID to update
Body Parameters
All fields are optional — send only what you want to change.string
Option name (e.g. “Size”)
string
Option value (e.g. “Medium”)
number
Variant price
number
Discounted / sale price
number
Stock quantity
string
Stock status (e.g.
IN_STOCK)string
SKU
number
Weight
string
Weight unit (
g, kg, lb, oz)file
Variant image (multipart file field). When supplied it is uploaded and the
resulting URL is stored as
mainImageUrl.Response
The platform response envelope is{ status, state, message, data }, where
data is the updated variant record.
{
"status": 200,
"state": "success",
"message": null,
"data": {
"varientId": "8f1c2d34-...",
"productId": "prod_xyz789",
"name": "Size",
"value": "Medium",
"price": 24.99,
"discountPrice": 24.99,
"stock": 75,
"stockStatus": "IN_STOCK",
"skuId": "TSHIRT-RED-M-UPDATED",
"weight": 0.2,
"weightUnit": "kg",
"mainImageUrl": "https://assets.launchmystore.io/...",
"updatedAt": "2024-01-25T10:30:00.000Z"
}
}
If the variant is not found the endpoint returns
status: 400,
state: "error", message: "Variant Not Found".