Introduction
The Syngenta Warehouse Management System (WMS) will provide a comprehensive REST API for managing inventory, orders, shipments, and reporting. The API will be built on Next.js App Router and will follow RESTful conventions.Base URL
All API requests should be made to:API Architecture
The API is built using Next.js 14+ App Router with the following structure:- Route Handlers: Located in
app/api/directory - API Routes: RESTful endpoints following
/api/v1/{resource}pattern - Data Layer: Prisma ORM with PostgreSQL database
- Authentication: JWT-based authentication with secure token management
- Rate Limiting: Implemented per endpoint to ensure fair usage
Request Format
All requests should include the following headers:Request Example
Response Format
All API responses follow a consistent JSON structure:Success Response
Paginated Response
Error Response
HTTP Status Codes
The API uses standard HTTP status codes:| Status Code | Description |
|---|---|
200 | Success - Request completed successfully |
201 | Created - Resource created successfully |
204 | No Content - Request successful with no response body |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing authentication |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource not found |
409 | Conflict - Resource conflict (e.g., duplicate) |
422 | Unprocessable Entity - Validation error |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error |
503 | Service Unavailable - Service temporarily unavailable |
Error Codes
Common error codes returned by the API:| Error Code | Description |
|---|---|
INVALID_REQUEST | Request parameters are invalid |
UNAUTHORIZED | Authentication credentials are missing or invalid |
FORBIDDEN | User lacks required permissions |
NOT_FOUND | Requested resource does not exist |
DUPLICATE_RESOURCE | Resource already exists |
VALIDATION_ERROR | Request data failed validation |
INSUFFICIENT_STOCK | Not enough inventory for operation |
RATE_LIMIT_EXCEEDED | Too many requests |
INTERNAL_ERROR | Internal server error |
Rate Limiting
Rate limits are applied per API key:- Standard tier: 1,000 requests per hour
- Premium tier: 5,000 requests per hour
- Enterprise tier: Custom limits
Pagination
Endpoints that return lists support pagination using query parameters:Page number to retrieve
Number of items per page (max: 100)
Field to sort by (prefix with
- for descending order)Example
Filtering
Many endpoints support filtering using query parameters:Versioning
The current API version is v1. All endpoints are prefixed with
/api/v1/.API Resources
The API provides access to the following resources:- Authentication - User authentication and token management
- Inventory - Product inventory management
- Orders - Order processing and fulfillment
- Reports - Analytics and reporting
SDKs and Libraries
Official SDKs are available for:- JavaScript/TypeScript (Node.js and Browser)
- Python
- Java
- C#/.NET
Contact your account manager for SDK documentation and installation instructions.
Support
For API support and questions:- Documentation: https://docs.syngenta-wms.com
- Email: [email protected]
- Status Page: https://status.syngenta-wms.com
