Class: MarketingService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:9
Extends
BaseService
Constructors
Constructor
new MarketingService(
client):MarketingService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:12
Parameters
client
Returns
MarketingService
Inherited from
BaseService.constructor
Properties
client
protectedclient:TanqoryClient
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:10
Inherited from
BaseService.client
Methods
buildQuery()
protectedbuildQuery(options?):Record<string,any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:26
Build query parameters
Parameters
options?
Returns
Record<string, any>
Inherited from
BaseService.buildQuery
create()
create(
storeId,data):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:29
Create a new marketing item
Parameters
storeId
string
data
any
Returns
Promise<any>
createAutoMatchRule()
createAutoMatchRule(
storeId,data):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:147
Create auto-match rule
Parameters
storeId
string
data
any
Returns
Promise<any>
createCampaign()
createCampaign(
storeId,data):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:120
Create new campaign
Parameters
storeId
string
data
any
Returns
Promise<any>
createFromTemplate()
createFromTemplate(
storeId,templateId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:398
Create workflow from template
Parameters
storeId
string
templateId
string
Returns
Promise<any>
createWorkflow()
createWorkflow(
storeId,data):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:288
Create workflow
Parameters
storeId
string
data
actions
object[]
description?
string
name
string
trigger
{ config?: Record<string, unknown>; type: string; }
trigger.config?
Record<string, unknown>
trigger.type
string
Returns
Promise<any>
delete()
delete(
id,storeId):Promise<void>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:47
Delete a marketing item
Parameters
id
string
storeId
string
Returns
Promise<void>
deleteAutoMatchRule()
deleteAutoMatchRule(
storeId,campaignId,ruleId):Promise<void>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:161
Delete auto-match rule
Parameters
storeId
string
campaignId
string
ruleId
string
Returns
Promise<void>
deleteAutomationTask()
deleteAutomationTask(
storeId,taskId):Promise<void>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:250
Delete automation task
Parameters
storeId
string
taskId
string
Returns
Promise<void>
deleteCampaign()
deleteCampaign(
storeId,id):Promise<void>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:138
Delete campaign
Parameters
storeId
string
id
string
Returns
Promise<void>
deleteWorkflow()
deleteWorkflow(
storeId,id):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:324
Delete workflow
Parameters
storeId
string
id
string
Returns
Promise<any>
generateIdempotencyKey()
protectedgenerateIdempotencyKey(prefix):string
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:19
Generate idempotency key
Parameters
prefix
string
Returns
string
Inherited from
BaseService.generateIdempotencyKey
getAllExecutions()
getAllExecutions(
storeId,options?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:385
Get all executions across all workflows
Parameters
storeId
string
options?
limit?
number
status?
string
Returns
Promise<any>
getAttributionData()
getAttributionData(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:173
Get attribution data
Parameters
storeId
string
params?
endDate?
string
startDate?
string
Returns
Promise<any>
getAttributionTimeSeries()
getAttributionTimeSeries(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:209
Get attribution time-series data (sessions by channel over time)
Parameters
storeId
string
params?
endDate?
string
groupBy?
string
startDate?
string
Returns
Promise<any>
getAutomationTasks()
getAutomationTasks(
storeId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:230
Get automation tasks
Parameters
storeId
string
Returns
Promise<any>
getAutomationTemplates()
getAutomationTemplates(
storeId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:223
Get automation templates
Parameters
storeId
string
Returns
Promise<any>
getCampaign()
getCampaign(
storeId,id):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:100
Get single campaign
Parameters
storeId
string
id
string
Returns
Promise<any>
getCampaignAttribution()
getCampaignAttribution(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:197
Get campaign attribution
Parameters
storeId
string
params?
endDate?
string
startDate?
string
Returns
Promise<any>
getCampaignBreakdown()
getCampaignBreakdown(
storeId,id,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:107
Get campaign breakdown data (sessions/sales by channel and UTM params)
Parameters
storeId
string
id
string
params?
attributionModel?
string
endDate?
string
startDate?
string
Returns
Promise<any>
getCampaigns()
getCampaigns(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:88
Get all campaigns
Parameters
storeId
string
params?
endDate?
string
startDate?
string
Returns
Promise<any>
getChannelAttribution()
getChannelAttribution(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:185
Get channel attribution
Parameters
storeId
string
params?
attributionModel?
string
endDate?
string
startDate?
string
Returns
Promise<any>
getExportMimeType()
protectedgetExportMimeType(format):string
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:45
Get MIME type for export format
Parameters
format
string
Returns
string
Inherited from
BaseService.getExportMimeType
getMetricsSummary()
getMetricsSummary(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:56
Get marketing metrics summary
Parameters
storeId
string
params?
endDate?
string
startDate?
string
Returns
Promise<any>
getOverallStats()
getOverallStats(
storeId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:378
Get overall automation stats for dashboard
Parameters
storeId
string
Returns
Promise<any>
getRecentCampaigns()
getRecentCampaigns(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:77
Get recent campaigns
Parameters
storeId
string
params?
any
Returns
Promise<any>
getTemplates()
getTemplates(
storeId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:408
Get workflow templates (alias for listWorkflowTemplates)
Parameters
storeId
string
Returns
Promise<any>
getTopChannels()
getTopChannels(
storeId,params?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:68
Get top marketing channels
Parameters
storeId
string
params?
any
Returns
Promise<any>
getWorkflow()
getWorkflow(
storeId,id):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:281
Get workflow by ID
Parameters
storeId
string
id
string
Returns
Promise<any>
getWorkflowExecutions()
getWorkflowExecutions(
storeId,workflowId,limit?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:351
Get workflow execution history
Parameters
storeId
string
workflowId
string
limit?
number = 50
Returns
Promise<any>
getWorkflowStats()
getWorkflowStats(
storeId,workflowId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:364
Get workflow execution statistics
Parameters
storeId
string
workflowId
string
Returns
Promise<any>
list()
list(
storeId,options?):Promise<PaginatedResponse<any>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:13
List all marketing items
Parameters
storeId
string
options?
Returns
Promise<PaginatedResponse<any>>
listWorkflows()
listWorkflows(
storeId,params?,options?):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:261
List workflows
Parameters
storeId
string
params?
enabled?
boolean
limit?
number
page?
number
search?
string
triggerType?
string
options?
signal?
AbortSignal
Returns
Promise<any>
listWorkflowTemplates()
listWorkflowTemplates(
storeId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:331
List workflow templates
Parameters
storeId
string
Returns
Promise<any>
retrieve()
retrieve(
id,storeId):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:22
Get a single marketing item by ID
Parameters
id
string
storeId
string
Returns
Promise<any>
toggleAutomationTemplate()
toggleAutomationTemplate(
storeId,templateId,data):Promise<void>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:237
Toggle automation template
Parameters
storeId
string
templateId
string
data
any
Returns
Promise<void>
triggerWorkflow()
triggerWorkflow(
storeId,workflowId,payload):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:338
Trigger workflow manually
Parameters
storeId
string
workflowId
string
payload
Record<string, unknown>
Returns
Promise<any>
update()
update(
id,storeId,data):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:38
Update an existing marketing item
Parameters
id
string
storeId
string
data
any
Returns
Promise<any>
updateCampaign()
updateCampaign(
storeId,id,data):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:129
Update campaign
Parameters
storeId
string
id
string
data
any
Returns
Promise<any>
updateWorkflow()
updateWorkflow(
storeId,id,data):Promise<any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/marketing.ts:305
Update workflow
Parameters
storeId
string
id
string
data
actions?
object[]
description?
string
enabled?
boolean
name?
string
trigger?
{ config?: Record<string, unknown>; type: string; }
trigger.config?
Record<string, unknown>
trigger.type
string
Returns
Promise<any>