📚 API Documentation
Authentication
All API requests require authentication using AWS Cognito. The authentication flow:
- Login with username and password
- Receive JWT tokens (ID Token, Access Token, Refresh Token)
- Include the ID Token in the
Authorization header for all API requests
- Token format:
Authorization: Bearer <ID_TOKEN>
Base URL
https://app.speedex.it/api
Available Endpoints
- Sales: GET/POST /api/sales, GET/PUT/DELETE /api/sales/{id}
- Buyers: GET/POST /api/buyers, GET/PUT/DELETE /api/buyers/{id}
- Producers: GET/POST /api/producers, GET/PUT/DELETE /api/producers/{id}
- Invoices: POST /api/invoices, GET /api/invoices/{id}
- Attachments: POST /api/attachments/upload, GET /api/attachments/{id}
- Dashboard: GET /api/dashboard/stats
- Reports: GET /api/reports/sales, GET /api/reports/buyers
Response Format
All responses are in JSON format with the following structure:
{
"statusCode": 200,
"body": {
"data": [...],
"message": "Success"
}
}
Error Handling
- 400: Bad Request - Invalid input data
- 401: Unauthorized - Missing or invalid authentication token
- 403: Forbidden - Insufficient permissions
- 404: Not Found - Resource doesn't exist
- 500: Internal Server Error - Server-side error