This endpoint creates an employee relationship between an existing user and a store. It’s essential for managing store staff access and ensuring employees have the proper permissions to operate within their assigned stores.
Path Parameters
The unique identifier of the store to link the user to
Request Body
The ID of the existing user to link to the store Example: 1000049
The unique employee identifier (UUID format) for this user-store relationship Example: “870a05c1-bbbf-48ab-a757-e28ae0a2b2a8”
Request Example
{
"user_id" : 1000049 ,
"employee_id" : "870a05c1-bbbf-48ab-a757-e28ae0a2b2a8"
}
Response
Indicates whether the user was successfully linked to the store
Details of the created employee relationship Show Employee Relationship Object
The store ID the user is now linked to
The user ID that was linked
The employee identifier for this relationship
Access level granted to the employee
When the link was created (ISO 8601 format)
User ID of who created this link
Response Example
{
"success" : true ,
"employee_relationship" : {
"store_id" : "7669f473-6c40-45ee-8737-43c667407b3a" ,
"user_id" : 1000049 ,
"employee_id" : "870a05c1-bbbf-48ab-a757-e28ae0a2b2a8" ,
"access_level" : "store_employee" ,
"linked_at" : "2024-11-15T10:30:00.000Z" ,
"linked_by" : "1000001"
}
}
Employee Access Levels
Basic store employee access - can process orders and manage inventory Standard access for front-line employees
Store manager access - can manage employees and store settings Elevated access for store management personnel
Administrative access - full control over store operations High-level access should be granted carefully
Restricted access for specific functions only Useful for part-time or specialized roles
Prerequisites
The user_id must correspond to an existing user in the system Users must be created before they can be linked to stores
The employee_id should be a valid UUID format Invalid UUID formats will be rejected
The target store should be active and properly configured Linking to inactive stores may cause access issues
Requesting user must have permission to manage store employees Typically requires store manager or admin level access
Post-Linking Effects
What Happens After Linking
User gains access to store-specific functions and data Access is immediate upon successful linking
User is assigned appropriate role-based permissions Permissions are based on the assigned access level
Employee relationship is logged for compliance and tracking All employee changes are tracked for security purposes
User appears in store employee lists and management interfaces Integration with POS and management systems is automatic
Use Cases
When to Use This Endpoint
Link new hires to their assigned store locations Part of the standard employee onboarding process
Move existing employees between store locations May require unlinking from previous store first
Assign employees to stores for temporary coverage Can be reversed when temporary assignment ends
Grant specific users access to store operations Ensure access levels match job responsibilities
Error Scenarios
The specified user_id doesn’t exist Status Code: 404Solution: Verify user ID or create user first
The specified store_id doesn’t exist Status Code: 404
User is already linked to this store Status Code: 409Solution: Update existing relationship instead
The employee_id format is invalid Status Code: 400Solution: Ensure employee_id is a valid UUID
User lacks permission to link employees to stores Status Code: 403
Immediate Access: Once successfully linked, users gain immediate access to store functions based on their assigned access level.
Security Consideration: Ensure employee IDs are unique and securely generated to prevent unauthorized access or conflicts.
Audit Compliance: All employee linking activities are logged for security audits and compliance requirements.