Skip to main content
POST
https://api.zenflow.com.ar
/
api
/
v1
/
stock
/
adjustment
Create Stock Adjustment
curl --request POST \
  --url https://api.zenflow.com.ar/api/v1/stock/adjustment \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "product_id": 123,
  "sku": "<string>",
  "location_id": "<string>",
  "adjustment_quantity": 123,
  "reason": "<string>"
}
'

Create Stock Adjustment

Create a stock adjustment by adding or removing a quantity.
Requires write:stock scope.

Request

POST /api/v1/stock/adjustment

Body Parameters

product_id
integer
Product ID (or use sku)
sku
string
Product SKU (alternative to product_id)
location_id
string
required
Location ID
adjustment_quantity
number
required
Quantity to add (positive) or remove (negative)
reason
string
Reason for the adjustment

Examples

Add Stock

curl -X POST "https://api.zenflow.com.ar/api/v1/stock/adjustment" \
  -H "X-API-Key: zenflow_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": 100,
    "location_id": "LOC-A1",
    "adjustment_quantity": 25,
    "reason": "Received from supplier"
  }'

Response

{
  "success": true,
  "data": {
    "type": "addition",
    "quantity_adjusted": 25,
    "stock": {
      "product_id": 100,
      "location_id": "LOC-A1",
      "previous_quantity": 50,
      "new_quantity": 75
    }
  }
}

Remove Stock

curl -X POST "https://api.zenflow.com.ar/api/v1/stock/adjustment" \
  -H "X-API-Key: zenflow_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "SKU-001",
    "location_id": "LOC-A1",
    "adjustment_quantity": -10,
    "reason": "Damaged items removed"
  }'

Response

{
  "success": true,
  "data": {
    "type": "removal",
    "quantity_adjusted": -10,
    "stock": {
      "product_id": 100,
      "location_id": "LOC-A1",
      "previous_quantity": 75,
      "new_quantity": 65
    }
  }
}

Error Responses

400 Zero Quantity

{
  "success": false,
  "error": {
    "code": "validation_error",
    "message": "adjustment_quantity cannot be zero"
  }
}

400 Insufficient Stock

{
  "success": false,
  "error": {
    "code": "adjustment_error",
    "message": "Insufficient stock. Available: 5, Requested: 10"
  }
}

404 Product Not Found

{
  "success": false,
  "error": {
    "code": "not_found",
    "message": "Product not found"
  }
}