Link Store to Employee
curl --request POST \
--url https://api-staging.luladelivery.store/stores/store-employees/ \
--header 'Content-Type: application/json' \
--data '
{
"store_ids": [
{}
],
"employee_id": "<string>",
"company_id": 123,
"user_id": 123
}
'import requests
url = "https://api-staging.luladelivery.store/stores/store-employees/"
payload = {
"store_ids": [{}],
"employee_id": "<string>",
"company_id": 123,
"user_id": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({store_ids: [{}], employee_id: '<string>', company_id: 123, user_id: 123})
};
fetch('https://api-staging.luladelivery.store/stores/store-employees/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.luladelivery.store/stores/store-employees/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'store_ids' => [
[
]
],
'employee_id' => '<string>',
'company_id' => 123,
'user_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.luladelivery.store/stores/store-employees/"
payload := strings.NewReader("{\n \"store_ids\": [\n {}\n ],\n \"employee_id\": \"<string>\",\n \"company_id\": 123,\n \"user_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.luladelivery.store/stores/store-employees/")
.header("Content-Type", "application/json")
.body("{\n \"store_ids\": [\n {}\n ],\n \"employee_id\": \"<string>\",\n \"company_id\": 123,\n \"user_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.luladelivery.store/stores/store-employees/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"store_ids\": [\n {}\n ],\n \"employee_id\": \"<string>\",\n \"company_id\": 123,\n \"user_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"count": 123,
"successful_links": [
{
"store_id": "<string>",
"employee_id": "<string>",
"access_level": "<string>",
"linked_at": "<string>"
}
],
"failed_links": [
{
"store_id": "<string>",
"error": "<string>",
"error_code": "<string>"
}
]
}Store Employees
Link Store to Employee
This endpoint links multiple stores to a new employee, creating employee relationships across multiple store locations simultaneously. This is useful for employees who work across multiple stores or for managers overseeing multiple locations.
POST
/
stores
/
store-employees
/
Link Store to Employee
curl --request POST \
--url https://api-staging.luladelivery.store/stores/store-employees/ \
--header 'Content-Type: application/json' \
--data '
{
"store_ids": [
{}
],
"employee_id": "<string>",
"company_id": 123,
"user_id": 123
}
'import requests
url = "https://api-staging.luladelivery.store/stores/store-employees/"
payload = {
"store_ids": [{}],
"employee_id": "<string>",
"company_id": 123,
"user_id": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({store_ids: [{}], employee_id: '<string>', company_id: 123, user_id: 123})
};
fetch('https://api-staging.luladelivery.store/stores/store-employees/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.luladelivery.store/stores/store-employees/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'store_ids' => [
[
]
],
'employee_id' => '<string>',
'company_id' => 123,
'user_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.luladelivery.store/stores/store-employees/"
payload := strings.NewReader("{\n \"store_ids\": [\n {}\n ],\n \"employee_id\": \"<string>\",\n \"company_id\": 123,\n \"user_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.luladelivery.store/stores/store-employees/")
.header("Content-Type", "application/json")
.body("{\n \"store_ids\": [\n {}\n ],\n \"employee_id\": \"<string>\",\n \"company_id\": 123,\n \"user_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.luladelivery.store/stores/store-employees/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"store_ids\": [\n {}\n ],\n \"employee_id\": \"<string>\",\n \"company_id\": 123,\n \"user_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"count": 123,
"successful_links": [
{
"store_id": "<string>",
"employee_id": "<string>",
"access_level": "<string>",
"linked_at": "<string>"
}
],
"failed_links": [
{
"store_id": "<string>",
"error": "<string>",
"error_code": "<string>"
}
]
}This endpoint creates employee relationships between a new employee and multiple stores in a single operation. It’s particularly useful for multi-store employees, area managers, or support staff who need access to multiple store locations.
Request Body
array
required
Array of store IDs to link the employee toExample: [“b2b56ffb-e198-49f3-a1bc-f36ac70f9501”, “d7c17a59-01e1-48f2-a326-2bbd3c888205”]
string
required
The unique employee identifier (UUID format) for this employeeExample: “30523fd1-e108-41d0-a02d-f5907336f2e4”
number
required
The company ID that owns the stores being linkedExample: 1000022
number
required
The user ID of the employee being linked to storesExample: 1000305
Request Example
{
"store_ids": [
"b2b56ffb-e198-49f3-a1bc-f36ac70f9501",
"d7c17a59-01e1-48f2-a326-2bbd3c888205",
"449235c1-3d04-4519-998b-40d2a621e5e0"
],
"employee_id": "30523fd1-e108-41d0-a02d-f5907336f2e4",
"company_id": 1000022,
"user_id": 1000305
}
Response
number
Number of stores successfully linked to the employee
array
array
Response Example
{
"count": 2,
"successful_links": [
{
"store_id": "b2b56ffb-e198-49f3-a1bc-f36ac70f9501",
"employee_id": "30523fd1-e108-41d0-a02d-f5907336f2e4",
"access_level": "store_employee",
"linked_at": "2024-11-15T10:30:00.000Z"
},
{
"store_id": "d7c17a59-01e1-48f2-a326-2bbd3c888205",
"employee_id": "30523fd1-e108-41d0-a02d-f5907336f2e4",
"access_level": "store_employee",
"linked_at": "2024-11-15T10:30:01.000Z"
}
],
"failed_links": [
{
"store_id": "449235c1-3d04-4519-998b-40d2a621e5e0",
"error": "Store not found or not accessible",
"error_code": "STORE_NOT_FOUND"
}
]
}
Multi-Store Employee Types
Common Multi-Store Employee Roles
Common Multi-Store Employee Roles
role
Manages operations across multiple store locations
Typically needs manager-level access to all assigned stores
role
Oversees store performance and compliance across a region
May need administrative access for reporting and auditing
role
Works at different stores as needed for coverage
Usually assigned basic employee access to maintain flexibility
role
Provides technical or operational support across multiple locations
Access should be limited to specific functions they support
role
Conducts training programs at multiple store locations
May need temporary elevated access for training purposes
Batch Operation Benefits
Advantages of Multi-Store Linking
Advantages of Multi-Store Linking
benefit
Create multiple employee relationships in a single API call
Reduces API calls and improves performance
benefit
Ensures consistent access levels across all linked stores
Reduces configuration errors and access inconsistencies
benefit
Either all stores link successfully or the operation fails safely
Prevents partial failures that could cause access issues
benefit
Creates comprehensive audit log for multi-store employee setup
Important for compliance and security tracking
Validation and Error Handling
Operation Validation
Operation Validation
validation
All store_ids must belong to the specified company_id
Cross-company linking is not permitted for security
validation
All stores must be active and accessible to the requesting user
Inactive or restricted stores will be skipped
validation
Employee ID must be unique across the system
Prevents conflicts and ensures proper identification
validation
User ID must correspond to an existing, active user
Verify user exists before attempting multi-store linking
Use Cases
When to Use This Endpoint
When to Use This Endpoint
use-case
Set up area managers or regional supervisors with access to multiple stores
Common during leadership team expansion
use-case
Create flexible staff assignments for busy periods
Allows employees to work at multiple locations as needed
use-case
Grant technical or operational support teams access to multiple stores
Useful for maintenance, training, or technical support roles
use-case
Set up franchise owners or operators with access to all their locations
Ensure proper authorization for franchise relationships
Error Recovery
Handling Partial Failures
Handling Partial Failures
recovery
Check failed_links array to identify stores that didn’t link successfully
Common failures include inactive stores or permission issues
recovery
Use single-store linking endpoint for failed stores after resolving issues
May require different access levels or additional permissions
recovery
Confirm that successful links provide the expected access
Test access to ensure employee can perform required functions
Partial Success Handling: This endpoint can succeed partially - some stores may link successfully while others fail. Always check both the count and failed_links array.
Company Security: All stores must belong to the same company for security reasons. Cross-company employee access requires separate authorization processes.
Performance Consideration: While efficient for multiple stores, very large store lists may take longer to process. Consider batching for extremely large operations.

