Data Structure
Document Types
Paystub- Employee pay statementsW2- Annual wage and tax statements1099-MISC- Independent contractor earningsInvoice- Billing documents
Document Status
Pending- Order created but generation not startedProcessing- Document is being generatedCompleted- Document is ready for downloadFailed- Error occurred during processing
List Documents
Retrieve a paginated list of documents.Available Filters
filter[uuid]- Filter by UUIDfilter[type]- Filter by document typefilter[status]- Filter by statusfilter[order_id]- Filter by order IDfilter[company_id]- Filter by company IDfilter[employee_id]- Filter by employee IDfilter[date_from]- Filter by start datefilter[date_to]- Filter by end datesort- Sort by field (e.g.,created_at,-status)include- Include related resources (e.g.,order,company,employee)per_page- Number of items per page (default: 15)
Download Document
Download a processed document by its UUID.Document Processing Lifecycle
- Document is created as part of an order
- Initial status is
Pending - Background job picks up the document
- Status changes to
Processing - Content is processed using template
- PDF file is generated and stored
- Status updates to
CompletedorFailed - Document becomes available for download if completed
Relationships
- Order: Each document belongs to an order
- Company: Document can be associated with a company
- Employee: Document can be associated with an employee
- User: Document belongs to the user who created the order
- Site: Document belongs to a specific site
Error Handling
- 401 Unauthenticated - Invalid or missing token
- 403 Unauthorized - Insufficient permissions
- 404 Not Found - Document does not exist
- 422 Validation Error - Invalid input data
Best Practices
- Always check document status before download
- Store document UUIDs for future reference
- Handle processing errors gracefully
- Monitor document status changes
- Implement proper retry mechanisms
- Follow document type-specific content guidelines
- Use appropriate filters to find documents efficiently
Rate Limiting
Document operations are subject to rate limiting:- List operations: 60 requests per minute
- Download operations: 20 requests per minute

