Create inventory activity
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"warehouse_id": "<string>",
"quantity": 123,
"reason": "<string>",
"variant_id": "<string>",
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<string>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity"
payload = {
"warehouse_id": "<string>",
"quantity": 123,
"reason": "<string>",
"variant_id": "<string>",
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<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({
warehouse_id: '<string>',
quantity: 123,
reason: '<string>',
variant_id: '<string>',
lot_batch: '<string>',
mfg_date: '2023-12-25',
exp_date: '2023-12-25',
manufacturer: '<string>'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity', 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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity",
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([
'warehouse_id' => '<string>',
'quantity' => 123,
'reason' => '<string>',
'variant_id' => '<string>',
'lot_batch' => '<string>',
'mfg_date' => '2023-12-25',
'exp_date' => '2023-12-25',
'manufacturer' => '<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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity"
payload := strings.NewReader("{\n \"warehouse_id\": \"<string>\",\n \"quantity\": 123,\n \"reason\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"lot_batch\": \"<string>\",\n \"mfg_date\": \"2023-12-25\",\n \"exp_date\": \"2023-12-25\",\n \"manufacturer\": \"<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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"warehouse_id\": \"<string>\",\n \"quantity\": 123,\n \"reason\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"lot_batch\": \"<string>\",\n \"mfg_date\": \"2023-12-25\",\n \"exp_date\": \"2023-12-25\",\n \"manufacturer\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity")
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 \"warehouse_id\": \"<string>\",\n \"quantity\": 123,\n \"reason\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"lot_batch\": \"<string>\",\n \"mfg_date\": \"2023-12-25\",\n \"exp_date\": \"2023-12-25\",\n \"manufacturer\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"inventory_activity": {
"warehouse_id": "<string>",
"activity_type": "add",
"quantity": 123,
"reason": "<string>",
"product_id": "<string>",
"variant_id": "<string>",
"sku": "<string>",
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"warehouse": {
"name": "<string>",
"warehouse_type": "retail-store",
"city": "<string>",
"address_line1": "<string>",
"pincode": "<string>",
"state": "<string>",
"country": "<string>",
"contact_phone": 123,
"contact_email": "<string>",
"can_receive_stock": true,
"can_ship_parcel": true,
"can_collect": true,
"is_checkout_point": true,
"accepts_returns": true,
"id": "<string>",
"active": true,
"gstin": "<string>",
"address_line2": "<string>",
"landmark": "<string>",
"country_code": "+91",
"is_default": true,
"image_url": "<string>",
"seller_warehouse_id": "<string>",
"opening_hours": {
"monday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"tuesday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"wednesday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"thursday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"friday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"saturday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"sunday": {
"opening_time": "<string>",
"closing_time": "<string>"
}
},
"channels": [
{
"id": "<string>",
"name": "<string>",
"kind": "storefront",
"active": true
}
]
}
}
}
}Catalog
Create inventory activity
Create inventory activity
POST
/
catalog
/
products
/
{id}
/
inventory-activity
Create inventory activity
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"warehouse_id": "<string>",
"quantity": 123,
"reason": "<string>",
"variant_id": "<string>",
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<string>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity"
payload = {
"warehouse_id": "<string>",
"quantity": 123,
"reason": "<string>",
"variant_id": "<string>",
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<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({
warehouse_id: '<string>',
quantity: 123,
reason: '<string>',
variant_id: '<string>',
lot_batch: '<string>',
mfg_date: '2023-12-25',
exp_date: '2023-12-25',
manufacturer: '<string>'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity', 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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity",
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([
'warehouse_id' => '<string>',
'quantity' => 123,
'reason' => '<string>',
'variant_id' => '<string>',
'lot_batch' => '<string>',
'mfg_date' => '2023-12-25',
'exp_date' => '2023-12-25',
'manufacturer' => '<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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity"
payload := strings.NewReader("{\n \"warehouse_id\": \"<string>\",\n \"quantity\": 123,\n \"reason\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"lot_batch\": \"<string>\",\n \"mfg_date\": \"2023-12-25\",\n \"exp_date\": \"2023-12-25\",\n \"manufacturer\": \"<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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"warehouse_id\": \"<string>\",\n \"quantity\": 123,\n \"reason\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"lot_batch\": \"<string>\",\n \"mfg_date\": \"2023-12-25\",\n \"exp_date\": \"2023-12-25\",\n \"manufacturer\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/products/{id}/inventory-activity")
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 \"warehouse_id\": \"<string>\",\n \"quantity\": 123,\n \"reason\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"lot_batch\": \"<string>\",\n \"mfg_date\": \"2023-12-25\",\n \"exp_date\": \"2023-12-25\",\n \"manufacturer\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"inventory_activity": {
"warehouse_id": "<string>",
"activity_type": "add",
"quantity": 123,
"reason": "<string>",
"product_id": "<string>",
"variant_id": "<string>",
"sku": "<string>",
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"warehouse": {
"name": "<string>",
"warehouse_type": "retail-store",
"city": "<string>",
"address_line1": "<string>",
"pincode": "<string>",
"state": "<string>",
"country": "<string>",
"contact_phone": 123,
"contact_email": "<string>",
"can_receive_stock": true,
"can_ship_parcel": true,
"can_collect": true,
"is_checkout_point": true,
"accepts_returns": true,
"id": "<string>",
"active": true,
"gstin": "<string>",
"address_line2": "<string>",
"landmark": "<string>",
"country_code": "+91",
"is_default": true,
"image_url": "<string>",
"seller_warehouse_id": "<string>",
"opening_hours": {
"monday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"tuesday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"wednesday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"thursday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"friday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"saturday": {
"opening_time": "<string>",
"closing_time": "<string>"
},
"sunday": {
"opening_time": "<string>",
"closing_time": "<string>"
}
},
"channels": [
{
"id": "<string>",
"name": "<string>",
"kind": "storefront",
"active": true
}
]
}
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
product id
Body
application/json
Maximum string length:
128Available options:
add, reserve, reduce Maximum string length:
512optional. can be null for non variant product.
Was this page helpful?
⌘I