API Reference

Inventory API

Edit this page

Inventory API

The Inventory API provides endpoints for viewing inventory levels, analytics, channel-location ATP matrices, and managing cycle counts.

Scope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.

Authentication

All requests require authentication. Include your API key in the Authorization header:

1Authorization: Bearer YOUR_API_KEY

See Authentication for details.

Base URL

1https://app.betterdata.co/api/inventory

Headers

All requests must include:

1Content-Type: application/json
2Authorization: Bearer YOUR_API_KEY

Endpoints

| Method | Path | Summary | Auth | Stability | Permissions | | ------ | ---- | ------- | ---- | --------- | ----------- | | GET | /api/inventory | List inventory items | session | stable | inventory.read | | POST | /api/inventory/adjust | Adjust inventory | session | stable | inventory.adjust | | GET | /api/inventory/adjustments | List inventory adjustments | session | stable | inventory.adjust | | POST | /api/inventory/adjustments | Create inventory adjustment | session | stable | inventory.adjust | | POST | /api/inventory/adjustments/lot-correction | Create lot correction adjustment | session | stable | inventory.adjust | | GET | /api/inventory/adjustments/reason-codes | List adjustment reason codes | session | stable | inventory.adjust | | GET | /api/inventory/adjustments/record-stock | List recorded stock adjustments | session | stable | inventory.adjust | | POST | /api/inventory/adjustments/record-stock | Record stock adjustment | session | stable | inventory.adjust | | GET | /api/inventory/availability | List availability records | session | stable | inventory.read | | GET | /api/inventory/availability/[id] | Get availability record | session | stable | inventory.read | | POST | /api/inventory/availability/[id] | Create availability record | session | stable | inventory.write | | POST | /api/inventory/availability/check | Check availability | session | stable | inventory.read | | GET | /api/inventory/channel-location | Get channel × location ATP matrix | session | stable | inventory.read | | GET | /api/inventory/channel-location/drilldown | Drill down into channel-location ATP | session | stable | inventory.read | | GET | /api/inventory/channel/summary | Get channel inventory summary | session | stable | inventory.read | | GET | /api/inventory/cycle-count | List cycle count batches | session | stable | inventory.cyclecount | | POST | /api/inventory/cycle-count | Create cycle count batch | session | stable | inventory.cyclecount | | GET | /api/inventory/cycle-count/[batchId] | Get cycle count batch details | session | stable | inventory.cyclecount | | POST | /api/inventory/cycle-count/[batchId] | Update cycle count batch | session | stable | inventory.cyclecount | | GET | /api/inventory/cycle-count/abc | Get ABC classification for cycle counting | session | stable | inventory.cyclecount | | POST | /api/inventory/cycle-count/abc | Create ABC-based cycle count | session | stable | inventory.cyclecount | | GET | /api/inventory/cycle-count/blind-form | Get blind cycle count form | session | stable | inventory.cyclecount | | POST | /api/inventory/cycle-count/resolve | Resolve cycle count discrepancies | session | stable | inventory.cyclecount | | GET | /api/inventory/expired | List expired inventory | session | stable | inventory.read | | POST | /api/inventory/expired/mark-consumed | Mark expired inventory as consumed | session | stable | inventory.write | | POST | /api/inventory/expired/mark-expired | Mark inventory as expired | session | stable | inventory.write | | POST | /api/inventory/expired/transfer-destruction | Transfer expired inventory for destruction | session | stable | inventory.write | | GET | /api/inventory/holds | List inventory holds | session | stable | inventory.read | | POST | /api/inventory/holds | Create inventory hold | session | stable | inventory.write | | POST | /api/inventory/holds/release | Release inventory hold | session | stable | inventory.write | | GET | /api/inventory/locations | List inventory by location | session | stable | inventory.read | | GET | /api/inventory/lot-control/validate | Get lot control validation | session | stable | inventory.read | | POST | /api/inventory/lot-control/validate | Validate lot control | session | stable | inventory.read | | GET | /api/inventory/put-away | List put-away tasks | session | stable | inventory.read | | POST | /api/inventory/put-away | Create put-away task | session | stable | inventory.write | | POST | /api/inventory/record-stock | Record stock | session | stable | inventory.write | | GET | /api/inventory/replenishment | List replenishment records | session | stable | replenishment.read | | POST | /api/inventory/replenishment | Create replenishment record | session | stable | replenishment.write | | GET | /api/inventory/replenishment/config | Get replenishment configuration | session | stable | replenishment.read | | POST | /api/inventory/replenishment/config | Update replenishment configuration | session | stable | replenishment.write | | POST | /api/inventory/replenishment/suggestions | Get replenishment suggestions | session | stable | replenishment.read | | GET | /api/inventory/transfers | List inventory transfers | session | stable | transfers.read | | POST | /api/inventory/transfers | Create inventory transfer | session | stable | transfers.write | | GET | /api/inventory/transfers/[id] | Get inventory transfer | session | stable | transfers.read | | POST | /api/inventory/transfers/[id] | Update inventory transfer | session | stable | transfers.write | | GET | /api/inventory/transfers/bins | Get transfer bins | session | stable | transfers.read | | GET | /api/products/[id]/inventory-levels | Get product inventory levels | session | stable | products.read, inventory.read | | GET | /api/stock-requests | List stock requests | session | stable | stockrequests.read | | POST | /api/stock-requests | Create a stock request | session | stable | stockrequests.write | | GET | /api/stock-requests/[id] | Get a specific stock request | session | stable | stockrequests.read | | PATCH | /api/stock-requests/[id] | Update a stock request | session | stable | stockrequests.write | | DELETE | /api/stock-requests/[id] | Delete a stock request | session | stable | stockrequests.write | | POST | /api/stock-requests/[id]/approve | Approve a stock request | session | stable | stockrequests.approve | | POST | /api/stock-requests/[id]/comment | Add comment to stock request | session | stable | stockrequests.write | | GET | /api/stock-requests/[id]/lines | Get stock request lines | session | stable | stockrequests.read | | POST | /api/stock-requests/[id]/lines | Add line to stock request | session | stable | stockrequests.write | | POST | /api/stock-requests/[id]/reject | Reject a stock request | session | stable | stockrequests.approve | | POST | /api/stock-requests/[id]/rollback | Rollback a stock request | session | stable | stockrequests.write | | GET | /api/stock-requests/[id]/status | Get stock request status | session | stable | stockrequests.read | | POST | /api/stock-requests/[id]/status | Update stock request status | session | stable | stockrequests.write | | POST | /api/stock-requests/[id]/submit | Submit a stock request | session | stable | stockrequests.write | | GET | /api/stock-requests/by-category | Get stock requests by category | session | stable | stockrequests.read | | GET | /api/stock-requests/dashboard | Get stock requests dashboard data | session | stable | stockrequests.read | | GET | /api/stock-requests/filters | Get stock request filter options | session | stable | stockrequests.read | | GET | /api/stock-requests/pending-approvals | Get pending approvals | session | stable | stockrequests.approve | | GET | /api/stock-requests/products/search | Search products for stock requests | session | stable | stockrequests.read, products.read | | GET | /api/stock-requests/products/stocklist | Get stocklist for stock requests | session | stable | stockrequests.read |

Example Requests

Get Channel × Location ATP Matrix

1curl -X GET "https://app.betterdata.co/api/inventory/channel-location?locationId=loc_123&page=1&limit=50" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"

Response:

1{
2 "products": [
3 {
4 "productMasterId": "prod_123",
5 "productName": "Product Name",
6 "globalSku": "SKU-123",
7 "categoryName": "Category",
8 "channels": [
9 {
10 "channelId": "DTC",
11 "channelName": "Direct to Consumer",
12 "atp": 150,
13 "onHand": 200,
14 "reserved": 50,
15 "available": 150,
16 "severity": "OK",
17 "threshold": 10,
18 "policyId": "policy_123"
19 }
20 ],
21 "totalOnHand": 200,
22 "totalReserved": 50,
23 "minAtp": 150,
24 "maxAtp": 150,
25 "hasCritical": false
26 }
27 ],
28 "channels": [
29 {
30 "channelId": "DTC",
31 "channelName": "Direct to Consumer",
32 "channelType": "E_COMMERCE",
33 "policyId": "policy_123",
34 "lowAtpThreshold": 10
35 }
36 ],
37 "location": {
38 "id": "loc_123",
39 "name": "Main Warehouse"
40 },
41 "pagination": {
42 "page": 1,
43 "pageSize": 50,
44 "total": 150,
45 "totalPages": 3
46 }
47}

List Inventory Items

1curl -X GET "https://app.betterdata.co/api/inventory?locationId=loc_123&productMasterId=prod_123" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"

Response:

1{
2 "items": [
3 {
4 "id": "item_123",
5 "productMasterId": "prod_123",
6 "locationId": "loc_123",
7 "quantityOnHand": 200,
8 "quantityReserved": 50,
9 "quantityAvailable": 150,
10 "lotId": "lot_123",
11 "expiryDate": "2024-12-31",
12 "binId": "bin_123"
13 }
14 ],
15 "pagination": {
16 "page": 1,
17 "pageSize": 20,
18 "total": 1,
19 "totalPages": 1
20 }
21}

Get Inventory Analytics

1curl -X GET "https://app.betterdata.co/api/inventory/analytics?locationId=loc_123&fromDate=2024-01-01&toDate=2024-12-31" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"

Response:

1{
2 "analytics": {
3 "totalValue": 50000.00,
4 "totalUnits": 1000,
5 "turnoverRate": 12.5,
6 "averageDaysOnHand": 30,
7 "slowMovingItems": 25,
8 "expiringItems": 10,
9 "byCategory": [
10 {
11 "categoryId": "cat_123",
12 "categoryName": "Category",
13 "value": 25000.00,
14 "units": 500
15 }
16 ]
17 },
18 "period": {
19 "from": "2024-01-01T00:00:00Z",
20 "to": "2024-12-31T23:59:59Z"
21 }
22}

Common Errors

401 Unauthorized

1{
2 "error": "Unauthorized"
3}

Cause: Missing or invalid API key.

Solution: Include a valid API key in the Authorization header.

400 Bad Request

1{
2 "error": "locationId is required"
3}

Cause: Required query parameter missing.

Solution: Include all required query parameters in the request.

404 Not Found

1{
2 "error": "Location not found or not accessible"
3}

Cause: Location doesn't exist or isn't accessible to your organization.

Solution: Verify the location ID and ensure you have access to it.

500 Internal Server Error

1{
2 "error": "Internal Server Error",
3 "message": "ATP calculation failed"
4}

Cause: Server error during ATP calculation or data retrieval.

Solution: Retry the request. If the error persists, contact support.

Query Parameters

Channel-Location ATP

  • locationId (required): Location ID
  • search: Search by product name or SKU
  • channels: Comma-separated channel IDs to filter
  • page: Page number (default: 1)
  • limit: Page size (default: 50, max: 200)

List Inventory

  • locationId: Filter by location
  • productMasterId: Filter by product
  • lotId: Filter by lot
  • binId: Filter by bin
  • page: Page number (default: 1)
  • limit: Page size (default: 20, max: 100)

Inventory Analytics

  • locationId: Filter by location
  • fromDate: Start date (ISO string)
  • toDate: End date (ISO string)
  • categoryId: Filter by category

Request/Response Schemas

Channel ATP Cell

1{
2 channelId: string;
3 channelName: string;
4 atp: number;
5 onHand: number;
6 reserved: number;
7 available: number;
8 severity: "OK" | "LOW" | "CRITICAL";
9 threshold?: number;
10 policyId?: string;
11}

Inventory Item

1{
2 id: string;
3 productMasterId: string;
4 locationId: string;
5 quantityOnHand: number;
6 quantityReserved: number;
7 quantityAvailable: number;
8 lotId?: string;
9 expiryDate?: string; "cmt">// ISO date
10 binId?: string;
11 createdAt: string; "cmt">// ISO datetime
12 updatedAt: string; "cmt">// ISO datetime
13}

Inventory Analytics

1{
2 totalValue: number;
3 totalUnits: number;
4 turnoverRate: number;
5 averageDaysOnHand: number;
6 slowMovingItems: number;
7 expiringItems: number;
8 byCategory: Array<{
9 categoryId: string;
10 categoryName: string;
11 value: number;
12 units: number;
13 }>;
14}


Permissions & Roles

Inventory API access requires inventory.read permission. Some endpoints may require additional permissions (e.g., inventory.cyclecount for cycle count endpoints).


Levels

Scope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.

Endpoints

Create Inventory Level

POST /api/inventory-levels

Create or update inventory level settings (min/max/reorder quantities) for a product at a location.

Request Body:

1{
2 "productMasterId": "prod_123",
3 "locationId": "loc_123",
4 "minQuantity": 50,
5 "reorderQuantity": 100,
6 "maxQuantity": 500,
7 "status": "Supported",
8 "abcClass": "A",
9 "expectedLeadTimeDays": 7,
10 "replenishmentPeriodDays": 14,
11 "forecastPeriodDays": 30,
12 "forecastQuantity": 200,
13 "preferredBinLocationId": "bin_123",
14 "replenishmentLocationId": "loc_456",
15 "comments": "High priority item"
16}

Request Fields:

| Field | Type | Required | Description | |-------|------|----------|-------------| | productMasterId | string | Yes* | Product Master ID (or productId for legacy) | | productId | string | No | Legacy Product ID (deprecated) | | locationId | string | Yes | Location ID | | minQuantity | number | No | Minimum quantity (must be ≤ reorder ≤ max) | | reorderQuantity | number | No | Reorder point (must be ≥ min and ≤ max) | | maxQuantity | number | No | Maximum quantity (must be ≥ reorder) | | status | string | No | Status (default: "Supported") | | abcClass | string | No | ABC classification (A, B, or C) | | expectedLeadTimeDays | integer | No | Expected lead time in days | | replenishmentPeriodDays | integer | No | Replenishment period in days | | forecastPeriodDays | integer | No | Forecast period in days | | forecastQuantity | number | No | Forecast quantity | | preferredBinLocationId | string | No | Preferred bin location | | replenishmentLocationId | string | No | Replenishment source location | | comments | string | No | Additional comments |

Response:

1{
2 "id": "level_123",
3 "productMasterId": "prod_123",
4 "locationId": "loc_123",
5 "minQuantity": 50,
6 "reorderQuantity": 100,
7 "maxQuantity": 500,
8 "status": "Supported",
9 "abcClass": "A",
10 "createdAt": "2024-01-15T10:00:00Z",
11 "updatedAt": "2024-01-15T10:00:00Z",
12 "product": {
13 "id": "prod_123",
14 "sku": "SKU-123",
15 "name": "Product Name"
16 },
17 "productMaster": {
18 "id": "prod_123",
19 "globalSku": "SKU-123",
20 "productName": "Product Name"
21 }
22}

Update Inventory Level

PATCH /api/inventory-levels/{id}

Update inventory level settings.

Request Body:

1{
2 "minQuantity": 75,
3 "reorderQuantity": 150,
4 "maxQuantity": 600,
5 "status": "Supported",
6 "abcClass": "A",
7 "comments": "Updated based on recent demand"
8}

Response:

1{
2 "id": "level_123",
3 "productMasterId": "prod_123",
4 "locationId": "loc_123",
5 "minQuantity": 75,
6 "reorderQuantity": 150,
7 "maxQuantity": 600,
8 "status": "Supported",
9 "abcClass": "A",
10 "updatedAt": "2024-01-15T11:00:00Z"
11}

Delete Inventory Level

DELETE /api/inventory-levels/{id}

Delete an inventory level configuration.

Response:

1{
2 "success": true,
3 "message": "Inventory level deleted"
4}

Example Requests

Create Inventory Level

1curl -X POST "https://app.betterdata.co/api/inventory-levels" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "productMasterId": "prod_123",
6 "locationId": "loc_123",
7 "minQuantity": 50,
8 "reorderQuantity": 100,
9 "maxQuantity": 500
10 }'

Update Inventory Level

1curl -X PATCH "https://app.betterdata.co/api/inventory-levels/level_123" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "reorderQuantity": 150
6 }'

Common Errors

400 Bad Request - Invalid Quantities

1{
2 "error": "Invalid quantities: min ≤ reorder ≤ max required"
3}

Cause: Quantity validation failed (e.g., min > reorder or reorder > max).

Solution: Ensure min ≤ reorder ≤ max.

404 Not Found

1 
2_(Section truncated; use [/api-reference/openapi.json](/api-reference/openapi.json) for full schemas.)_
3 
4---
5 
6## Availability (ATP)
7 
8The Availability API provides endpoints for checking Available to Promise (ATP) inventory across locations, channels, lots, and bins.
9 
10<Note>
11 **Scope**: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.
12</Note>
13 
14## Authentication
15 
16All requests require authentication. Include your API key in the `Authorization` header:

Authorization: Bearer YOUR_API_KEY

1 
2See [Authentication](/api-reference/authentication) for details.
3 
4## Base URL

https://app.betterdata.co/api/inventory/availability

1 
2## Endpoints
3 
4### Get Availability
5 
6`GET /api/inventory/availability`
7 
8Get inventory availability with optional filters. Returns either stock lines or an aggregated summary.
9 
10**Query Parameters:**
11 
12| Parameter | Type | Required | Description |
13|-----------|------|----------|-------------|
14| `locationId` | string | No | Filter by location |
15| `productMasterId` | string | No | Filter by product |
16| `productId` | string | No | Filter by legacy product (deprecated) |
17| `lotId` | string | No | Filter by lot |
18| `binId` | string | No | Filter by bin |
19| `includeExpired` | boolean | No | Include expired stock (default: false) |
20| `includeRecalled` | boolean | No | Include recalled stock (default: false) |
21| `includeOnHold` | boolean | No | Include held stock (default: false) |
22| `summary` | boolean | No | Return aggregated summary instead of stock lines (default: false) |
23| `includeStockLines` | boolean | No | Include stock lines when summary=true (default: false) |
24 
25**Response (Stock Lines):**
26 
27```json
28{
29 "type": "stockLines",
30 "count": 5,
31 "totals": {
32 "totalOnHand": 1000,
33 "totalAvailable": 850,
34 "totalOnHold": 50,
35 "totalPicked": 100,
36 "totalRecalled": 0,
37 "totalExpired": 0
38 },
39 "data": [
40 {
41 "id": "item_123",
42 "productMasterId": "prod_123",
43 "locationId": "loc_123",
44 "lotId": "lot_123",
45 "binId": "bin_123",
46 "qtyOnHand": 200,
47 "qtyAvailable": 150,
48 "qtyOnHold": 25,
49 "qtyPicked": 25,
50 "qtyRecalled": 0,
51 "qtyExpired": 0
52 }
53 ]
54}

Response (Summary):

1{
2 "type": "summary",
3 "data": {
4 "productMasterId": "prod_123",
5 "locationId": "loc_123",
6 "totalOnHand": 1000,
7 "totalAvailable": 850,
8 "totalOnHold": 50,
9 "totalPicked": 100,
10 "stockLines": [
11 {
12 "id": "item_123",
13 "qtyOnHand": 200,
14 "qtyAvailable": 150
15 }
16 ]
17 }
18}

Batch Availability Check

POST /api/inventory/availability/check

Check availability for multiple items at once. Useful for order processing or allocation checks.

Request Body:

1{
2 "items": [
3 {
4 "sku": "SKU-123",
5 "locationId": "loc_123",
6 "quantity": 100
7 },
8 {
9 "sku": "SKU-456",
10 "locationId": "loc_123",
11 "quantity": 50
12 }
13 ]
14}

Response:

1{
2 "results": [
3 {
4 "sku": "SKU-123",
5 "locationId": "loc_123",
6 "requestedQuantity": 100,
7 "availableQuantity": 150,
8 "isAvailable": true
9 },
10 {
11 "sku": "SKU-456",
12 "locationId": "loc_123",
13 "requestedQuantity": 50,
14 "availableQuantity": 30,
15 "isAvailable": false
16 }
17 ]
18}

Example Requests

Get Availability for a Product

1curl -X GET "https://app.betterdata.co/api/inventory/availability?productMasterId=prod_123&locationId=loc_123" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"

Get Aggregated Summary

1curl -X GET "https://app.betterdata.co/api/inventory/availability?productMasterId=prod_123&locationId=loc_123&summary=true&includeStockLines=true" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"

Batch Check Availability

1curl -X POST "https://app.betterdata.co/api/inventory/availability/check" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "items": [
6 {
7 "sku": "SKU-123",
8 "locationId": "loc_123",
9 "quantity": 100
10 }
11 ]
12 }'

Common Errors

401 Unauthorized

1{
2 "error": "Unauthorized"
3}

Cause: Missing or invalid API key.

Solution: Include a valid API key in the Authorization header.

400 Bad Request

1{
2 "error": "Invalid request data"
3}

Cause: Invalid request body or query parameters.

Solution: Verify all required fields are present and correctly formatted.


(Section truncated; use /api-reference/openapi.json for full schemas.)


Adjustments

Scope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.

Endpoints

Create Adjustment

POST /api/inventory/adjustments

Adjust inventory quantity for a stock line. Creates a stock transaction and updates the inventory item.

Request Body:

1{
2 "inventoryItemId": "item_123",
3 "newQtyOnHand": 150,
4 "reasonCodeId": "reason_456",
5 "comment": "Cycle count adjustment",
6 "rootCause": "Physical count discrepancy"
7}

Request Fields:

| Field | Type | Required | Description | |-------|------|----------|-------------| | inventoryItemId | string | Yes | Inventory item ID to adjust | | newQtyOnHand | number | Yes | New quantity on hand | | reasonCodeId | string | Yes | Reason code for the adjustment | | comment | string | No | Optional comment | | rootCause | string | No | Required for healthcare large negative adjustments |

Response:

1{
2 "success": true,
3 "transaction": {
4 "id": "txn_789",
5 "inventoryItemId": "item_123",
6 "transactionType": "ADJUSTMENT",
7 "deltaQty": 50,
8 "reasonCodeId": "reason_456",
9 "createdAt": "2024-01-15T10:30:00Z"
10 },
11 "inventoryItem": {
12 "id": "item_123",
13 "productMasterId": "prod_123",
14 "locationId": "loc_123",
15 "qtyOnHand": 150,
16 "qtyAvailable": 150,
17 "qtyReserved": 0
18 },
19 "message": "Adjusted +50 units"
20}

Get Adjustment History

GET /api/inventory/adjustments

Get stock history and adjustment records with filtering and pagination.

Query Parameters:

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | inventoryItemId | string | No | Filter by inventory item | | productMasterId | string | No | Filter by product | | locationId | string | No | Filter by location | | startDate | string | No | Filter from date (ISO format) | | endDate | string | No | Filter to date (ISO format) | | limit | integer | No | Maximum results (default: 50) | | offset | integer | No | Offset for pagination (default: 0) |

Response:

1{
2 "entries": [
3 {
4 "id": "txn_789",
5 "inventoryItemId": "item_123",
6 "transactionType": "ADJUSTMENT",
7 "deltaQty": 50,
8 "qtyBefore": 100,
9 "qtyAfter": 150,
10 "reasonCode": "Cycle Count",
11 "comment": "Physical count adjustment",
12 "createdAt": "2024-01-15T10:30:00Z",
13 "createdBy": "user_456"
14 }
15 ],
16 "total": 25,
17 "pagination": {
18 "limit": 50,
19 "offset": 0,
20 "hasMore": false
21 }
22}

Example Requests

Create Adjustment

1curl -X POST "https://app.betterdata.co/api/inventory/adjustments" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "inventoryItemId": "item_123",
6 "newQtyOnHand": 150,
7 "reasonCodeId": "reason_456",
8 "comment": "Cycle count adjustment"
9 }'

Get Adjustment History

1curl -X GET "https://app.betterdata.co/api/inve
2 
3_(Section truncated; use [/api-reference/openapi.json](/api-reference/openapi.json) for full schemas.)_
4 
5---
6 
7## Replenishment
8 
9<Note>
10 **Scope**: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.
11</Note>
12 
13## Endpoints
14 
15### Get Replenishment Config
16 
17`GET /api/inventory/replenishment/config`
18 
19_See the [OpenAPI bundle](/api-reference/openapi.json) for endpoint-level details._
20 
21### Update Replenishment Config
22 
23`POST /api/inventory/replenishment/config`
24 
25_See the [OpenAPI bundle](/api-reference/openapi.json) for endpoint-level details._
26 
27---
28 
29## Related Pages
30 
31- [Levels](#levels) — on this page
32- [Adjustments](#adjustments) — on this page
33 
34---
35 
36## Permissions & Roles
37 
38<Tip>
39 Viewing replenishment config requires standard user permissions. Updating config requires tenant admin permissions.
40</Tip>
41 
42---
43 
44## Cycle counts
45 
46<Note>
47 **Scope**: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.
48</Note>
49 
50## Endpoints
51 
52### Get Cycle Count Data
53 
54`GET /api/inventory/cycle-count`
55 
56Get cycle count data in different modes: all products, batches, to-resolve items, suggestions, or ABC config.
57 
58**Query Parameters:**
59 
60| Parameter | Type | Required | Description |
61|-----------|------|----------|-------------|
62| `locationId` | string | Yes* | Location ID (required unless mode=abc-config) |
63| `mode` | string | No | Data mode: `all-products`, `batches`, `to-resolve`, `suggestions`, `abc-config` (default: `all-products`) |
64| `search` | string | No | Search filter (for all-products mode) |
65| `categoryId` | string | No | Category filter (for all-products mode) |
66| `binId` | string | No | Bin filter (for all-products mode) |
67| `abcClass` | string | No | ABC class filter (for all-products mode) |
68| `showOverdueOnly` | boolean | No | Only show overdue items (for all-products mode) |
69| `status` | string | No | Batch status filter (for batches mode) |
70| `assigneeId` | string | No | Filter by assignee (for batches mode) |
71| `includeCompleted` | boolean | No | Include completed batches (for batches mode) |
72 
73**Response (All Products Mode):**
74 
75```json
76{
77 "type": "all-products",
78 "products": [
79 {
80 "productMasterId": "prod_123",
81 "sku": "SKU-123",
82 "productName": "Product Name",
83 "locationId": "loc_123",
84 "lastCountedDate": "2024-01-01",
85 "nextCountDate": "2024-02-01",
86 "isOverdue": false,
87 "abcClass": "A",
88 "currentQty": 200
89 }
90 ],
91 "count": 50,
92 "overdueCount": 5
93}

Response (Batches Mode):

1{
2 "type": "batches",
3 "batches": [
4 {
5 "id": "batch_123",
6 "locationId": "loc_123",
7 "status": "IN_PROGRESS",
8 "assigneeId": "user_456",
9 "createdAt": "2024-01-15T10:00:00Z",
10 "itemCount": 25
11 }
12 ],
13 "count": 3
14}

Response (ABC Config Mode):

1{
2 "config": {
3 "aPercent": 80,
4 "bPercent": 15,
5 "cPercent": 5,
6 "aFrequencyDays": 30,
7 "bFrequencyDays": 60,
8 "cFrequencyDays": 90
9 }
10}

Example Requests

Get All Products for Cycle Count

1curl -X GET "https://app.betterdata.co/api/inventory/cycle-count?locationId=loc_123&mode=all-products&abcClass=A" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"

Get Cycle Count Batches

1curl -X GET "https://app.betterdata.co/api/inventory/cycle-count?locationId=loc_123&mode=batches&status=IN_PROGRESS" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"

Get ABC Configuration

1curl -X GET "https://app.betterdata.co/api/inventory/cycle-count?mode=abc-config" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json"


Permissions & Roles

Creating and completing cycle counts requires inventory management permissions.


Channel × location

Scope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.

Endpoints

Get Channel-Location Inventory

GET /api/inventory/channel-location

See the OpenAPI bundle for endpoint-level details.

Drilldown

GET /api/inventory/channel-location/drilldown

See the OpenAPI bundle for endpoint-level details.



Permissions & Roles

Viewing channel-location inventory requires standard user permissions.