Link Campaign to Stores
curl --request GET \
--globoff \
--url 'https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores'import requests
url = "https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores', 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.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"campaign_id": "<string>",
"campaign_name": "<string>",
"total_associated_stores": 123,
"store_associations": [
{
"store_id": "<string>",
"store_name": "<string>",
"store_type": "<string>",
"region": "<string>",
"association_status": "<string>",
"linked_at": "<string>",
"last_updated": "<string>",
"store_specific_config": {
"custom_messaging": "<string>",
"local_promotions": [
{}
],
"display_settings": {},
"scheduling_overrides": {}
}
}
],
"association_summary": {
"by_status": {},
"by_store_type": {},
"by_region": {},
"performance_overview": {}
}
}Campaigns
Link Campaign to Stores
Retrieve and manage the association between campaigns and store locations, including store-specific campaign configurations.
GET
{stores_service_api_base_url}
/
stores
/
company
/
{company_id}
/
campaigns
/
{campaign_id}
/
stores
Link Campaign to Stores
curl --request GET \
--globoff \
--url 'https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores'import requests
url = "https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores', 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.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{stores_service_api_base_url}}/stores/company/{{company_id}}/campaigns/{{campaign_id}}/stores")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"campaign_id": "<string>",
"campaign_name": "<string>",
"total_associated_stores": 123,
"store_associations": [
{
"store_id": "<string>",
"store_name": "<string>",
"store_type": "<string>",
"region": "<string>",
"association_status": "<string>",
"linked_at": "<string>",
"last_updated": "<string>",
"store_specific_config": {
"custom_messaging": "<string>",
"local_promotions": [
{}
],
"display_settings": {},
"scheduling_overrides": {}
}
}
],
"association_summary": {
"by_status": {},
"by_store_type": {},
"by_region": {},
"performance_overview": {}
}
}This endpoint manages the relationship between campaigns and store locations, allowing you to see which stores are associated with a campaign and manage store-specific campaign configurations.
Campaign-store associations determine where campaigns are active and visible to customers. Each association can have store-specific settings and configurations.
Path Parameters
string
required
The unique identifier of the company that owns the campaign
string
required
The unique identifier of the campaign to retrieve store associations for
Query Parameters
string
Filter associations by status: “active”, “inactive”, “pending”
string
Filter by store type: “retail”, “online”, “franchise”, “corporate”
string
Filter stores by geographical region
boolean
default:"false"
Include store-specific campaign configurations in the response
Response
string
The campaign identifier
string
Name of the campaign
integer
Total number of stores associated with this campaign
array
Array of store association details
Show Store Association Object
Show Store Association Object
string
Unique store identifier
string
Store display name
string
Store classification (retail, online, franchise, corporate)
string
Geographical region of the store
string
Status of the campaign-store association
string
Timestamp when the association was created
string
Timestamp of the last association update
object
Response Example
{
"campaign_id": "1000010",
"campaign_name": "Spring Fresh Campaign",
"total_associated_stores": 15,
"store_associations": [
{
"store_id": "store_001",
"store_name": "Downtown Location",
"store_type": "retail",
"region": "Northeast",
"association_status": "active",
"linked_at": "2025-04-14T01:00:00.000Z",
"last_updated": "2025-04-14T01:00:00.000Z",
"store_specific_config": {
"custom_messaging": "Spring Fresh - Now Available Downtown!",
"local_promotions": ["LOCAL10", "DOWNTOWN15"],
"display_settings": {
"banner_position": "header",
"highlight_color": "#00FF00"
},
"scheduling_overrides": {
"extended_hours": true,
"weekend_only": false
}
}
},
{
"store_id": "store_002",
"store_name": "Mall Location",
"store_type": "retail",
"region": "Northeast",
"association_status": "active",
"linked_at": "2025-04-14T01:15:00.000Z",
"last_updated": "2025-04-14T01:15:00.000Z"
}
],
"association_summary": {
"by_status": {
"active": 12,
"inactive": 2,
"pending": 1
},
"by_store_type": {
"retail": 10,
"online": 3,
"franchise": 2
},
"by_region": {
"Northeast": 8,
"Southeast": 4,
"West": 3
},
"performance_overview": {
"total_campaign_views": 5420,
"total_conversions": 324,
"average_conversion_rate": 5.97
}
}
}
Association Management
Association Management
Store Selection Strategies:
- Geographic Targeting: Associate campaigns with stores in specific regions
- Store Type Targeting: Target specific store formats (retail, online, franchise)
- Performance-Based: Associate with high-performing store locations
- Test Markets: Use select stores for campaign testing before full rollout
- Custom Messaging: Store-specific campaign messaging and branding
- Local Promotions: Store-exclusive promotional codes and offers
- Display Settings: Store-specific visual presentation preferences
- Scheduling: Store-specific timing and duration adjustments
Store-Specific Configurations: Each store can have unique campaign settings while maintaining the overall campaign structure. This allows for localized marketing while maintaining brand consistency.
Performance Tracking: Use the association summary data to identify which store types or regions are performing best with the campaign, helping optimize future campaign targeting.
Use Cases
Campaign-Store Association Use Cases
Campaign-Store Association Use Cases
Regional Campaign Management
- Roll out campaigns to specific geographical regions
- Test campaigns in select markets before wider deployment
- Customize campaigns for local preferences and regulations
- Identify which stores are most effective for campaigns
- Compare campaign performance across store types
- Optimize store selection for future campaigns
- Create store-specific messaging and promotions
- Adjust campaign timing for local events and preferences
- Customize visual presentation for different store formats
- Monitor real-time performance across associated stores
- Adjust store associations based on performance data
- Scale successful campaigns to additional store locations
Error Responses
Common Error Scenarios
Common Error Scenarios
Campaign Not FoundNo Store AssociationsAccess Denied
{
"error": "Campaign not found",
"message": "The specified campaign does not exist",
"code": "CAMPAIGN_NOT_FOUND"
}
{
"campaign_id": "1000010",
"campaign_name": "Spring Fresh Campaign",
"total_associated_stores": 0,
"store_associations": [],
"message": "No stores are currently associated with this campaign"
}
{
"error": "Access denied",
"message": "You do not have permission to view store associations for this campaign",
"code": "ACCESS_DENIED"
}
Privacy Considerations: Store association data may include sensitive business information about store performance and configurations. Ensure appropriate access controls are in place.
Managing Associations
Association Management Operations
Association Management Operations
Adding Store Associations
- Use POST endpoint to create new campaign-store associations
- Specify store-specific configurations during creation
- Bulk association operations for multiple stores
- Modify store-specific campaign settings
- Update association status (activate/deactivate)
- Adjust scheduling and display preferences
- Deactivate campaign for specific stores
- Remove associations while preserving historical data
- Bulk removal operations for campaign cleanup
- Track campaign effectiveness per store
- Identify underperforming associations
- Optimize based on store-specific analytics

