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>",
"location_id": "<string>",
"available_adjustment": 123,
"reason": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/inventory_levels/adjust.json"
payload = {
"inventory_item_id": "<string>",
"location_id": "<string>",
"available_adjustment": 123,
"reason": "<string>"
}
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>',
location_id: '<string>',
available_adjustment: 123,
reason: '<string>'
})
};
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>',
'location_id' => '<string>',
'available_adjustment' => 123,
'reason' => '<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/inventory_levels/adjust.json"
payload := strings.NewReader("{\n \"inventory_item_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"available_adjustment\": 123,\n \"reason\": \"<string>\"\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 \"location_id\": \"<string>\",\n \"available_adjustment\": 123,\n \"reason\": \"<string>\"\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 \"location_id\": \"<string>\",\n \"available_adjustment\": 123,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"inventory_item_id": "<string>",
"location_id": "<string>",
"available": 123,
"on_hand": 123,
"updated_at": "<string>"
}
}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>",
"location_id": "<string>",
"available_adjustment": 123,
"reason": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/inventory_levels/adjust.json"
payload = {
"inventory_item_id": "<string>",
"location_id": "<string>",
"available_adjustment": 123,
"reason": "<string>"
}
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>',
location_id: '<string>',
available_adjustment: 123,
reason: '<string>'
})
};
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>',
'location_id' => '<string>',
'available_adjustment' => 123,
'reason' => '<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/inventory_levels/adjust.json"
payload := strings.NewReader("{\n \"inventory_item_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"available_adjustment\": 123,\n \"reason\": \"<string>\"\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 \"location_id\": \"<string>\",\n \"available_adjustment\": 123,\n \"reason\": \"<string>\"\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 \"location_id\": \"<string>\",\n \"available_adjustment\": 123,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"inventory_item_id": "<string>",
"location_id": "<string>",
"available": 123,
"on_hand": 123,
"updated_at": "<string>"
}
}Adjust Inventory
Adjusts the inventory level for an inventory item at a location by a relative amount. Use positive numbers to increase inventory and negative numbers to decrease.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": "inv_abc123",
"location_id": "loc_main",
"available_adjustment": -5,
"reason": "Damaged items removed from stock"
}'
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: 'inv_abc123',
location_id: 'loc_main',
available_adjustment: -5,
reason: 'Damaged items removed from stock'
})
});
Body Parameters
The inventory item ID to adjust
The location ID where the adjustment should be made
The amount to adjust by (positive to increase, negative to decrease)
Reason for the adjustment (for audit trail)
Response
Whether the request succeeded
Example Response
{
"success": true,
"data": {
"inventory_item_id": "inv_abc123",
"location_id": "loc_main",
"variant_id": "var_xyz789",
"sku": "TSHIRT-S-BLK",
"available": 40,
"incoming": 100,
"committed": 5,
"on_hand": 45,
"updated_at": "2024-01-25T10:00:00Z"
}
}
Batch Adjustments
For adjusting multiple inventory items at once, use the batch endpoint:curl -X POST "https://api.launchmystore.io/api/v1/inventory_levels/adjust_batch.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"adjustments": [
{
"inventory_item_id": "inv_abc123",
"location_id": "loc_main",
"available_adjustment": -5
},
{
"inventory_item_id": "inv_def456",
"location_id": "loc_main",
"available_adjustment": 10
}
],
"reason": "Inventory reconciliation"
}'
Common Adjustment Reasons
| Reason | Use Case |
|---|---|
received | New inventory received from supplier |
correction | Fixing inventory count discrepancy |
damaged | Removing damaged items |
returned | Processing customer returns |
shrinkage | Theft or unexplained loss |
transfer | Moving between locations |
recount | Physical inventory count adjustment |
Error Codes
| Code | Description |
|---|---|
UNAUTHORIZED | Invalid or missing access token |
FORBIDDEN | App doesn’t have write_inventory scope |
NOT_FOUND | Inventory item or location not found |
INSUFFICIENT_INVENTORY | Adjustment would result in negative inventory |
VALIDATION_ERROR | Invalid request body |
⌘I