# POST /api/v1/inventory/adjustments

> Create manual inventory adjustment

- **Tag:** inventory:adjustments
- **Operation ID:** `create_inventory_adjustment`

## Description

Create a manual inventory adjustment for a variant at a specific location. If no location is specified, the adjustment is applied to the default location.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `InventoryAdjustmentRequest`

- `variant_id` (string · required) — Product variant UUID to adjust.
- `quantity_change` (number | string · required) — Quantity change: positive to add, negative to subtract. Cannot be zero. Fractional for items counted by weight or volume.
- `unit_cost_cents` (integer) — Cost per unit (cents) of added stock. Defaults to what the costing method values a unit at (standard cost, moving average, newest lot, then catalogue cost); ignored for removals, which draw cost lots.
- `effective_date` (string · date) — Date the change happened (YYYY-MM-DD); dates the entry and the cost draw. Defaults to today; refused in a closed period.
- `reason` (string · required) — Adjustment reason. Prefer one of the canonical values: shrinkage | damage | expired | count_variance | theft | transfer | return | receipt_correction | found | other. Free-text values are accepted for backward compatibility.
- `reason_code` (string) — Optional canonical reason code (overrides `reason` for reporting). See InventoryAdjustmentReason for valid values.
- `location_id` (string) — Location UUID where adjustment applies. Uses default location if not specified.

## Example request

```json
{
  "location_id": "019ab37c-10c1-7000-8000-000000000001",
  "quantity_change": -5,
  "reason": "Damaged in warehouse - water damage",
  "variant_id": "019ab37c-0a71-7000-8000-000000000001"
}
```

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_InventoryAdjustmentResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (InventoryAdjustmentResponse)

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/inventory/adjustments' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "location_id": "019ab37c-10c1-7000-8000-000000000001",
  "quantity_change": -5,
  "reason": "Damaged in warehouse - water damage",
  "variant_id": "019ab37c-0a71-7000-8000-000000000001"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/inventory/adjustments', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "location_id": "019ab37c-10c1-7000-8000-000000000001",
  "quantity_change": -5,
  "reason": "Damaged in warehouse - water damage",
  "variant_id": "019ab37c-0a71-7000-8000-000000000001"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {'location_id': '019ab37c-10c1-7000-8000-000000000001',
 'quantity_change': -5,
 'reason': 'Damaged in warehouse - water damage',
 'variant_id': '019ab37c-0a71-7000-8000-000000000001'}

response = httpx.post("https://api.ondayzero.com/api/v1/inventory/adjustments", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/inventory-adjustments/create-inventory-adjustment
- OpenAPI slice: https://www.ondayzero.com/docs/reference/inventory-adjustments/create-inventory-adjustment/openapi.json
- Other endpoints in **inventory:adjustments**: https://www.ondayzero.com/docs/reference/inventory-adjustments (markdown bundle: https://www.ondayzero.com/docs/reference/inventory-adjustments.md, OpenAPI: https://www.ondayzero.com/docs/reference/inventory-adjustments/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
