PaySpace icon

PaySpace

Use PaySpace API to manage your PaySpace account

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 information, lookups, file uploads, and webhooks.

A common use case is automating HR and payroll workflows, such as retrieving employee records, updating employment statuses, managing payslips, or handling webhook error logs. For example, a user could automate fetching all employees as of a certain effective date or upload an employee's photo directly from a workflow.

The "Webhooks" operation specifically allows querying webhook error logs for a given company within a specified date range, which is useful for monitoring and troubleshooting webhook integrations.

Properties

Name Meaning
Environment Selects the environment to query: Staging or Production.
Company ID The numeric identifier of the company in PaySpace to operate on.
Api Request (api) Specifies the particular API endpoint related to the operation. Options depend on the selected operation and endpoint.
Effective Date A date-time value used to filter collections as of a specific effective date (used in some employee-related APIs).
Employee Number The employee number associated with certain API calls (e.g., getting an employee address).
ID Identifier for specific records, e.g., EmployeeId or EmployeePositionId, depending on the API requested.
UserWorkflowStepId Workflow step identifier used in workflow-related API calls.
Category Category string used to filter custom forms by category.
Period Period value used in payslip comment updates (from CompanyRun lookup).
Frequency Frequency value used in payslip comment updates (from CompanyFrequency lookup).
Body (Raw) (assignments) JSON object containing the raw request body for create or update operations. Fields depend on the API endpoint; refer to PaySpace API documentation for details.
Add Params Boolean flag indicating whether to add optional additional query parameters.
Additional Fields Optional collection of query parameters that can include:
- Order By (string): Specifies ordering.
- Top (number): Limits number of items returned.
- Skip (number): Skips a number of items.
- Count (boolean): Return only count.
- Select (string): Fields to return.
- Filter (string): OData filter expression.
- componentCodes (string): Comma-separated list of component codes.
- altLanguage (boolean): Retrieve payslip components in alternative language.

Output

The node outputs the JSON response received from the PaySpace API corresponding to the requested operation. The structure of the json output depends on the specific API endpoint called and typically includes the requested data objects, metadata, or status information.

For example, when querying employee collections, the output will be an array of employee records; when creating or updating records, it will contain the created/updated entity details; and for webhook errors, it will include error log entries.

If the operation involves binary data (such as downloading employee photos or payslip PDFs), the node handles the binary content accordingly, allowing further processing or saving within n8n workflows.

Dependencies

  • Requires an API authentication token obtained via client credentials (client ID and secret).
  • Uses OAuth2 token endpoints for authentication.
  • Depends on external HTTP requests to PaySpace API endpoints.
  • Requires proper configuration of credentials in n8n with valid client ID and secret.
  • Uses Axios for HTTP requests and qs for query string serialization internally.

Troubleshooting

  • Authentication Errors: If the node fails to authenticate, verify that the client ID and secret are correct and that the API credentials have appropriate permissions.
  • Invalid Operation: The node throws "Invalid Operation" if an unsupported or misspelled operation is selected.
  • Missing Required Parameters: Some API calls require specific IDs or dates; ensure these are provided to avoid errors.
  • API Rate Limits or Network Issues: Network failures or rate limiting by PaySpace API may cause request failures; retry or check API usage limits.
  • Malformed JSON in Body (Raw): When providing JSON in the "Body (Raw)" field, ensure it is correctly formatted to prevent request errors.
  • Webhook Query Errors: For the Webhooks operation, ensure date ranges and page numbers are valid and that the company ID is correct.

Links and References

Discussion