Overview
This node integrates with the PaySpace API, enabling users to manage various aspects of their PaySpace account programmatically. It supports a wide range of operations related to employee data, company metadata, payroll processing, and more. The node is useful for automating HR, payroll, and employee management workflows by querying or modifying PaySpace data directly from n8n.
Common scenarios include:
- Retrieving employee records or employment statuses as of specific dates.
- Creating, updating, or deleting employee-related records such as addresses, bank details, dependants, positions, claims, and attachments.
- Uploading or downloading employee photos.
- Managing payslips and payroll comments.
- Accessing company metadata or custom forms.
- Submitting workflow steps or handling employee claims.
Practical example:
- Automatically update an employee's address in PaySpace when a form is submitted in another system.
- Fetch all employees active as of a certain date to generate reports or trigger notifications.
- Upload employee photos stored in a file system to PaySpace via automation.
Properties
| Name | Meaning |
|---|---|
| Environment | Choose between "Staging" or "Production" environment to specify which PaySpace API endpoint to use. |
| Company ID | Numeric identifier of the company within PaySpace to scope API requests. |
| Api Request | Select the specific API operation to perform (e.g., get employees, update records). Options are dynamically loaded based on the selected operation. |
| Effective Date | Date/time value used for queries that require an effective date filter (e.g., fetching employment statuses or positions as of a date). |
| Employee Number | String identifier for an employee, used in some API calls like retrieving employee address. |
| ID | Identifier string used for many operations to specify the target record (e.g., EmployeeId, EmployeePositionId). |
| UserWorkflowStepId | Workflow step identifier used in workflow-related API calls. |
| Category | String category filter used when fetching collections of custom forms. |
| Period | String representing a period, used in operations like updating payslip comments. |
| Frequency | String representing frequency, also used in updating payslip comments. |
| Body (Raw) | JSON object containing the raw request body payload for create or update operations. |
| Add Params | Boolean flag indicating whether to add optional query parameters to the API request. |
| Additional Fields | Collection of optional query parameters such as orderBy, top, skip, count, select, filter, componentCodes, altLanguage to refine API queries. |
| Axios Config | Raw JSON configuration for custom HTTP requests, available only for the "customConfig" operation. |
| This node is still in beta | Notice displayed to inform users about the node's beta status. |
Output
The node outputs the response data from the PaySpace API in the json field of the output items. The structure of this JSON depends on the specific API call made but generally reflects the data returned by PaySpace endpoints, such as employee records, metadata, or operation results.
If the operation involves binary data (e.g., downloading employee photos), the node handles it accordingly, though the provided code primarily shows JSON responses. For photo upload/download, multipart/form-data is used internally.
Dependencies
- Requires an API key credential with client ID and client secret for OAuth2 token retrieval.
- Uses the PaySpace OAuth2 token endpoint to obtain bearer tokens for authorization.
- Depends on external libraries:
axiosfor HTTP requests,qsfor query string serialization, andform-datafor multipart uploads. - The node expects proper configuration of credentials and network access to PaySpace API endpoints (staging or production).
Troubleshooting
- Invalid Operation Error: If an unsupported operation or API request is specified, the node throws "Invalid Operation". Ensure the selected operation and API request are valid and supported.
- Authentication Failures: Errors during token retrieval may occur if client credentials are incorrect or missing. Verify API key credentials and permissions.
- API Rate Limits or Network Issues: Requests may fail due to rate limiting or connectivity problems. Check network access and consider retry logic.
- Malformed JSON in Body (Raw): When providing JSON payloads for create/update operations, ensure the JSON is well-formed to avoid request errors.
- Missing Required Parameters: Some API calls require specific IDs or dates; omitting these will cause errors. Double-check required fields per operation.
- Binary Data Handling: For photo upload/download, ensure the input/output data is handled correctly in upstream/downstream nodes.