PUT
/
stores
/
store-employees
/
{store_id}
Link User to Store
curl --request PUT \
  --url https://api-staging.luladelivery.store/stores/store-employees/{store_id} \
  --header 'Content-Type: application/json' \
  --data '{
  "user_id": 123,
  "employee_id": "<string>"
}'
{
  "success": true,
  "employee_relationship": {
    "store_id": "<string>",
    "user_id": 123,
    "employee_id": "<string>",
    "access_level": "<string>",
    "linked_at": "<string>",
    "linked_by": "<string>"
  }
}
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

store_id
string
required
The unique identifier of the store to link the user to

Request Body

user_id
number
required
The ID of the existing user to link to the storeExample: 1000049
employee_id
string
required
The unique employee identifier (UUID format) for this user-store relationshipExample: “870a05c1-bbbf-48ab-a757-e28ae0a2b2a8”

Request Example

{
    "user_id": 1000049,
    "employee_id": "870a05c1-bbbf-48ab-a757-e28ae0a2b2a8"
}

Response

success
boolean
Indicates whether the user was successfully linked to the store
employee_relationship
object
Details of the created employee relationship

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

Prerequisites

Post-Linking Effects

Use Cases

Error Scenarios

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.