Adjust Inventory
curl --request POST \
--url https://api.launchmystore.io/api/v1/inventory_levels/adjust.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inventory_item_id": "<string>",
"available_adjustment": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/inventory_levels/adjust.json"
payload = {
"inventory_item_id": "<string>",
"available_adjustment": 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_adjustment: 123})
};
fetch('https://api.launchmystore.io/api/v1/inventory_levels/adjust.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/adjust.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_adjustment' => 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/adjust.json"
payload := strings.NewReader("{\n \"inventory_item_id\": \"<string>\",\n \"available_adjustment\": 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/adjust.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inventory_item_id\": \"<string>\",\n \"available_adjustment\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/inventory_levels/adjust.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_adjustment\": 123\n}"
response = http.request(request)
puts response.read_body{
"data.inventory_level": {
"inventory_item_id": "<string>",
"available": 123
}
}Inventory
Adjust Inventory
Adjust inventory levels by a relative amount
POST
/
api
/
v1
/
inventory_levels
/
adjust.json
Adjust Inventory
curl --request POST \
--url https://api.launchmystore.io/api/v1/inventory_levels/adjust.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inventory_item_id": "<string>",
"available_adjustment": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/inventory_levels/adjust.json"
payload = {
"inventory_item_id": "<string>",
"available_adjustment": 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_adjustment: 123})
};
fetch('https://api.launchmystore.io/api/v1/inventory_levels/adjust.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/adjust.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_adjustment' => 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/adjust.json"
payload := strings.NewReader("{\n \"inventory_item_id\": \"<string>\",\n \"available_adjustment\": 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/adjust.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inventory_item_id\": \"<string>\",\n \"available_adjustment\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/inventory_levels/adjust.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_adjustment\": 123\n}"
response = http.request(request)
puts response.read_body{
"data.inventory_level": {
"inventory_item_id": "<string>",
"available": 123
}
}Adjust Inventory
Adjusts the inventory level for an inventory item by a relative amount. Use a positive number to increase inventory and a negative number to decrease it. The resulting available quantity is clamped at0 (it never goes negative).
The inventory item is matched as a variant first, then as a product (for
variant-less products), so inventory_item_id is a variant ID or a product
ID.
Request
curl -X POST "https://api.launchmystore.io/api/v1/inventory_levels/adjust.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inventory_item_id": "var_xyz789",
"available_adjustment": -5
}'
const response = await fetch('https://api.launchmystore.io/api/v1/inventory_levels/adjust.json', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
inventory_item_id: 'var_xyz789',
available_adjustment: -5
})
});
Body Parameters
string
required
The inventory item ID to adjust (variant ID, or product ID for variant-less
products)
number
required
The amount to adjust by (positive to increase, negative to decrease)
Response
Returns the standard response envelope. Thedata object contains an
inventory_level object with the new available quantity.
object
Example Response
{
"status": 200,
"state": "success",
"message": null,
"data": {
"inventory_level": {
"inventory_item_id": "var_xyz789",
"available": 40
}
},
"count": null,
"pagination": null
}
Error Response
When the inventory item cannot be found:{
"status": 404,
"state": "error",
"message": "Inventory item not found",
"data": null
}
{
"status": 400,
"state": "error",
"message": "inventory_item_id and available_adjustment are required",
"data": null
}