Inventory & Price Adjustments API
Accurate retail and warehouse management requires handling non-sale physical inventory variations (breakage, spoilage, shrinkage, audit counts) and programmatic price updates (repricing campaigns, inflation adjustments, competitor matching).
The Adjustments API covers both Stock Adjustments (physical quantity alterations with automated ledger reconciliation) and Price Adjustments (retail price modifications with historical audit logs).
1. Stock Adjustments
Stock adjustments change on-hand inventory levels outside the standard sales/procurement pipeline.
List Stock Adjustments
Retrieve historical stock adjustments performed at the authorized warehouse.
/api/v1/public/stock-adjustmentsResponse (200 OK)
{
"status": "success",
"data": {
"current_page": 1,
"data": [
{
"id": 14,
"product_id": 45,
"quantity": "5.00",
"adjustment_type": "subtract",
"notes": "Damaged goods in transit",
"created_at": "2026-09-29T11:20:00.000000Z",
"product": {
"id": 45,
"name": "Premium Basmati Rice 5kg",
"item_code": "RICE-5KG-01"
},
"creator": {
"id": 1,
"name": "Warehouse Manager"
}
}
],
"total": 14
}
}
Record Stock Adjustment
Submit a physical stock count adjustment. Tracepos immediately recalculates warehouse stock levels and posts an automated journal entry between Inventory Asset (11700) and COGS / Inventory Loss (51100).
/api/v1/public/stock-adjustmentsRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | Integer / String | Yes | Product ID to adjust |
quantity | Numeric | Yes | Quantity to add or subtract (min: 0.01) |
adjustment_type | String | Yes | 'add' (increase on-hand) or 'subtract' (decrease on-hand) |
notes | String | No | Audit reason (e.g. Physical audit recount, Water damage) |
batch_number | String | No | Product batch number if adjusting tracked batch stock |
expiry_date | Date | No | Batch expiry date (YYYY-MM-DD) |
Code Examples
:::: code-group ::: code-group-item cURL
curl -X POST "https://api.tracepos.com/api/v1/public/stock-adjustments" \
-H "X-Tracepos-Public-Key: tp_pub_live_7f8a9c2d1e" \
-H "X-Tracepos-Secret-Key: tp_sec_live_9b3e1f7a4c" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"product_id": 45,
"quantity": 3,
"adjustment_type": "subtract",
"notes": "Expired carton removed during audit"
}'
::: ::: code-group-item Node.js (Axios)
const axios = require('axios');
async function adjustStock(productId, quantity, type, notes) {
const response = await axios.post(
'https://api.tracepos.com/api/v1/public/stock-adjustments',
{
product_id: productId,
quantity: quantity,
adjustment_type: type,
notes: notes
},
{
headers: {
'X-Tracepos-Public-Key': process.env.TRACEPOS_PUBLIC_KEY,
'X-Tracepos-Secret-Key': process.env.TRACEPOS_SECRET_KEY,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}
);
return response.data;
}
::: ::: code-group-item Python (Requests)
import os
import requests
headers = {
"X-Tracepos-Public-Key": os.getenv("TRACEPOS_PUBLIC_KEY"),
"X-Tracepos-Secret-Key": os.getenv("TRACEPOS_SECRET_KEY"),
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"product_id": 45,
"quantity": 3,
"adjustment_type": "subtract",
"notes": "Expired carton removed during audit"
}
response = requests.post(
"https://api.tracepos.com/api/v1/public/stock-adjustments",
json=payload,
headers=headers
)
result = response.json()
::: ::: code-group-item PHP (Guzzle)
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.tracepos.com/api/v1/public/']);
$response = $client->post('stock-adjustments', [
'headers' => [
'X-Tracepos-Public-Key' => getenv('TRACEPOS_PUBLIC_KEY'),
'X-Tracepos-Secret-Key' => getenv('TRACEPOS_SECRET_KEY'),
'Content-Type' => 'application/json',
'Accept' => 'application/json'
],
'json' => [
'product_id' => 45,
'quantity' => 3,
'adjustment_type' => 'subtract',
'notes' => 'Expired carton removed during audit'
]
]);
$result = json_decode($response->getBody()->getContents(), true);
::: ::::
Response (200 OK)
{
"status": "success",
"adjustment_id": 15,
"new_stock_level": 42.00
}
2. Price Adjustments
The Price Adjustment API lets POS management systems and eCommerce pricing engines update unit selling prices while maintaining an immutable audit history of price revisions.
List Price Adjustment Batches
/api/v1/public/price-adjustmentsResponse (200 OK)
{
"status": "success",
"data": {
"current_page": 1,
"data": [
{
"id": 8,
"invoice_number": "ADJ-BATCH-8",
"date": "2026-09-25",
"notes": "Quarterly inflation repricing",
"creator": {
"id": 1,
"name": "Finance Admin"
}
}
],
"total": 8
}
}
Update Product Price
Update a product's retail selling price for the authorized warehouse.
/api/v1/public/price-adjustmentsRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | Integer / String | Yes | Product ID to reprice |
new_sales_price | Numeric | Yes | New selling price (min: 0.00) |
Request Payload
{
"product_id": 45,
"new_sales_price": 2950.00
}
Response (200 OK)
{
"status": "success",
"batch_invoice": "ADJ-BATCH-9",
"new_price": 2950.00
}
Accounting & Inventory Integrity
Double-Entry Valuation
Whenever stock is added or subtracted via POST /stock-adjustments, the cost value of the movement ($\text{Cost} = \text{purchase_price} \times \text{quantity}$) is posted to the general ledger:
- Add Stock (
add):- Debit:
11700Inventory Asset - Credit:
51100Inventory Adjustment Gain
- Debit:
- Subtract Stock (
subtract):- Debit:
51100Inventory Shrinkage & Loss (COGS) - Credit:
11700Inventory Asset
- Debit:
