Set Inventory Level
curl --request POST \
--url https://api.launchmystore.io/api/v1/inventory_levels/set.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inventory_item_id": "<string>",
"available": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/inventory_levels/set.json"
payload = {
"inventory_item_id": "<string>",
"available": 123
}
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({inventory_item_id: '<string>', available: 123})
};
fetch('https://api.launchmystore.io/api/v1/inventory_levels/set.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/inventory_levels/set.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([
'inventory_item_id' => '<string>',
'available' => 123
]),
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/inventory_levels/set.json"
payload := strings.NewReader("{\n \"inventory_item_id\": \"<string>\",\n \"available\": 123\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/inventory_levels/set.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inventory_item_id\": \"<string>\",\n \"available\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/inventory_levels/set.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 \"inventory_item_id\": \"<string>\",\n \"available\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"type": "<string>",
"data": {
"inventory_item_id": "<string>",
"available": 123
}
}Inventory
Set Inventory Level
Set inventory to an absolute value
POST
/
api
/
v1
/
inventory_levels
/
set.json
Set Inventory Level
curl --request POST \
--url https://api.launchmystore.io/api/v1/inventory_levels/set.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inventory_item_id": "<string>",
"available": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/inventory_levels/set.json"
payload = {
"inventory_item_id": "<string>",
"available": 123
}
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({inventory_item_id: '<string>', available: 123})
};
fetch('https://api.launchmystore.io/api/v1/inventory_levels/set.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/inventory_levels/set.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([
'inventory_item_id' => '<string>',
'available' => 123
]),
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/inventory_levels/set.json"
payload := strings.NewReader("{\n \"inventory_item_id\": \"<string>\",\n \"available\": 123\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/inventory_levels/set.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inventory_item_id\": \"<string>\",\n \"available\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/inventory_levels/set.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 \"inventory_item_id\": \"<string>\",\n \"available\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"type": "<string>",
"data": {
"inventory_item_id": "<string>",
"available": 123
}
}Set Inventory Level
Sets the stock for an inventory item to an absolute value. Unlikeadjust, this sets the exact quantity rather than adding or subtracting.
Request
curl -X POST "https://api.launchmystore.io/api/v1/inventory_levels/set.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inventory_item_id": "inv_abc123",
"available": 100
}'
const response = await fetch('https://api.launchmystore.io/api/v1/inventory_levels/set.json', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
inventory_item_id: 'inv_abc123',
available: 100
})
});
Body Parameters
string
required
The inventory item ID to update — a variant UUID (
varientId) or a product ID. The variant’s stock is updated first; if no variant matches, the product-level stock is set as a fallback.integer
required
The absolute available quantity to set (must be >= 0)
Response
Responses use the standard platform envelope:status, type, and a data object containing the updated inventory_level.
integer
HTTP status code (
200 on success)string
"success" or "error"object
Example Response
{
"status": 200,
"state": "success",
"message": null,
"data": {
"inventory_level": {
"inventory_item_id": "inv_abc123",
"available": 100
}
}
}
Use Cases
| Scenario | Endpoint to Use |
|---|---|
| Physical count reconciliation | set - Set to exact counted value |
| Receiving shipment | adjust - Add received quantity |
| Damaged goods | adjust - Subtract damaged quantity |
LaunchMyStore tracks a single stock value per variant (with a product-level fallback) — there is no per-location inventory model. Inventory is set or adjusted on the item directly, so there are no location connect/disconnect operations.
Error Responses
| Status | type | When |
|---|---|---|
400 | error | Missing inventory_item_id or available, or available < 0 |
401 | error | Invalid or missing access token |
403 | error | App doesn’t have the write_inventory scope |
404 | error | No variant or product matched inventory_item_id for this store |
⌘I