Marketing
Automation
Section titled “Automation”A rule that acts on its own — trigger, condition, action.
Deliberately narrow: a fixed set of triggers and actions rather than a general workflow engine. A merchant wants abandoned-cart recovery and a review request, not a programming language, and the general engine belongs to the app platform where it can be sandboxed.
ID!
No description.
version
Section titled “version”Version!
No description.
String!
No description.
trigger
Section titled “trigger”AutomationTrigger!
No description.
delayMinutes
Section titled “delayMinutes”Int!
How long after the trigger to act. Zero fires immediately.
conditions
Section titled “conditions”[AutomationCondition!]!
No description.
actions
Section titled “actions”[AutomationAction!]!
No description.
isActive
Section titled “isActive”Boolean!
No description.
statistics
Section titled “statistics”AutomationStatistics!
How often it has fired, and what came of it.
createdAt
Section titled “createdAt”DateTime!
No description.
updatedAt
Section titled “updatedAt”DateTime!
No description.
AutomationAction
Section titled “AutomationAction”One thing an automation does.
AutomationActionKind!
No description.
template
Section titled “template”MessageTemplate
The template, for a message action.
discountId
Section titled “discountId”ID
A discount to mint and include, for a recovery message.
String
A tag to apply, for a tagging action.
AutomationActionInput
Section titled “AutomationActionInput”One action.
AutomationActionKind!
No description.
templateId
Section titled “templateId”ID
No description.
discountId
Section titled “discountId”ID
No description.
String
No description.
amount
Section titled “amount”MoneyInput
No description.
AutomationActionKind
Section titled “AutomationActionKind”What an automation can do.
| Value | Meaning |
|---|---|
SEND_MESSAGE | No description. |
ISSUE_DISCOUNT | Mint a single-use discount code and include it in the message. |
ADD_CUSTOMER_TAG | No description. |
ADD_ORDER_TAG | No description. |
GRANT_STORE_CREDIT | Grant store credit — a goodwill gesture after a late delivery. |
NOTIFY_STAFF | Raise it for a person to look at: an entry in the shop’s notifications, naming the automation. One entry per automation, kept current, so a busy rule is one line. It messages nobody and costs no credit. |
AutomationCondition
Section titled “AutomationCondition”One condition on an automation: one of the values its trigger carries, compared.
Only EQUALS, NOT_EQUALS, GREATER_THAN, LESS_THAN and CONTAINS compare
a trigger’s value; a segment rule’s relative windows and presence tests do not,
and are refused.
String!
No description.
operator
Section titled “operator”SegmentRuleOperator!
No description.
String!
No description.
AutomationConditionInput
Section titled “AutomationConditionInput”One condition.
String!
No description.
operator
Section titled “operator”SegmentRuleOperator!
No description.
String!
No description.
AutomationInput
Section titled “AutomationInput”An automation to create or change.
String
No description.
trigger
Section titled “trigger”AutomationTrigger
No description.
delayMinutes
Section titled “delayMinutes”Int
No description.
conditions
Section titled “conditions”[AutomationConditionInput!]
On an update, left out leaves the conditions as they are, and an empty list clears them, making the automation unconditional.
actions
Section titled “actions”[AutomationActionInput!]
No description.
isActive
Section titled “isActive”Boolean
No description.
AutomationPayload
Section titled “AutomationPayload”What the automation mutations return.
automation
Section titled “automation”Automation
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
AutomationStatistics
Section titled “AutomationStatistics”How an automation has performed.
attributedOrderCount, attributedRevenue and cost are refused: sales
are not attributed yet, as for a campaign, and what its messages cost is not
totalled yet.
triggeredCount
Section titled “triggeredCount”Int!
No description.
messagesSent
Section titled “messagesSent”Int!
No description.
attributedOrderCount
Section titled “attributedOrderCount”Int!
Refused until link or discount-code tracking exists.
attributedRevenue
Section titled “attributedRevenue”Money!
Refused, as attributedOrderCount is.
Money!
What the messages cost. The other half of whether it is worth running. Refused: it is not totalled yet.
AutomationTrigger
Section titled “AutomationTrigger”What starts an automation.
| Value | Meaning |
|---|---|
CART_ABANDONED | A cart was left. The commonest automation, and the one that pays for itself. |
ORDER_PLACED | No description. |
ORDER_DELIVERED | No description. |
CUSTOMER_CREATED | No description. |
FIRST_ORDER | A buyer’s first order — a welcome, or a second-purchase nudge. |
CUSTOMER_LAPSED | Nothing bought for N days. |
BACK_IN_STOCK | No description. |
PRODUCT_LOW_STOCK | No description. |
REVIEW_RECEIVED | No description. |
PAYMENT_LINK_UNPAID | A payment link was sent and not paid. The chase. |
ORDER_CANCELLED | An order was cancelled. A test order fires nothing. |
RECEIPT_APPROVED | A card-to-card receipt was approved, so the buyer knows the goods are moving. |
RECEIPT_REJECTED | A card-to-card receipt was rejected, with the reason the buyer can act on. |
PAYMENT_LINK_SENT | A payment link was sent for what an order still owes. |
Campaign
Section titled “Campaign”A message the merchant sends to many people at once.
ID!
No description.
version
Section titled “version”Version!
No description.
String!
No description.
channel
Section titled “channel”MarketingChannel!
No description.
status
Section titled “status”CampaignStatus!
No description.
audience
Section titled “audience”CampaignAudience!
Who it goes to.
template
Section titled “template”MessageTemplate!
What is sent.
estimatedReach
Section titled “estimatedReach”CampaignReach!
How many will actually receive it, after consent and line type are applied.
Not the audience size. A promotional campaign to twelve thousand opted-in customers reaches the fraction who have not blocked promotional SMS at the operator, and a merchant seeing only the twelve thousand will misjudge every campaign they ever run.
estimatedCost
Section titled “estimatedCost”Money!
What it will cost, at the current per-message rate.
results
Section titled “results”CampaignResults
What happened, once it has run.
scheduledFor
Section titled “scheduledFor”DateTime
When to send. Null means send on campaignSend.
sentAt
Section titled “sentAt”DateTime
No description.
completedAt
Section titled “completedAt”DateTime
No description.
createdBy
Section titled “createdBy”StaffMember
The staff member who created it, read from the shop’s staff.
Null for a person signed into the admin, whose actor is an account rather
than a membership, and for an app. author names whoever it was in every
case.
author
Section titled “author”AuditActor
Who created it, as they were named when they did — a staff member, an app — the way an audit line names its actor. Null on a campaign created before the name was kept.
createdAt
Section titled “createdAt”DateTime!
No description.
CampaignAudience
Section titled “CampaignAudience”Who a campaign goes to.
CampaignAudienceKind!
No description.
segment
Section titled “segment”CustomerSegment
No description.
customerIds
Section titled “customerIds”[ID!]!
Explicit recipients, for a small hand-picked send.
Int!
How many are in the audience before consent and line type are applied.
CampaignAudienceKind
Section titled “CampaignAudienceKind”How a campaign’s audience is chosen.
| Value | Meaning |
|---|---|
SEGMENT | No description. |
CUSTOMER_LIST | No description. |
ALL_SUBSCRIBERS | Everybody in the shop who agreed to be messaged on the campaign’s channel. Not a segment: it names nothing, and is resolved for this shop when it is previewed and again, once, when the campaign starts sending. Give neither segmentId nor customerIds with it. |
CampaignConnection
Section titled “CampaignConnection”A page of campaigns.
[CampaignEdge!]!
No description.
[Campaign!]!
No description.
pageInfo
Section titled “pageInfo”PageInfo!
No description.
totalCount
Section titled “totalCount”Int
How many match across every page — when this page is the whole result. Null otherwise: the service behind this list does not count, and a number made up here would be a wrong one that looks right.
CampaignEdge
Section titled “CampaignEdge”One campaign, with its cursor.
cursor
Section titled “cursor”String!
No description.
Campaign!
No description.
CampaignFilter
Section titled “CampaignFilter”A filter on the campaign list.
status
Section titled “status”[CampaignStatus!]
No description.
channel
Section titled “channel”[MarketingChannel!]
No description.
sentAfter
Section titled “sentAfter”DateTime
No description.
CampaignInput
Section titled “CampaignInput”A campaign to create.
String!
No description.
channel
Section titled “channel”MarketingChannel
No description.
templateId
Section titled “templateId”ID!
No description.
audienceKind
Section titled “audienceKind”CampaignAudienceKind!
No description.
segmentId
Section titled “segmentId”ID
No description.
customerIds
Section titled “customerIds”[ID!]
No description.
scheduledFor
Section titled “scheduledFor”DateTime
No description.
CampaignPayload
Section titled “CampaignPayload”What the campaign mutations return.
campaign
Section titled “campaign”Campaign
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
CampaignReach
Section titled “CampaignReach”How many a campaign will actually reach, and why the rest will not.
audienceSize
Section titled “audienceSize”Int!
The audience, before anything is subtracted.
excludedNoConsent
Section titled “excludedNoConsent”Int!
Excluded for not having agreed to marketing on this channel: those who opted out or unsubscribed from everything, and those who were never asked.
Marketing goes only to customers who agreed to it, and this counts everybody
else in the audience. Zero for ALL_SUBSCRIBERS, whose audience is the people
who agreed.
excludedNoAddress
Section titled “excludedNoAddress”Int!
Excluded for having no usable address on this channel — no mobile, no email.
excludedBlockedPromotional
Section titled “excludedBlockedPromotional”Int!
Excluded because they have blocked promotional SMS at the operator.
Zero on a service line. The dominant subtraction on a promotional one, and the number a merchant needs to see before they budget.
excludedFrequencyCap
Section titled “excludedFrequencyCap”Int!
Excluded for having received too many messages from this shop recently.
reachable
Section titled “reachable”Int!
What is left.
CampaignResults
Section titled “CampaignResults”What a campaign achieved, once it has started sending.
Sent, delivered and failed come from the operator’s delivery receipts, as they arrive: a message handed over a minute ago is sent and not yet delivered. Sales are not attributed yet. Which orders a campaign caused needs link or discount-code tracking, which is not built; the fields that would say so are refused rather than answered with a number that looks right and is not.
sentCount
Section titled “sentCount”Int!
Handed to the provider and not refused: sent, delivered or failed.
deliveredCount
Section titled “deliveredCount”Int!
Confirmed delivered by the operator’s receipt.
failedCount
Section titled “failedCount”Int!
Handed over and not delivered — a dead number, a blocked line, no receipt in
time — or taken and never carried by any provider. One a provider carried is
charged; one no provider carried is given back, and segmentsCharged is net
of it.
skippedCount
Section titled “skippedCount”Int!
Never handed over, each with a reason: no consent, no number, the promotional block, the frequency cap, a suppression, or a refusal at hand-over.
pendingCount
Section titled “pendingCount”Int!
Not reached yet: a send in progress, or one that stopped and will resume.
segmentsCharged
Section titled “segmentsCharged”Int!
What it was charged, in SMS segments.
clickCount
Section titled “clickCount”Int!
Link opens, where the message carried a shortened link.
The only engagement signal SMS gives. There is no open rate. Refused until links are tracked.
attributedOrderCount
Section titled “attributedOrderCount”Int!
Orders the platform could attribute back to this campaign. Refused until link or discount-code tracking exists.
attributedRevenue
Section titled “attributedRevenue”Money!
Refused, as attributedOrderCount is.
actualCost
Section titled “actualCost”Money!
What it cost: segmentsCharged at the rate per segment when it started
sending.
Credit is bought and spent in segments, so this is a valuation of what was spent, not a sum of what each purchase was paid at.
unsubscribeCount
Section titled “unsubscribeCount”Int!
Recipients who opted out because of it.
Worth surfacing beside the revenue: a campaign that earns twenty million toman and costs four hundred subscribers was not a good campaign. Refused: an opt-out is not traced to the message that preceded it.
CampaignSendPayload
Section titled “CampaignSendPayload”What campaignSend returns.
campaign
Section titled “campaign”Campaign
No description.
userErrors
Section titled “userErrors”[UserError!]!
Why it could not send.
NOT_ENTITLED when there is not enough credit — params.creditsNeeded and
params.creditsRemaining say how far short. INVALID_STATE when the
template is awaiting provider approval.
CampaignStatus
Section titled “CampaignStatus”Where a campaign stands.
| Value | Meaning |
|---|---|
DRAFT | No description. |
SCHEDULED | No description. |
SENDING | No description. |
SENT | No description. |
PARTIALLY_SENT | Ran out of credit, or the provider stopped accepting. Some recipients got it. A real state rather than an error: prepaid credit runs out mid-send, and a merchant needs to know exactly who was reached before topping up and resuming. |
CANCELLED | No description. |
FAILED | Could not start at all — no credit, no sender line, an unapproved template. |
MessageTemplate
Section titled “MessageTemplate”A message the shop can send, transactional or marketing.
Transactional templates are the ones that matter most and get the least attention: the SMS confirming an order, the one carrying a tracking number, the one saying a card-to-card receipt was approved.
ID!
No description.
version
Section titled “version”Version!
No description.
String!
No description.
channel
Section titled “channel”MarketingChannel!
No description.
MessageTemplateKind!
No description.
lineType
Section titled “lineType”SmsLineType!
Which sender line it goes over. The field that decides whether it arrives.
A transactional template on a promotional line is a broken shop: the order confirmation reaches three in ten buyers.
String!
The body, with {{ }} placeholders.
availableVariables
Section titled “availableVariables”[String!]!
What may be interpolated — order.number, customer.firstName,
shipment.trackingNumber.
Declared rather than free-form so the editor can offer them and a typo is a validation error rather than a message reading “سفارش ارسال شد”.
trigger
Section titled “trigger”MessageTrigger
The event that fires it, for a transactional template.
approvalStatus
Section titled “approvalStatus”TemplateApprovalStatus!
Whether the provider has approved the template.
Iranian SMS providers pre-approve promotional message bodies. An unapproved template cannot send, and finding that out at send time is how a Nowruz campaign misses Nowruz.
approvalNote
Section titled “approvalNote”String
No description.
estimatedSegments
Section titled “estimatedSegments”Int!
Roughly how many SMS segments one message costs, given Persian text.
isActive
Section titled “isActive”Boolean!
No description.
updatedAt
Section titled “updatedAt”DateTime!
No description.
MessageTemplateInput
Section titled “MessageTemplateInput”A template to create or change. Partial on update.
String
No description.
channel
Section titled “channel”MarketingChannel
No description.
MessageTemplateKind
No description.
lineType
Section titled “lineType”SmsLineType
Ignored for a TRANSACTIONAL template, which always rides a service line.
Stated rather than merely defaulted: a merchant who puts an order confirmation on a promotional line has broken their shop for seven buyers in ten, and the API should not let them.
String
No description.
trigger
Section titled “trigger”MessageTrigger
No description.
isActive
Section titled “isActive”Boolean
No description.
MessageTemplateKind
Section titled “MessageTemplateKind”What kind of message a template is.
| Value | Meaning |
|---|---|
TRANSACTIONAL | Fired by something happening. Rides a service line. |
MARKETING | Sent because the merchant chose to. Rides a promotional line. |
MessageTemplatePayload
Section titled “MessageTemplatePayload”What the template mutations return.
template
Section titled “template”MessageTemplate
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
MessageTemplateTestPayload
Section titled “MessageTemplateTestPayload”What messageTemplateTest returns.
template
Section titled “template”MessageTemplate
The template tested. Null beside a refusal.
renderedBody
Section titled “renderedBody”String
The words that were sent, every placeholder filled with its sample value. Null beside a refusal.
segmentsCharged
Section titled “segmentsCharged”Int
What the test was charged, in SMS segments: what the courier counted, and 0 when it took the message and the number had blocked promotional texts. The same on a replayed press, which is charged nothing more. Null beside a refusal.
userErrors
Section titled “userErrors”[UserError!]!
No description.
MessageTemplateVariableInput
Section titled “MessageTemplateVariableInput”One placeholder’s sample value for messageTemplateTest, by the name the body
uses: order_number for {{ order_number }}.
String!
No description.
String!
No description.
MessageTrigger
Section titled “MessageTrigger”What fires a transactional message.
| Value | Meaning |
|---|---|
ORDER_PLACED | No description. |
ORDER_PAID | No description. |
ORDER_CANCELLED | No description. |
ORDER_SHIPPED | No description. |
ORDER_DELIVERED | No description. |
RECEIPT_APPROVED | A card-to-card receipt was approved, so the buyer knows the goods are moving. |
RECEIPT_REJECTED | No description. |
REFUND_ISSUED | No description. |
PAYMENT_LINK_SENT | A payment link on a draft order. |
RETURN_APPROVED | No description. |
GIFT_CARD_ISSUED | No description. |
ABANDONED_CART | No description. |
BACK_IN_STOCK | No description. |
REVIEW_REQUEST | Not yet: nothing asks a buyer for a review, so nothing fires it. Refused as unknown, and not offered. |
LOW_STOCK_ALERT | No description. |
OrderTextSettings
Section titled “OrderTextSettings”Whether each of Kaladan’s automatic order texts is sent. Both on by default.
cancelled
Section titled “cancelled”Boolean!
“Your order was cancelled”, when an order is cancelled.
receiptRejected
Section titled “receiptRejected”Boolean!
“Your receipt was rejected”, when a transfer receipt is rejected.
OrderTextSettingsInput
Section titled “OrderTextSettingsInput”Kaladan’s automatic order texts to switch on or off. A field left out is unchanged.
cancelled
Section titled “cancelled”Boolean
No description.
receiptRejected
Section titled “receiptRejected”Boolean
No description.
OrderTextSettingsPayload
Section titled “OrderTextSettingsPayload”What orderTextSettingsUpdate returns.
orderTexts
Section titled “orderTexts”OrderTextSettings
The switches as they now stand. Null beside a refusal.
userErrors
Section titled “userErrors”[UserError!]!
No description.
SenderLine
Section titled “SenderLine”One sender number the shop can send from.
number
Section titled “number”String!
No description.
SmsLineType!
No description.
dedicated
Section titled “dedicated”Boolean!
A dedicated line, or one shared across shops.
isActive
Section titled “isActive”Boolean!
No description.
SmsBalance
Section titled “SmsBalance”Prepaid SMS credit.
Metered per segment rather than per message: Persian text encodes as UCS-2, so a message runs to about seventy characters a segment and a chatty template costs three times what its author assumed.
creditsRemaining
Section titled “creditsRemaining”Int!
Segments remaining.
ratePerSegment
Section titled “ratePerSegment”Money!
What one segment currently costs.
estimatedDaysRemaining
Section titled “estimatedDaysRemaining”Int
Roughly how long it lasts at the last thirty days’ rate of use.
lowBalanceThreshold
Section titled “lowBalanceThreshold”Int!
Below this, the platform warns the merchant.
senderLines
Section titled “senderLines”[SenderLine!]!
The sender lines this shop can send from: the lines Kaladan provisioned for it, as the messaging service records them.
orderTexts
Section titled “orderTexts”OrderTextSettings!
Kaladan’s own automatic order texts, and whether each is on: “your order was
cancelled” and “your receipt was rejected”, sent to the order’s buyer when it
happens. Kaladan’s fixed wording, signed «کالادان» and naming the shop, on
a service line — nothing a merchant writes goes this way — and paid from
this credit at the normal rate: no credit, no text. Each fact is texted
once; a test order is never texted. Both are on until a merchant switches one
off (orderTextSettingsUpdate). A payment link’s text has no switch: the
merchant presses send.
SmsLineType
Section titled “SmsLineType”Which sender line a message goes over.
| Value | Meaning |
|---|---|
SERVICE | A service line — خط خدماتی. Reaches everybody, including subscribers who have blocked advertising. Transactional messages only; misusing it risks the line. |
PROMOTIONAL | A promotional line — خط تبلیغاتی. Blocked at the operator by most subscribers. |
TemplateApprovalStatus
Section titled “TemplateApprovalStatus”Whether a provider has approved a template.
| Value | Meaning |
|---|---|
NOT_REQUIRED | Service-line templates need none. |
PENDING | No description. |
APPROVED | No description. |
REJECTED | No description. |