Base URL
All API endpoints are relative to your application’s base URL:API structure
The API follows Next.js App Router conventions with route handlers located inapp/api/. Each directory represents an endpoint:
Request format
All API requests should use JSON formatting:Response format
API responses are returned in JSON format with appropriate HTTP status codes.Success response
Error response
Status codes
The API uses standard HTTP status codes:| Code | Description |
|---|---|
200 | OK - Request succeeded |
201 | Created - Resource created successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Authentication required |
404 | Not Found - Resource not found |
409 | Conflict - Resource already exists |
500 | Internal Server Error - Server error |
501 | Not Implemented - Feature not yet available |
Available endpoints
Invoices
Create, read, update, and delete invoices
Templates
Manage invoice templates and designs
PDF generation
Generate PDF versions of invoices
Send invoices via email
Runtime configuration
All API routes use the Node.js runtime for full access to server-side features:app/api/auth/[...nextauth]/route.ts
Error handling
All endpoints implement try-catch error handling:app/api/invoices/route.ts
Next steps
Authentication
Learn how to authenticate API requests
Invoice endpoints
Explore invoice management endpoints