Cart
Carrier
Section titled “Carrier”A delivery company.
String!
A stable code: IRAN_POST, TIPAX, CHAPAR, ALOPEYK, SNAPP_BOX.
String!
The carrier’s name in the current locale.
Image
The carrier’s mark.
ObjectA buyer’s basket.
Long-lived and recoverable: the id is what a theme persists in a cookie or in
local storage, and a cart survives a browser restart. It expires eventually
(expiresAt), at which point every operation on it returns EXPIRED and the
theme should create a new one.
It also ends when checkout turns it into an order, or when it is given up.
cart(id) then answers null, a mutation on it is refused as INVALID_STATE,
and the theme creates a new one exactly as it does for an expired cart.
Prices are recomputed on every read. A cart is a set of intentions, not a
quotation — a merchant who changes a price changes it for carts already holding
the item, and the PRICE_CHANGED warning is how a theme learns to say so.
ID!
A globally unique, opaque identifier. Never parse or construct one.
checkoutUrl
Section titled “checkoutUrl”URL!
Where to send the buyer to pay.
Single-use in spirit and short-lived in practice — mint it when the buyer clicks, not when the cart page renders. Opening it starts hosted checkout, which owns everything from payment method selection onward.
CartLineConnection!
The lines, in the order they were added.
| Argument | Type | Meaning |
|---|---|---|
first | Int | No description. |
after | String | No description. |
last | Int | No description. |
before | String | No description. |
totalQuantity
Section titled “totalQuantity”Int!
Total units across every line — the number for the header badge.
Distinct from the line count: three of one thing is one line and three units.
CartCost!
What the cart costs, broken out.
String
A note the buyer left for the merchant.
attributes
Section titled “attributes”[Attribute!]!
Arbitrary key/value data the theme attached — a gift message, a referrer, an Instagram post id.
Carried onto the order and shown to the merchant. Not secret: it round-trips through a public API and a buyer can read and change it.
buyerIdentity
Section titled “buyerIdentity”CartBuyerIdentity!
Who is buying.
discountCodes
Section titled “discountCodes”[CartDiscountCode!]!
Codes the buyer entered, each marked with whether it actually applied.
A code that did not apply is kept rather than dropped so the theme can say why — silently discarding it looks like a bug to the buyer who typed it.
discountAllocations
Section titled “discountAllocations”[CartDiscountAllocation!]!
Every discount now reducing the total, from a code or applied automatically.
delivery
Section titled “delivery”CartDelivery!
Where it is going and how.
invoiceRequest
Section titled “invoiceRequest”InvoiceRequest
Whether the buyer has asked for an official invoice — فاکتور رسمی — and the legal identity to issue it to.
Null until asked for. Requesting one commits the merchant to filing an electronic invoice through سامانه مودیان, so the fields it needs are collected here rather than discovered at the tax deadline.
paymentOptions
Section titled “paymentOptions”[PaymentOption!]!
What this cart can be paid with, and why anything is unavailable.
Authoritative, unlike Shop.paymentOptions: it accounts for the total, the
destination, and what is in the basket. Cash on delivery outside a courier’s
range is absent here and present there.
createdAt
Section titled “createdAt”DateTime!
When the buyer started it.
updatedAt
Section titled “updatedAt”DateTime!
When it last changed.
Moves on every mutation, and on a price change the buyer never made — a cart is repriced on read, so this is not a safe cache key for its contents.
expiresAt
Section titled “expiresAt”DateTime!
When the cart stops working.
Extended by activity. A theme that shows a persistent basket should handle
EXPIRED by making a new cart, not by showing an error.
CartBuyerIdentity
Section titled “CartBuyerIdentity”Who is buying.
String
Mobile number, 09xxxxxxxxx.
The primary identifier here, not email: authentication is SMS-OTP, order notifications are SMS, and the courier calls this number.
String
Email, when the buyer gave one. Optional, and frequently absent.
customer
Section titled “customer”Customer
The signed-in buyer, or null for a guest.
Set by passing a customer access token from the Customer Account API to
cartBuyerIdentityUpdate. Signing in mid-checkout attaches the cart to the
account rather than replacing it.
CartBuyerIdentityInput
Section titled “CartBuyerIdentityInput”Who is buying.
String
The buyer’s telephone number. The one identifier an Iranian checkout actually needs; email is optional and often absent.
String
Their email, when the theme collected one.
customerAccessToken
Section titled “customerAccessToken”String
A customer access token from the Customer Account API.
Attaches the cart to that account. Never echoed back on CartBuyerIdentity.
CartCost
Section titled “CartCost”What the cart costs.
Shipping and tax are null until enough is known to compute them — there is no delivery cost before there is a destination. Null means unknown, never zero; a theme that renders a null as “رایگان” has promised free delivery.
subtotalAmount
Section titled “subtotalAmount”Money!
Every line’s subtotal, before cart-level discounts.
totalDiscountAmount
Section titled “totalDiscountAmount”Money!
Everything taken off, cart-level and line-level together.
totalShippingAmount
Section titled “totalShippingAmount”Money
Delivery, once an address and an option are chosen. Null before that.
totalTaxAmount
Section titled “totalTaxAmount”Money
VAT — مالیات بر ارزش افزوده — once computable. Null before that.
totalAmount
Section titled “totalAmount”Money!
What the buyer will pay, as far as is currently known.
Still moves after this, in two ways: a delivery option not yet chosen is not
yet in it, and neither is any payment surcharge — that is knowable only once
a method is picked, in hosted checkout. Read
Cart.paymentOptions.surcharge to show it on a cart page.
CartDelivery
Section titled “CartDelivery”Where the cart is going, and how.
address
Section titled “address”Address
The destination. Null until the buyer supplies one.
groups
Section titled “groups”CartDeliveryGroupConnection!
The cart split into groups that ship together.
Usually one. More when the quote priced some lines under different rules — furniture and a shirt genuinely ship as two parcels, frequently by two carriers — or when some are digital and need no delivery at all.
A group does not name a location. The grouping is by the rules that priced it, and where the goods sit is decided when stock is held, which is after the buyer has chosen. A theme that read a warehouse out of a group would be reading something no part of the platform puts there.
| Argument | Type | Meaning |
|---|---|---|
first | Int | No description. |
after | String | No description. |
CartDeliveryGroup
Section titled “CartDeliveryGroup”A set of lines that will be delivered together.
ID!
A globally unique, opaque identifier. Never parse or construct one.
cartLines
Section titled “cartLines”CartLineConnection!
The lines in this group.
| Argument | Type | Meaning |
|---|---|---|
first | Int | No description. |
after | String | No description. |
deliveryAddress
Section titled “deliveryAddress”Address
Where this group is going.
deliveryOptions
Section titled “deliveryOptions”[CartDeliveryOption!]!
What is on offer for this group.
Empty until there is an address — no carrier quotes a price without a destination. Empty with an address means nothing delivers there, which a theme must surface rather than treat as a loading state.
selectedDeliveryOption
Section titled “selectedDeliveryOption”CartDeliveryOption
What the buyer chose, or null before they choose.
CartDeliveryGroupConnection
Section titled “CartDeliveryGroupConnection”A page of delivery groups.
[CartDeliveryGroupEdge!]!
Each CartDeliveryGroup with its cursor. Use this when you need to page.
[CartDeliveryGroup!]!
The CartDeliveryGroups themselves, unwrapped. Use this when you do not.
pageInfo
Section titled “pageInfo”PageInfo!
Whether there is more, and the cursors to ask with.
CartDeliveryGroupEdge
Section titled “CartDeliveryGroupEdge”One delivery group, with its cursor.
cursor
Section titled “cursor”String!
This position in the current ordering. Pass it as after or before.
CartDeliveryGroup!
The CartDeliveryGroup at this position.
CartDeliveryOption
Section titled “CartDeliveryOption”One way a group can be delivered.
handle
Section titled “handle”String!
The stable handle to send back to select it.
String!
What to call it — “پست پیشتاز”, “تیپاکس”, “پیک موتوری”.
Merchant and carrier data; safe to render.
description
Section titled “description”String
A sentence of detail the merchant wrote.
estimatedCost
Section titled “estimatedCost”Money!
What it costs. Zero for free delivery, which is not the same as null.
For a cart spanning more than one shipping profile — a sofa and a shirt — this
is the sum of what each profile charges, because they ship as separate
parcels and that is what the merchant is charged. profileBreakdown has the
parts.
profileBreakdown
Section titled “profileBreakdown”[DeliveryProfileCharge!]!
What each shipping profile contributed, when the cart spans more than one.
Empty for the ordinary single-profile cart, which is almost all of them. A theme that ignores this shows one delivery line and is correct; one that renders it can explain why a sofa and a shirt cost more to deliver than either alone, which is the question that otherwise arrives as an abandoned cart.
isEstimated
Section titled “isEstimated”Boolean!
Whether this price is a reused quote rather than a live one.
True when the carrier did not answer and the last successful quote for this zone and weight band was used instead. The buyer can still check out; a theme should say «تخمینی» rather than presenting it as exact, and the final charge may differ slightly.
Always false for rates the merchant priced themselves, which is most of them.
carrier
Section titled “carrier”Carrier
The carrier behind it, when there is a named one.
deliveryWindow
Section titled “deliveryWindow”DeliveryWindow
When it should arrive.
method
Section titled “method”DeliveryMethodType!
How it is delivered — for grouping options in the UI.
pickupLocation
Section titled “pickupLocation”PickupLocation
Where to collect, when method is PICKUP.
CartDeliveryOptionSelectionInput
Section titled “CartDeliveryOptionSelectionInput”One group’s chosen delivery option.
deliveryGroupId
Section titled “deliveryGroupId”ID!
The group being chosen for.
deliveryOptionHandle
Section titled “deliveryOptionHandle”String!
The option’s handle, from that group’s deliveryOptions.
CartDiscountAllocation
Section titled “CartDiscountAllocation”One discount, and how much of the cart it took off.
discountedAmount
Section titled “discountedAmount”Money!
How much came off.
String
The merchant’s name for the discount — تخفیف نوروزی.
Merchant data; safe to render. Null for a discount the merchant did not name.
String
The code that triggered it, or null when it applied automatically.
targetType
Section titled “targetType”DiscountTargetType!
What it applied to.
CartDiscountCode
Section titled “CartDiscountCode”A code the buyer entered.
String!
As typed, normalized to the case the merchant defined.
applicable
Section titled “applicable”Boolean!
Whether it is actually reducing the total.
False for a real code the cart does not qualify for as well as for one that does not exist — the two are not distinguished, because saying “that code exists but you cannot use it” is how a discount meant for one segment leaks to everyone.
CartInput
Section titled “CartInput”Everything a cart can be created with. Every member is optional.
[CartLineInput!]
The lines to start with. A cart may be created empty.
String
The buyer’s note for the merchant.
attributes
Section titled “attributes”[AttributeInput!]
Cart-level key/value data. Not secret; the buyer can read it.
buyerIdentity
Section titled “buyerIdentity”CartBuyerIdentityInput
Who is buying, as far as the theme knows at this point.
discountCodes
Section titled “discountCodes”[String!]
Codes to try immediately — a campaign link that opens with one already applied.
CartLine
Section titled “CartLine”One merchandise line.
ID!
A globally unique, opaque identifier. Never parse or construct one.
merchandise
Section titled “merchandise”ProductVariant!
What is being bought. Always a variant.
quantity
Section titled “quantity”Int!
How many. At least one; a line at zero is removed rather than kept.
attributes
Section titled “attributes”[Attribute!]!
Line-level key/value data — a monogram, a chosen delivery date.
CartLineCost!
What this line costs, before and after its discounts.
discountAllocations
Section titled “discountAllocations”[CartDiscountAllocation!]!
The discounts reducing this line specifically.
CartLineConnection
Section titled “CartLineConnection”A page of cart lines.
[CartLineEdge!]!
Each CartLine with its cursor. Use this when you need to page.
[CartLine!]!
The CartLines themselves, unwrapped. Use this when you do not.
pageInfo
Section titled “pageInfo”PageInfo!
Whether there is more, and the cursors to ask with.
CartLineCost
Section titled “CartLineCost”What one line costs.
amountPerQuantity
Section titled “amountPerQuantity”Money!
Unit price at the moment of reading.
subtotalAmount
Section titled “subtotalAmount”Money!
amountPerQuantity × quantity, before discounts.
totalAmount
Section titled “totalAmount”Money!
After this line’s discounts.
compareAtAmountPerQuantity
Section titled “compareAtAmountPerQuantity”Money
The unit’s compare-at price, when it has one.
CartLineEdge
Section titled “CartLineEdge”One cart line, with its cursor.
cursor
Section titled “cursor”String!
This position in the current ordering. Pass it as after or before.
CartLine!
The CartLine at this position.
CartLineInput
Section titled “CartLineInput”A line to add.
merchandiseId
Section titled “merchandiseId”ID!
The variant to buy. Not a product id — a product is not purchasable.
quantity
Section titled “quantity”Int!
How many. At least one.
attributes
Section titled “attributes”[AttributeInput!]
Line-level key/value data.
CartLineUpdateInput
Section titled “CartLineUpdateInput”A change to an existing line.
quantity is absolute, not a delta. Setting three means three, whatever it
was. A delta would make every retry of a dropped request add stock the buyer did
not ask for, and on a connection that drops requests routinely that is not a
hypothetical.
ID!
The line to change.
quantity
Section titled “quantity”Int
The new quantity. Zero removes the line.
merchandiseId
Section titled “merchandiseId”ID
A different variant — how a size change is made without losing the line.
attributes
Section titled “attributes”[AttributeInput!]
Replaces the line’s attributes entirely.
CartPayload
Section titled “CartPayload”What every cart mutation returns.
One payload type rather than one per mutation, because every cart mutation returns exactly these three things and nothing suggests any of them will diverge. A mutation that later needs to return something else gets its own type then; inventing eleven identical types now would only make the schema longer to read.
cart is populated even when userErrors is not empty — it is the cart as it
now stands, unchanged. A theme should re-render from it either way.
Cart
The cart after the operation, or null when it could not be found at all.
userErrors
Section titled “userErrors”[UserError!]!
Why the operation declined. Empty on success.
warnings
Section titled “warnings”[CartWarning!]!
What the platform changed on the buyer’s behalf. May be non-empty on success.
CheckoutHandoff
Section titled “CheckoutHandoff”Where to send the buyer to pay.
Hosted by Kaladan on the shop’s own domain, so the buyer never appears to leave the merchant. It collects the payment method, redirects to the PSP, and handles the return leg — verification, reconciliation, and order creation.
URL!
Send the buyer here.
String!
The opaque token identifying this attempt.
Hold it: hosted checkout returns the buyer to returnUrl with an order token,
and this is what ties an abandoned attempt back to the cart it came from.
expiresAt
Section titled “expiresAt”DateTime!
When the handoff stops working.
Short — minutes, not hours — because it reserves stock. An expired handoff is restarted, not resumed.
CheckoutStartPayload
Section titled “CheckoutStartPayload”What cartCheckoutStart returns.
checkout
Section titled “checkout”CheckoutHandoff
The handoff, or null when the cart cannot proceed to payment.
Cart
The cart as it now stands.
userErrors
Section titled “userErrors”[UserError!]!
Why checkout could not start.
INVALID_STATE when something required is missing — no address, no delivery
option chosen, no contact number. INSUFFICIENT_STOCK when the basket no
longer fits what is on hand. UNAVAILABLE when a line stopped being sellable.
warnings
Section titled “warnings”[CartWarning!]!
What the platform changed on the buyer’s behalf while starting checkout. May be non-empty on success.
The most consequential warnings in this API arrive here. This is the last
call before the buyer is handed to payment, and a quantity trimmed to stock or
a line dropped for going unpurchasable means the total they are about to pay
is not the total they agreed to. Show them and let the buyer confirm before
following checkout.url; sending them straight on is how a shop takes money
for a basket nobody approved.
Customer
Section titled “Customer”A signed-in buyer, as much of one as a storefront needs.
Deliberately thin. Order history, the address book, wishlists, and anything else tied to an authenticated buyer live in the Customer Account API, behind that API’s own token — reachable from a public storefront token they must not be.
ID!
A globally unique, opaque identifier. Never parse or construct one.
firstName
Section titled “firstName”String
Given name — نام.
lastName
Section titled “lastName”String
Family name — نام خانوادگی.
displayName
Section titled “displayName”String!
Whatever there is to greet them by: the full name, else the phone number.
Composed here so every theme greets a buyer the same way and none of them has to decide what to do when only half a name was given.
String!
The account’s mobile number.
Non-null because it is the account’s identity: a Kaladan customer is created by verifying a number, so one cannot exist without it.
String
The account’s email, when there is one.
DeliveryMethodType
Section titled “DeliveryMethodType”How a delivery reaches the buyer.
| Value | Meaning |
|---|---|
SHIPPING | A carrier ships it. |
PICKUP | The buyer collects it. |
LOCAL_DELIVERY | The merchant delivers it locally, often same-day. |
NONE | Nothing ships — a digital product. |
DeliveryProfileCharge
Section titled “DeliveryProfileCharge”What one shipping profile contributed to a delivery option’s price.
A cart holding goods that do not ship alike pays for each parcel. This says which parcel cost what, so a storefront can explain the total instead of presenting a number that looks wrong.
profileName
Section titled “profileName”String!
The profile’s name, as the merchant wrote it — «مبلمان».
amount
Section titled “amount”Money!
What this profile’s rate charged.
lineCount
Section titled “lineCount”Int!
How many of the cart’s lines fall under it.
freeShippingApplied
Section titled “freeShippingApplied”Boolean!
Whether this profile’s charge was waived by its own free-shipping threshold.
Thresholds apply per profile, against that profile’s own subtotal: two shirts and a sofa do not earn free sofa delivery because the shirts pushed the cart total over the line.
DeliveryWindow
Section titled “DeliveryWindow”When something should arrive.
Both bounds may be null when the carrier will not commit to an estimate, which several Iranian couriers will not.
DateTime
Earliest expected arrival.
DateTime
Latest expected arrival.
businessDays
Section titled “businessDays”Int
Business days, as the carrier states it.
Alongside the timestamps rather than derived from them, because “۲ تا ۳ روز کاری” is what the carrier promises and what the merchant is held to; the timestamps are this platform’s reading of it against a holiday calendar.
DiscountTargetType
Section titled “DiscountTargetType”What a discount reduced.
| Value | Meaning |
|---|---|
LINE_ITEM | One or more lines. |
ORDER | The order total. |
SHIPPING | The delivery cost. |
InvoiceBuyerType
Section titled “InvoiceBuyerType”Who an official invoice is issued to.
The buyer classes سامانه مودیان recognises. FINAL_CONSUMER is the default and
covers an ordinary retail sale, where no identifying detail is required at all.
| Value | Meaning |
|---|---|
FINAL_CONSUMER | مصرفکننده نهایی — a retail buyer, identified by nothing. |
INDIVIDUAL | شخص حقیقی — an individual, identified by کد ملی. |
LEGAL_ENTITY | شخص حقوقی — a company, identified by شناسه ملی and کد اقتصادی. |
PARTNERSHIP | مشارکت مدنی — a civil partnership. |
NON_IRANIAN | اتباع غیرایرانی — a non-Iranian national. |
InvoiceRequest
Section titled “InvoiceRequest”A request for an official invoice — فاکتور رسمی.
The fields are the ones سامانه مودیان needs to accept an electronic invoice, and
which of them are required depends on buyerType: an individual is identified
by کد ملی, a company by شناسه ملی and کد اقتصادی. The mutation validates the
combination and returns REQUIRED against the specific missing field.
requested
Section titled “requested”Boolean!
Whether one was asked for.
buyerType
Section titled “buyerType”InvoiceBuyerType!
What kind of buyer the invoice is issued to.
legalName
Section titled “legalName”String
The name to issue it to — a person’s or a company’s.
nationalId
Section titled “nationalId”String
کد ملی for an individual, شناسه ملی for a legal entity.
economicCode
Section titled “economicCode”String
کد اقتصادی. Legal entities only.
registrationNumber
Section titled “registrationNumber”String
شماره ثبت. Legal entities only.
address
Section titled “address”Address
The registered address the invoice is issued to.
InvoiceRequestInput
Section titled “InvoiceRequestInput”A request for an official invoice.
requested
Section titled “requested”Boolean!
False clears a previous request and every field with it.
buyerType
Section titled “buyerType”InvoiceBuyerType
Whether the invoice is for a person or a company. Decides which of the fields below are required.
legalName
Section titled “legalName”String
The name the invoice is issued to — a person’s full name, or the registered company name exactly as ثبت شرکتها holds it.
nationalId
Section titled “nationalId”String
کد ملی for a person, شناسه ملی for a company. Ten digits and eleven respectively; the check digit is validated.
economicCode
Section titled “economicCode”String
کد اقتصادی. Required for a company, meaningless for a person.
registrationNumber
Section titled “registrationNumber”String
شماره ثبت. Companies only.
address
Section titled “address”AddressInput
The legal address the invoice is issued to, which need not be where the order is delivered.
PickupLocation
Section titled “PickupLocation”Somewhere a buyer can collect an order.
ID!
A globally unique, opaque identifier. Never parse or construct one.
String!
The location’s name.
address
Section titled “address”Address!
Where it is.
String
Opening hours, as the merchant wrote them.
instructions
Section titled “instructions”String
Instructions for collection.