API Reference
The Transfers API provides endpoints for managing internal stock transfer recommendations, approval workflows, and execution.
Scope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.
All requests require authentication. Include your API key in the Authorization header:
1Authorization: Bearer YOUR_API_KEYSee Authentication for details.
1https://app.betterdata.co/api/transfersAll requests must include:
1Content-Type: application/json2Authorization: Bearer YOUR_API_KEY| Method | Path | Summary | Auth | Stability | Permissions |
| ------ | ---- | ------- | ---- | --------- | ----------- |
| 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/transfers/recommendations | List transfer recommendations | session | stable | transfers.read |
| POST | /api/transfers/recommendations | Generate new transfer recommendations | session | stable | transfers.write |
| GET | /api/transfers/recommendations/[id] | Get a specific recommendation | session | stable | transfers.read |
| POST | /api/transfers/recommendations/[id]/approve | Approve a transfer recommendation | session | stable | transfers.approve |
| POST | /api/transfers/recommendations/[id]/execute | Execute a transfer recommendation | session | stable | transfers.execute |
| POST | /api/transfers/recommendations/[id]/reject | Reject a transfer recommendation | session | stable | transfers.approve |
| GET | /api/transfers/recommendations/pending | Get pending recommendations | session | stable | transfers.read |
1curl -X GET "https://app.betterdata.co/api/transfers/recommendations?status=PENDING&priority=URGENT&limit=50" \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json"Response:
1{2 "recommendations": [3 {4 "id": "rec_123",5 "productMasterId": "prod_123",6 "sourceLocationId": "loc_456",7 "destLocationId": "loc_789",8 "quantity": 50,9 "priority": "URGENT",10 "status": "PENDING",11 "reason": "Stock imbalance detected",12 "estimatedROI": 0.15,13 "createdAt": "2024-03-01T00:00:00Z"14 }15 ],16 "total": 25,17 "limit": 50,18 "offset": 019}1curl -X POST "https://app.betterdata.co/api/transfers/recommendations" \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "locationId": "loc_123",6 "minStockDifferencePct": 0.2,7 "requirePositiveROI": true,8 "unitMargin": 10.009 }'Response:
1{2 "success": true,3 "created": 15,4 "recommendations": [5 {6 "id": "rec_456",7 "productMasterId": "prod_789",8 "sourceLocationId": "loc_123",9 "destLocationId": "loc_456",10 "quantity": 25,11 "priority": "HIGH",12 "status": "PENDING",13 "reason": "High stock at source, low stock at destination",14 "estimatedROI": 0.1215 }16 ]17}1curl -X POST "https://app.betterdata.co/api/transfers/recommendations/rec_123/approve" \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "comment": "Approved for immediate transfer"6 }'Response:
1{2 "success": true,3 "recommendation": {4 "id": "rec_123",5 "status": "APPROVED",6 "approvedAt": "2024-03-01T12:00:00Z",7 "approvedBy": "user_123"8 }9}1{2 "error": "Unauthorized"3}Cause: Missing or invalid API key.
Solution: Include a valid API key in the Authorization header.
1{2 "error": "Forbidden"3}Cause: Insufficient permissions. Generating recommendations requires ADMIN, MANAGER, or PLANNER role.
Solution: Ensure your API key has the required permissions.
1{2 "error": "Invalid request",3 "details": {4 "locationId": ["Location not found"]5 }6}Cause: Invalid request parameters.
Solution: Review the request body and ensure all parameters are valid.
1{2 "error": "Recommendation not found"3}Cause: The requested recommendation doesn't exist or isn't accessible.
Solution: Verify the recommendation ID and ensure you have access to it.
status: Filter by status (PENDING, APPROVED, EXECUTED, REJECTED, EXPIRED)priority: Filter by priority (URGENT, HIGH, MEDIUM, LOW)productMasterId: Filter by productsourceLocationId: Filter by source locationdestLocationId: Filter by destination locationvalidOnly: Return only valid recommendations (boolean)limit: Page size (default: 50, max: 100)offset: Offset for pagination (default: 0)locationId: Generate for specific location (optional)productMasterId: Generate for specific product (optional)minStockDifferencePct: Minimum stock difference percentage (0-1)requirePositiveROI: Only generate recommendations with positive ROI (boolean)unitMargin: Profit margin per unit for ROI calculation1{2 id: string;3 productMasterId: string;4 sourceLocationId: string;5 destLocationId: string;6 quantity: number;7 priority: "URGENT" | "HIGH" | "MEDIUM" | "LOW";8 status: "PENDING" | "APPROVED" | "EXECUTED" | "REJECTED" | "EXPIRED";9 reason: string;10 estimatedROI?: number;11 createdAt: string; "cmt">// ISO datetime12 approvedAt?: string; "cmt">// ISO datetime13 executedAt?: string; "cmt">// ISO datetime14}1{2 locationId?: string;3 productMasterId?: string;4 minStockDifferencePct?: number; "cmt">// 0-15 requirePositiveROI?: boolean;6 unitMargin?: number; "cmt">// Positive number7}1{2 comment?: string;3}Transfer API access requires appropriate permissions:
ADMIN, MANAGER, PLANNER, VIEWER rolesADMIN, MANAGER, PLANNER rolesADMIN, MANAGER rolesScope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.
GET /api/transfers/recommendations
See the OpenAPI bundle for endpoint-level details.
GET /api/transfers/recommendations/{id}
See the OpenAPI bundle for endpoint-level details.
GET /api/transfers/recommendations/pending
See the OpenAPI bundle for endpoint-level details.
Viewing transfer recommendations requires standard user permissions.
Scope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.
POST /api/transfers/recommendations/{id}/execute
See the OpenAPI bundle for endpoint-level details.
Executing transfers requires inventory management permissions.
Scope: Workspace-scoped — requires authenticated organization context and valid credentials for that workspace.
POST /api/transfers/recommendations/{id}/approve
See the OpenAPI bundle for endpoint-level details.
POST /api/transfers/recommendations/{id}/reject
See the OpenAPI bundle for endpoint-level details.
Approving and rejecting transfers requires inventory management permissions.
