Common
Attribute
Section titled “Attribute”A key/value pair a client attaches to a cart, a line, or an order.
String!
The name the client chose. Not namespaced and not validated.
String
What it was set to. Null where the client sent none.
AttributeInput
Section titled “AttributeInput”A key/value pair a client attaches to a cart, a line, or an order.
String!
The name to store it under.
String
What to store. Null removes the attribute.
CartWarning
Section titled “CartWarning”Something the platform changed on the buyer’s behalf, without failing.
Distinct from a UserError: the mutation succeeded and the payload is the new
truth. A quantity was trimmed to available stock, a line was dropped because its
variant was unpublished, a discount stopped applying when the cart shrank. A
theme that ignores these shows a buyer a cart they did not agree to.
CartWarningCode!
What was adjusted.
target
Section titled “target”ID
The object that changed, when one is identifiable.
message
Section titled “message”String!
English, for logs. Render from code.
CartWarningCode
Section titled “CartWarningCode”What the platform adjusted.
| Value | Meaning |
|---|---|
QUANTITY_ADJUSTED | A line’s quantity was reduced to what is in stock. |
MERCHANDISE_UNAVAILABLE | A line was removed: its variant is no longer purchasable. |
PRICE_CHANGED | A line’s price changed since it was added. |
DISCOUNT_REMOVED | A discount stopped applying. |
DELIVERY_OPTION_INVALIDATED | The selected delivery option is no longer offered and the selection was cleared. |
LINE_LIMIT_REACHED | The cart holds more distinct lines than the platform will price; the newest were dropped. |
CurrencyCode
Section titled “CurrencyCode”The currencies a Kaladan shop can price in.
One, today. A shop selling to the diaspora needs a separate legal entity and separate payment rails — it is a different product, not another enum value, and adding one here without that in place would let a theme render a price nobody can pay.
| Value | Meaning |
|---|---|
IRR | Iranian rial. |
DateTime
Section titled “DateTime”An instant, RFC 3339, always UTC, always with an offset of Z.
Never a Jalali date. The shop’s calendar is a presentation instruction
(Shop.calendar), and converting to it is the client’s job at the moment of
render. A Jalali string on the wire cannot be compared, sorted, or subtracted
without parsing it back, and two clients would disagree about which day a
timestamp near midnight falls on.
Decimal
Section titled “Decimal”An exact decimal number, carried as a string.
Money is never a float. 0.1 + 0.2 is not 0.3 in IEEE 754, and a rounding
error in a total is a support ticket. Amounts arrive as "1250000" or
"1250000.50" and should be read into a decimal type, never into a double.
Dimensions
Section titled “Dimensions”A physical size, for shipping rates and for display.
length
Section titled “length”Float!
The longest side, in unit.
Float!
The second side, in unit.
height
Section titled “height”Float!
The third side, in unit.
LengthUnit!
What the three numbers are in.
ExternalVideo
Section titled “ExternalVideo”A video hosted somewhere else and embedded — Aparat, YouTube.
ID!
A globally unique, opaque identifier. Never parse or construct one.
String
Persian alternative text for the video. Null when the merchant has not written any.
mediaContentType
Section titled “mediaContentType”MediaContentType!
What kind of media this is, so a gallery can branch before selecting.
previewImage
Section titled “previewImage”Image
A still to show before the video itself loads or plays.
embedUrl
Section titled “embedUrl”URL!
The URL to embed in an iframe.
ExternalVideoHost!
Which service hosts it, so a theme can pick the right embed treatment.
ExternalVideoHost
Section titled “ExternalVideoHost”Where an external video lives.
| Value | Meaning |
|---|---|
APARAT | Iran’s own video platform, and the one that resolves during an international outage. |
YOUTUBE | No description. |
VIMEO | No description. |
HTML that has already been sanitized by the platform: a closed tag set, no scripts, no event handlers, no inline styles.
It is safe to inject directly. It is not safe to concatenate with anything else and re-sanitize — that is how a nested-quote bug becomes an XSS.
Handle
Section titled “Handle”A URL-safe identifier a merchant chooses and can change: pirahan-abi.
Lowercase, digits, and hyphens. Persian characters are transliterated on the way
in, so پیراهن آبی becomes pirahan-abi. Because a merchant can change it,
never store a handle as a foreign key — store the id.
HasMetafields
Section titled “HasMetafields”An object that can carry custom data.
metafield
Section titled “metafield”Metafield
One metafield, or null when it is unset or not published to the storefront.
The two are deliberately indistinguishable: telling a public caller that a private key exists is itself a disclosure.
| Argument | Type | Meaning |
|---|---|---|
namespace | String | The owning app, or custom for a merchant’s own. Defaults to custom. |
key | String! | The metafield’s key within its namespace. |
metafields
Section titled “metafields”[Metafield]!
Several metafields at once.
The result is positional: one entry per identifier, in the order asked, null where there is nothing to return. That is what lets a client zip the response against its request without matching on keys.
| Argument | Type | Meaning |
|---|---|---|
identifiers | [MetafieldIdentifier!]! | The metafields to fetch. The result has one entry per identifier. |
A raster image held by the platform.
ID!
A globally unique, opaque identifier. Never parse or construct one.
String
Persian alternative text for the image. Null when the merchant has not written any.
mediaContentType
Section titled “mediaContentType”MediaContentType!
What kind of media this is, so a gallery can branch before selecting.
previewImage
Section titled “previewImage”Image
Null: an image is its own still. Present because every Media has one, so
a gallery can read previewImage from any item and fall back to the item.
URL!
A URL for the image, transformed as asked.
The transform is applied by the CDN and the result is cached, so asking for
the exact size you will render is cheaper than asking for the original and
letting the browser scale it. Ask for WEBP or AVIF unless you have a
reason not to.
| Argument | Type | Meaning |
|---|---|---|
transform | ImageTransform | No description. |
Int
Width of the untransformed image, in pixels.
height
Section titled “height”Int
Height of the untransformed image, in pixels.
thumbhash
Section titled “thumbhash”String
A thumbhash: about thirty bytes of base64 that decode to a blurred stand-in for the image.
Render it immediately, swap in the real image when it arrives. On a throttled connection this is the difference between a laid-out page and a column of grey rectangles.
dominantColor
Section titled “dominantColor”String
The image’s dominant colour as #rrggbb, for a placeholder background.
ImageCropRegion
Section titled “ImageCropRegion”Which part of an image survives a crop.
| Value | Meaning |
|---|---|
CENTER | No description. |
TOP | No description. |
BOTTOM | No description. |
LEFT | No description. |
RIGHT | No description. |
ImageFormat
Section titled “ImageFormat”An encoding an image can be served as.
| Value | Meaning |
|---|---|
WEBP | No description. |
AVIF | No description. |
JPG | No description. |
PNG | No description. |
ImageTransform
Section titled “ImageTransform”How to transform an image before serving it.
maxWidth
Section titled “maxWidth”Int
Constrain the width, in pixels.
maxHeight
Section titled “maxHeight”Int
Constrain the height, in pixels.
ImageCropRegion
How to reconcile the requested box with the image’s aspect ratio.
Int
Multiply the requested size for a high-density display. 1, 2, or 3.
format
Section titled “format”ImageFormat
Encode as this format. Defaults to the best the requesting client accepts.
quality
Section titled “quality”Int
Encoder quality, 1–100. Defaults to the platform’s own balance.
ScalarAn arbitrary JSON value.
Used only where the members genuinely depend on runtime data — a filter’s
re-submittable input, a metafield’s parsed reference, generated structured data.
It is never a way to avoid writing a schema: every field typed JSON here says
in its own description exactly what it contains and who decides.
LengthUnit
Section titled “LengthUnit”Units a dimension can be given in.
| Value | Meaning |
|---|---|
MILLIMETER | No description. |
CENTIMETER | No description. |
METER | No description. |
Locale
Section titled “Locale”A BCP 47 language tag: fa-IR, en, ar.
The shop declares which it supports (Localization.availableLocales); a request
picks one with @inContext.
Anything that can appear in a product gallery.
ID!
A globally unique, opaque identifier. Never parse or construct one.
String
Persian alternative text. Null when the merchant has not written any.
mediaContentType
Section titled “mediaContentType”MediaContentType!
What kind of media this is, so a gallery can branch before selecting.
previewImage
Section titled “previewImage”Image
A still to show before the media itself loads or plays.
MediaContentType
Section titled “MediaContentType”What kind of media an object is.
| Value | Meaning |
|---|---|
IMAGE | No description. |
VIDEO | No description. |
EXTERNAL_VIDEO | No description. |
MODEL_3D | No description. |
Metafield
Section titled “Metafield”A single piece of custom data attached to an object.
ID!
A globally unique, opaque identifier. Never parse or construct one.
namespace
Section titled “namespace”String!
Who owns the key — an app’s handle, or custom for the merchant.
String!
The key within its namespace.
String!
The value’s type: single_line_text_field, number_integer, boolean,
json, money, product_reference, list.product_reference, and so on.
Always read value through type. A metafield’s type is fixed by its
definition and cannot change under a client without an API version change.
String!
The value, always as a string, encoded per type. A json metafield holds a
serialized document; a number_integer holds "42".
One representation for every type keeps the field non-null and keeps clients from branching on which of a dozen typed members is populated.
reference
Section titled “reference”Node
The object a reference type points at, already resolved — so a metafield holding a product does not cost a second round trip.
Null for every non-reference type.
references
Section titled “references”NodeConnection!
The objects a list.*_reference points at. Empty for every other type.
| Argument | Type | Meaning |
|---|---|---|
first | Int | No description. |
after | String | No description. |
updatedAt
Section titled “updatedAt”DateTime!
When the value last changed.
MetafieldIdentifier
Section titled “MetafieldIdentifier”Names one metafield.
namespace
Section titled “namespace”String
The owning app or custom for a merchant’s own. Defaults to custom.
String!
The key within the namespace.
Model3d
Section titled “Model3d”A 3D model shown in a viewer.
ID!
A globally unique, opaque identifier. Never parse or construct one.
String
Persian alternative text for the model. Null when the merchant has not written any.
mediaContentType
Section titled “mediaContentType”MediaContentType!
What kind of media this is, so a gallery can branch before selecting.
previewImage
Section titled “previewImage”Image
A still to show before the model itself loads or plays.
sources
Section titled “sources”[Model3dSource!]!
The model, in each format it is published in.
More than one because a viewer picks by what it supports — glb almost
everywhere, usdz for iOS Quick Look.
Model3dSource
Section titled “Model3dSource”One encoding of a 3D model.
URL!
Where the file is.
mimeType
Section titled “mimeType”String!
Its media type.
format
Section titled “format”String!
The format — glb, usdz.
filesize
Section titled “filesize”Int!
Bytes. Worth reading before loading one on a mobile connection.
ObjectAn amount in a currency.
amount
Section titled “amount”Decimal!
The amount, in the currency’s canonical unit — rial for IRR, undivided.
Divide by Shop.moneyPresentation.divisor before display; do not hard-code
ten. Read into a decimal type, never a float.
currencyCode
Section titled “currencyCode”CurrencyCode!
The currency the amount is in.
MoneyDisplayUnit
Section titled “MoneyDisplayUnit”The unit an amount is spoken in.
| Value | Meaning |
|---|---|
RIAL | Rial — the settlement currency. |
TOMAN | Toman — ten rial. What almost every Iranian shop displays. |
MoneyPresentation
Section titled “MoneyPresentation”How this shop’s amounts should be rendered.
Everything a formatter needs, so that a theme, an embedded buy button, and a native app all produce the same string without any of them knowing about Iran.
MoneyDisplayUnit!
The unit prices are spoken in.
divisor
Section titled “divisor”Int!
What to divide a canonical amount by to reach unit: 1 for rial, 10 for
toman.
Given as a number rather than implied by the enum so a client divides instead of branching, and so a future unit costs no client change.
fractionDigits
Section titled “fractionDigits”Int!
Digits to show after the separator once divided. Zero, in practice.
rounding
Section titled “rounding”PriceRounding!
How the platform rounds amounts it computes itself — shipping, a percentage discount, tax.
Stated so a theme showing a client-side estimate lands on the same figure the server will charge. Prices a merchant typed are not rounded; they are already what the merchant meant.
numeralSystem
Section titled “numeralSystem”NumeralSystem!
Which digits to draw.
MoneyRange
Section titled “MoneyRange”A span of prices, for a product whose variants are not all priced alike.
min and max are equal when they are.
Money!
The cheapest.
Money!
The dearest.
InterfaceAn object with a globally unique, opaque id.
Ids are opaque: base64 of an internal reference, never a bare database key. Do
not parse one, do not construct one, and do not assume two ids of the same type
sort in creation order. Query.node re-fetches any of them, which is what makes
a normalizing client cache possible.
ID!
A globally unique identifier.
NodeConnection
Section titled “NodeConnection”A page of nodes of mixed type, as returned by a reference list.
[NodeEdge!]!
Each Node with its cursor. Use this when you need to page.
[Node!]!
The Nodes themselves, unwrapped. Use this when you do not.
pageInfo
Section titled “pageInfo”PageInfo!
Whether there is more, and the cursors to ask with.
NodeEdge
Section titled “NodeEdge”One node in a page, with its cursor.
cursor
Section titled “cursor”String!
This position in the current ordering. Pass it as after or before.
Node!
The Node at this position.
NumeralSystem
Section titled “NumeralSystem”Which digit glyphs to render.
| Value | Meaning |
|---|---|
PERSIAN | Persian: ۰۱۲۳۴۵۶۷۸۹. |
LATIN | Latin: 0123456789. |
PageInfo
Section titled “PageInfo”Where one page sits in a collection.
Cursor-based, never offset-based. An offset shifts under you the moment anything is inserted, so page 2 of a catalogue re-sorted by a merchant silently skips products. A cursor addresses a position in a specific ordering.
hasNextPage
Section titled “hasNextPage”Boolean!
Whether another page exists after endCursor.
hasPreviousPage
Section titled “hasPreviousPage”Boolean!
Whether another page exists before startCursor.
startCursor
Section titled “startCursor”String
Cursor of the first edge, or null when the page is empty.
endCursor
Section titled “endCursor”String
Cursor of the last edge, or null when the page is empty.
PriceRounding
Section titled “PriceRounding”How the platform rounds an amount it computed.
increment
Section titled “increment”Decimal!
The step to round to, in the canonical unit. 10000 rounds to the nearest
thousand toman.
PriceRoundingMode!
Which way, at the halfway point and otherwise.
PriceRoundingMode
Section titled “PriceRoundingMode”Which way an amount is rounded.
| Value | Meaning |
|---|---|
NEAREST | To the nearer step; exactly halfway goes up. |
UP | Always up, away from zero. |
DOWN | Always down, toward zero. |
What a page tells a crawler about itself.
Worth more here than it would be elsewhere: Torob and Emalls are primary discovery channels rather than a long tail, they crawl rather than integrate, and the Phase-2 product-discovery engine reads the same markup. Structured data is generated by the platform so that every theme emits the same correct shape.
String
Title tag. Falls back to the resource’s own title when the merchant left it blank.
description
Section titled “description”String
Meta description. Falls back to a trimmed summary of the body.
canonicalUrl
Section titled “canonicalUrl”URL
The canonical URL for this resource on this shop’s primary domain.
Image
An image for Open Graph and Twitter cards.
noIndex
Section titled “noIndex”Boolean!
Whether the merchant has asked crawlers to skip this page.
structuredData
Section titled “structuredData”JSON!
schema.org JSON-LD for this resource, ready to serialize into a
<script type="application/ld+json"> tag without modification.
Generated by the platform from the same data the page renders, so it cannot drift from it. A theme that composes its own is free to, but it will be the one that breaks when Torob changes what it expects.
ScalarAn absolute URL, including scheme.
UserError
Section titled “UserError”One reason a mutation declined.
code and params are the contract. message is not: it is English, written
for whoever is reading a log, and a client that shows it to a buyer has shipped
an English string into a Persian checkout. Map code to your own template and
interpolate params — "حداکثر ۸۰ نویسه" from MAX_LENGTH and
{"maxLength": 80}.
This is the same taxonomy the REST surfaces use in an RFC 7807 Violation, so a
code means the same thing wherever it appears.
UserErrorCode!
The rule that failed.
Every mutation documents which codes it can return; treat an unrecognized one as a generic failure and fall back to a neutral message rather than crashing. A new code is added in a new API version.
[String!]
The path to the offending value, as input-field segments from the mutation’s
arguments: ["lines", "0", "quantity"].
The same address a REST response writes as the JSON Pointer
#/lines/0/quantity. Null when the failure is about the operation as a whole
rather than one value.
params
Section titled “params”JSON
The arguments of the rule that failed, keyed by constraint name, and null for
rules that take none: {"maxLength": 80}, {"enum": ["RIAL", "TOMAN"]},
{"available": 3}.
They live here rather than beside code so a generic renderer never has to
know which members are metadata and which are arguments.
message
Section titled “message”String!
English, for the developer reading logs. Never a contract, never parsed, and never shown to a buyer.
UserErrorCode
Section titled “UserErrorCode”The failure catalogue.
One catalogue across every Kaladan surface — a code means the same thing in the
Admin API and in an RFC 7807 Violation as it does here. Each surface’s enum
lists only the codes that surface can actually return, so a generated client
gets a precise switch rather than a union of everything the platform can fail
at; a code never means two different things in two places.
Split in two: rules about the shape of a value, which any field can break, and rules about the state of the shop, which only certain operations can.
| Value | Meaning |
|---|---|
REQUIRED | A required value was absent. |
MIN_LENGTH | A string was shorter than params.minLength. |
MAX_LENGTH | A string was longer than params.maxLength. |
PATTERN | A string did not match params.pattern. |
OUT_OF_RANGE | A value was outside params.minimum/params.maximum. |
ENUM | A value was not one of params.enum. |
LIST_SIZE | A list had fewer than params.minItems or more than params.maxItems. |
INVALID | A value was syntactically wrong for its type — a malformed id, a bad phone number. |
INCONSISTENT | Two values that must agree did not — a city outside its province. |
NOT_FOUND | The referenced object does not exist, or is not published to this shop’s storefront. |
FORBIDDEN | The object exists but this token may not read or change it. |
EXPIRED | The cart, checkout handoff, or token has expired. |
UNAVAILABLE | The merchandise cannot be sold right now: unpublished, or out of stock with no backorder. |
INSUFFICIENT_STOCK | Less stock is on hand than was asked for; params.available says how much. |
CODE_INVALID | A discount or gift card code was not recognized, has lapsed, or is used up. |
NOT_APPLICABLE | A discount is real but this cart does not qualify. |
INVALID_STATE | The operation cannot run in the cart’s current state — selecting delivery before an address. |
IDEMPOTENCY_CONFLICT | The same idempotency key was replayed with different arguments. |
RATE_LIMITED | Too many attempts in too short a window — an OTP, a review, a discount code. |
A video hosted by the platform.
ID!
A globally unique, opaque identifier. Never parse or construct one.
String
Persian alternative text for the video. Null when the merchant has not written any.
mediaContentType
Section titled “mediaContentType”MediaContentType!
What kind of media this is, so a gallery can branch before selecting.
previewImage
Section titled “previewImage”Image
A still to show before the video itself loads or plays.
sources
Section titled “sources”[VideoSource!]!
One entry per encoding and resolution offered.
durationMs
Section titled “durationMs”Int
Duration in milliseconds, or null while the video is still being processed.
VideoSource
Section titled “VideoSource”One encoding of a video.
URL!
Where the file is.
mimeType
Section titled “mimeType”String!
Its media type, for a <source type> attribute.
format
Section titled “format”String!
The container — mp4, webm.
Int!
Frame width in pixels.
height
Section titled “height”Int!
Frame height in pixels.
Weight
Section titled “Weight”A weight, with the unit it was measured in.
Float!
The number, in unit.
WeightUnit!
What the number is in.
WeightUnit
Section titled “WeightUnit”Units a weight can be given in.
| Value | Meaning |
|---|---|
GRAM | No description. |
KILOGRAM | No description. |