Skip to content
Select theme
Light
Dark
Auto
Select language
English
فارسی

Marketing

Object

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!

No description.

String!

No description.

AutomationTrigger!

No description.

Int!

How long after the trigger to act. Zero fires immediately.

[AutomationCondition!]!

No description.

[AutomationAction!]!

No description.

Boolean!

No description.

AutomationStatistics!

How often it has fired, and what came of it.

DateTime!

No description.

DateTime!

No description.

Object

One thing an automation does.

AutomationActionKind!

No description.

MessageTemplate

The template, for a message action.

ID

A discount to mint and include, for a recovery message.

String

A tag to apply, for a tagging action.

Input

One action.

AutomationActionKind!

No description.

ID

No description.

ID

No description.

String

No description.

MoneyInput

No description.

Enum

What an automation can do.

ValueMeaning
SEND_MESSAGENo description.
ISSUE_DISCOUNTMint a single-use discount code and include it in the message.
ADD_CUSTOMER_TAGNo description.
ADD_ORDER_TAGNo description.
GRANT_STORE_CREDITGrant store credit — a goodwill gesture after a late delivery.
NOTIFY_STAFFRaise 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.
Object

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.

SegmentRuleOperator!

No description.

String!

No description.

Input

One condition.

String!

No description.

SegmentRuleOperator!

No description.

String!

No description.

Input

An automation to create or change.

String

No description.

AutomationTrigger

No description.

Int

No description.

[AutomationConditionInput!]

On an update, left out leaves the conditions as they are, and an empty list clears them, making the automation unconditional.

[AutomationActionInput!]

No description.

Boolean

No description.

Object

What the automation mutations return.

Automation

No description.

[UserError!]!

No description.

Object

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.

Int!

No description.

Int!

No description.

Int!

Refused until link or discount-code tracking exists.

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.

Enum

What starts an automation.

ValueMeaning
CART_ABANDONEDA cart was left. The commonest automation, and the one that pays for itself.
ORDER_PLACEDNo description.
ORDER_DELIVEREDNo description.
CUSTOMER_CREATEDNo description.
FIRST_ORDERA buyer’s first order — a welcome, or a second-purchase nudge.
CUSTOMER_LAPSEDNothing bought for N days.
BACK_IN_STOCKNo description.
PRODUCT_LOW_STOCKNo description.
REVIEW_RECEIVEDNo description.
PAYMENT_LINK_UNPAIDA payment link was sent and not paid. The chase.
ORDER_CANCELLEDAn order was cancelled. A test order fires nothing.
RECEIPT_APPROVEDA card-to-card receipt was approved, so the buyer knows the goods are moving.
RECEIPT_REJECTEDA card-to-card receipt was rejected, with the reason the buyer can act on.
PAYMENT_LINK_SENTA payment link was sent for what an order still owes.
Object

A message the merchant sends to many people at once.

ID!

No description.

Version!

No description.

String!

No description.

MarketingChannel!

No description.

CampaignStatus!

No description.

CampaignAudience!

Who it goes to.

MessageTemplate!

What is sent.

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.

Money!

What it will cost, at the current per-message rate.

CampaignResults

What happened, once it has run.

DateTime

When to send. Null means send on campaignSend.

DateTime

No description.

DateTime

No description.

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.

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.

DateTime!

No description.

Object

Who a campaign goes to.

CampaignAudienceKind!

No description.

CustomerSegment

No description.

[ID!]!

Explicit recipients, for a small hand-picked send.

Int!

How many are in the audience before consent and line type are applied.

Enum

How a campaign’s audience is chosen.

ValueMeaning
SEGMENTNo description.
CUSTOMER_LISTNo description.
ALL_SUBSCRIBERSEverybody 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.
Object

A page of campaigns.

[CampaignEdge!]!

No description.

[Campaign!]!

No description.

PageInfo!

No description.

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.

Object

One campaign, with its cursor.

String!

No description.

Campaign!

No description.

Input

A filter on the campaign list.

[CampaignStatus!]

No description.

[MarketingChannel!]

No description.

DateTime

No description.

Input

A campaign to create.

String!

No description.

MarketingChannel

No description.

ID!

No description.

CampaignAudienceKind!

No description.

ID

No description.

[ID!]

No description.

DateTime

No description.

Object

What the campaign mutations return.

Campaign

No description.

[UserError!]!

No description.

Object

How many a campaign will actually reach, and why the rest will not.

Int!

The audience, before anything is subtracted.

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.

Int!

Excluded for having no usable address on this channel — no mobile, no email.

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.

Int!

Excluded for having received too many messages from this shop recently.

Int!

What is left.

Object

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.

Int!

Handed to the provider and not refused: sent, delivered or failed.

Int!

Confirmed delivered by the operator’s receipt.

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.

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.

Int!

Not reached yet: a send in progress, or one that stopped and will resume.

Int!

What it was charged, in SMS segments.

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.

Int!

Orders the platform could attribute back to this campaign. Refused until link or discount-code tracking exists.

Money!

Refused, as attributedOrderCount is.

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.

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.

Object

What campaignSend returns.

Campaign

No description.

[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.

Enum

Where a campaign stands.

ValueMeaning
DRAFTNo description.
SCHEDULEDNo description.
SENDINGNo description.
SENTNo description.
PARTIALLY_SENTRan 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.
CANCELLEDNo description.
FAILEDCould not start at all — no credit, no sender line, an unapproved template.
Object

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!

No description.

String!

No description.

MarketingChannel!

No description.

MessageTemplateKind!

No description.

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.

[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 “سفارش ارسال شد”.

MessageTrigger

The event that fires it, for a transactional template.

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.

String

No description.

Int!

Roughly how many SMS segments one message costs, given Persian text.

Boolean!

No description.

DateTime!

No description.

Input

A template to create or change. Partial on update.

String

No description.

MarketingChannel

No description.

MessageTemplateKind

No description.

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.

MessageTrigger

No description.

Boolean

No description.

Enum

What kind of message a template is.

ValueMeaning
TRANSACTIONALFired by something happening. Rides a service line.
MARKETINGSent because the merchant chose to. Rides a promotional line.
Object

What the template mutations return.

MessageTemplate

No description.

[UserError!]!

No description.

Object

What messageTemplateTest returns.

MessageTemplate

The template tested. Null beside a refusal.

String

The words that were sent, every placeholder filled with its sample value. Null beside a refusal.

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.

[UserError!]!

No description.

Input

One placeholder’s sample value for messageTemplateTest, by the name the body uses: order_number for {{ order_number }}.

String!

No description.

String!

No description.

Enum

What fires a transactional message.

ValueMeaning
ORDER_PLACEDNo description.
ORDER_PAIDNo description.
ORDER_CANCELLEDNo description.
ORDER_SHIPPEDNo description.
ORDER_DELIVEREDNo description.
RECEIPT_APPROVEDA card-to-card receipt was approved, so the buyer knows the goods are moving.
RECEIPT_REJECTEDNo description.
REFUND_ISSUEDNo description.
PAYMENT_LINK_SENTA payment link on a draft order.
RETURN_APPROVEDNo description.
GIFT_CARD_ISSUEDNo description.
ABANDONED_CARTNo description.
BACK_IN_STOCKNo description.
REVIEW_REQUESTNot yet: nothing asks a buyer for a review, so nothing fires it. Refused as unknown, and not offered.
LOW_STOCK_ALERTNo description.
Object

Whether each of Kaladan’s automatic order texts is sent. Both on by default.

Boolean!

“Your order was cancelled”, when an order is cancelled.

Boolean!

“Your receipt was rejected”, when a transfer receipt is rejected.

Input

Kaladan’s automatic order texts to switch on or off. A field left out is unchanged.

Boolean

No description.

Boolean

No description.

Object

What orderTextSettingsUpdate returns.

OrderTextSettings

The switches as they now stand. Null beside a refusal.

[UserError!]!

No description.

Object

One sender number the shop can send from.

String!

No description.

SmsLineType!

No description.

Boolean!

A dedicated line, or one shared across shops.

Boolean!

No description.

Object

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.

Int!

Segments remaining.

Money!

What one segment currently costs.

Int

Roughly how long it lasts at the last thirty days’ rate of use.

Int!

Below this, the platform warns the merchant.

[SenderLine!]!

The sender lines this shop can send from: the lines Kaladan provisioned for it, as the messaging service records them.

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.

Enum

Which sender line a message goes over.

ValueMeaning
SERVICEA service line — خط خدماتی. Reaches everybody, including subscribers who have blocked advertising. Transactional messages only; misusing it risks the line.
PROMOTIONALA promotional line — خط تبلیغاتی. Blocked at the operator by most subscribers.
Enum

Whether a provider has approved a template.

ValueMeaning
NOT_REQUIREDService-line templates need none.
PENDINGNo description.
APPROVEDNo description.
REJECTEDNo description.