Comprehensive guide to the Pay API endpoints for payroll processing, employee management, and HMRC compliance
Pay API Overview
The Pay API is the core of Flow Payroll's payroll processing capabilities. It provides comprehensive endpoints for managing employees, processing payroll runs, generating payslips, and ensuring HMRC compliance through RTI submissions.
Key Features
- Employee Management: Full lifecycle management of employee records
- Payroll Processing: Calculate and process payroll runs with accuracy
- Payslip Generation: Create and distribute digital payslips
- HMRC Compliance: RTI (Real Time Information) submissions including FPS and EPS
- Statutory Payments: Handle statutory sick pay, maternity pay, and other statutory obligations
- Court Orders: Manage attachment of earnings orders and court-ordered deductions
- Tax Calculations: Accurate gross-to-net and tax calculations
- HMRC Forms: Generate and submit P45, P60, and other required forms
API Structure
Calculator
Perform payroll calculations including:
- Gross to net calculations
- Tax and National Insurance computations
- Deduction calculations
Employees
Comprehensive employee data management:
- Create and update employee records
- Manage employment details and personal information
- Track employee history and changes
Payslips
Digital payslip management:
- Generate payslips for pay runs
- Retrieve individual or bulk payslip data
- Send payslip notifications to employees
- Access historical payslip information
RTI (Real Time Information)
HMRC compliance through real-time submissions:
FPS (Full Payment Submission):
- Submit payment and deduction information to HMRC
- Trigger FPS submissions for payroll runs
- Retrieve FPS submission status and details
EPS (Employer Payment Summary):
- Submit monthly employment balances
- Handle manual EPS submissions and corrections
- Resubmit EPS when needed
- Track EPS submission history
Statutory Payments
Manage statutory obligations:
- Calculate statutory sick pay (SSP)
- Process maternity, paternity, and adoption pay
- Retrieve statutory payment history
- Create and manage statutory payment records
Court Orders
Manage attachment of earnings orders and court-ordered deductions:
Court Order Types:
- CMS DEO (Child Maintenance Service Deduction from Earnings Order)
- AEO Priority (Attachment of Earnings Order - Priority fines/maintenance)
- AEO Non-Priority (Attachment of Earnings Order - Civil debts)
- DEA (Direct Earnings Attachment)
- CTAEO (Council Tax Attachment of Earnings Order)
- EA (Earnings Attachment)
- MCAEO (Magistrates Court Attachment of Earnings Order)
Features:
- Create and manage court orders for employees
- Track order status, balances, and payment history
- Manage court order attachments and documents
- Configure payees for court order payments
- Query orders by organisation, employee, or specific criteria
- Automatic calculation of protected earnings and deduction amounts
HMRC DPS (Data Provisioning Service)
Access HMRC data services for real-time tax information and validation.
HMRC Forms
Generate and manage HMRC required forms:
- P45 (when employees leave)
- P60 (end of year summaries)
- Other compliance forms
Getting Started
Before using the Pay API:
- Setup Organisation: Configure your organisation settings (see Organisation Setup API)
- Authentication: Obtain valid API credentials
- Employee Records: Add employee information before processing payroll
- HMRC Registration: Ensure HMRC credentials are configured for RTI submissions
Common Workflows
Processing a Payroll Run
- Add or update employee information
- Use calculator endpoints to preview calculations
- Process the payroll run
- Generate payslips
- Submit FPS to HMRC
- Send payslip notifications to employees
- Submit EPS at month-end
Managing Statutory Payments
- Calculate statutory payment eligibility
- Create statutory payment records
- Include in payroll processing
- Report to HMRC via RTI
Employee Lifecycle
- Create employee record
- Process regular payroll runs
- Handle statutory payments when needed
- Generate P45 on termination
- Issue P60 at year-end
Managing Court Orders
- Create payee record for court order recipient
- Create court order with appropriate order type and details
- Attach supporting documents if required
- Court order automatically applies deductions during payroll processing
- Track order status, balances, and payment history
- Update or discharge orders as needed
Best Practices
- Process Order: Always submit FPS before making payments to employees
- Validation: Use calculator endpoints to validate calculations before processing
- Error Handling: Implement robust error handling for HMRC submission failures
- Resubmissions: Handle RTI resubmissions appropriately when required
- Data Accuracy: Ensure employee data is accurate before RTI submissions
- Timing: Submit EPS by the 19th of each month (or by the 22nd if paying electronically)
- Court Orders: Ensure court orders are created with accurate details and proper protected earnings settings
- Order Priority: Understand priority levels when multiple court orders exist for an employee
Rate Limits
Be mindful of rate limits, especially when:
- Retrieving payslip data for multiple employees
- Processing bulk employee updates
- Making multiple RTI submissions
Support
For detailed information on individual endpoints, refer to the specific endpoint documentation. For general questions, see the Getting Started guide.
