Draft orders
DraftInvoiceRequest
Section titled “DraftInvoiceRequest”A request for an official invoice, collected on a draft.
requested
Section titled “requested”Boolean!
No description.
buyerType
Section titled “buyerType”InvoiceBuyerType!
No description.
legalName
Section titled “legalName”String
No description.
nationalId
Section titled “nationalId”String
کد ملی for an individual, شناسه ملی for a company.
economicCode
Section titled “economicCode”String
No description.
registrationNumber
Section titled “registrationNumber”String
No description.
DraftInvoiceRequestInput
Section titled “DraftInvoiceRequestInput”An official-invoice request as supplied.
requested
Section titled “requested”Boolean!
No description.
buyerType
Section titled “buyerType”InvoiceBuyerType
No description.
legalName
Section titled “legalName”String
No description.
nationalId
Section titled “nationalId”String
No description.
economicCode
Section titled “economicCode”String
No description.
registrationNumber
Section titled “registrationNumber”String
No description.
DraftOrder
Section titled “DraftOrder”An order being built by a staff member, before the buyer has paid.
ID!
No description.
version
Section titled “version”Version!
No description.
number
Section titled “number”String!
Merchant-facing, and distinct from an order number so the two never collide.
status
Section titled “status”DraftOrderStatus!
No description.
[DraftOrderLine!]!
No description.
customer
Section titled “customer”Customer
Who it is for. Either an existing customer or a phone number typed in.
Optional until completion: a merchant quoting a price does not yet know who they are quoting to, and a form that demands it first is a form nobody uses.
company
Section titled “company”Company
The company it is quoted for, when the merchant named one — a wholesale buyer
ordering on a company’s account. The order it becomes records the same
company, and Company.outstandingBalance counts it once it is placed. Null
when none was named, and for one the shop no longer holds.
buyerPhone
Section titled “buyerPhone”String
No description.
buyerEmail
Section titled “buyerEmail”String
No description.
buyerName
Section titled “buyerName”String
No description.
shippingAddress
Section titled “shippingAddress”Address
No description.
DraftOrderCost!
What it comes to. Recomputed on every change.
manualDiscount
Section titled “manualDiscount”ManualDiscount
A discount a staff member applied by hand, outside any campaign.
Its own object because it is the one number on a draft that a merchant will be
asked to justify — it appears on the order as a MANUAL discount
application, naming who granted it.
deliveryOptionTitle
Section titled “deliveryOptionTitle”String
Delivery, when the merchant has chosen one.
shippingAmount
Section titled “shippingAmount”Money
No description.
deliveryMethod
Section titled “deliveryMethod”DeliveryMethodType!
No description.
taxLines
Section titled “taxLines”[TaxLine!]!
No description.
taxesIncluded
Section titled “taxesIncluded”Boolean!
Whether prices already include VAT, as most Iranian shop prices do.
invoiceRequest
Section titled “invoiceRequest”DraftInvoiceRequest
A request for an official invoice — فاکتور رسمی.
paymentLink
Section titled “paymentLink”PaymentLink
Where to send the buyer to pay.
Minted by draftOrderSendPaymentLink and null until then. Short-lived and
re-mintable: a link that has expired is replaced, not resurrected.
paymentLinkTextCheck
Section titled “paymentLinkTextCheck”OrderTextCheck
Whether Kaladan’s text with this draft’s link could go now — what a send dialog reads before the merchant presses send, so “no credit, no text” is said first and nothing is minted for a text that cannot go. Sends nothing and charges nothing. Null when the messaging service does not answer.
reservesInventory
Section titled “reservesInventory”Boolean!
Whether stock is being held for this draft.
Off by default. A quote that reserves stock is a quote that can starve a real sale, so reserving is a decision a merchant makes per draft.
reservationExpiresAt
Section titled “reservationExpiresAt”DateTime
No description.
Order
The order this became, once completed.
String
No description.
[String!]!
No description.
createdBy
Section titled “createdBy”StaffMember
No description.
createdAt
Section titled “createdAt”DateTime!
No description.
updatedAt
Section titled “updatedAt”DateTime!
No description.
completedAt
Section titled “completedAt”DateTime
No description.
metafield
Section titled “metafield”Metafield
No description.
| Argument | Type | Meaning |
|---|---|---|
namespace | String | No description. |
key | String! | No description. |
metafields
Section titled “metafields”[Metafield]!
No description.
| Argument | Type | Meaning |
|---|---|---|
identifiers | [MetafieldIdentifier!]! | No description. |
DraftOrderCompleteInput
Section titled “DraftOrderCompleteInput”How to complete a draft.
markAsPaid
Section titled “markAsPaid”Boolean
Whether the order is created already paid.
True when the merchant has taken the money outside the platform — cash over a
counter, or a card-to-card transfer they have checked themselves. The money is
recorded with the payment service — cash as a collection, a transfer as a
receipt approved in the same gesture — with the staff member as its actor, so
it is auditable rather than invisible. The order is placed unpaid and reads
paid a moment later, once that payment is announced; the order in this
completion’s payload still reads PENDING. Recording money needs
WRITE_PAYMENTS — FORBIDDEN on input.markAsPaid otherwise.
False creates the order PENDING, which is what a payment link produces.
paymentMethod
Section titled “paymentMethod”PaymentMethodType
The method to record, when markAsPaid is true: CASH_ON_DELIVERY for cash
taken by hand, or CARD_TO_CARD. Only those two — a wallet or a gateway
payment has no way to be recorded by hand, and any other is INVALID,
params.available naming the two.
paymentReference
Section titled “paymentReference”String
The transfer’s tracking number. Required for CARD_TO_CARD (REQUIRED) —
a receipt with neither a photo nor a reference is one nobody can review, and a
draft has no photo — and optional for cash. One already approved on another
order is TAKEN, and the order is then placed unpaid beside the refusal.
notifyCustomer
Section titled “notifyCustomer”Boolean
No description.
DraftOrderCompletePayload
Section titled “DraftOrderCompletePayload”What draftOrderComplete returns.
Order
The order it became.
draftOrder
Section titled “draftOrder”DraftOrder
No description.
userErrors
Section titled “userErrors”[UserError!]!
Why it could not complete.
INSUFFICIENT_STOCK when the goods went while the draft sat — the commonest
failure, and the reason reservesInventory exists. REQUIRED when an
official invoice was asked for and its identifying fields are missing.
DraftOrderConnection
Section titled “DraftOrderConnection”A page of drafts.
[DraftOrderEdge!]!
No description.
[DraftOrder!]!
No description.
pageInfo
Section titled “pageInfo”PageInfo!
No description.
totalCount
Section titled “totalCount”Int!
No description.
DraftOrderCost
Section titled “DraftOrderCost”What a draft comes to.
subtotalAmount
Section titled “subtotalAmount”Money!
No description.
totalDiscountAmount
Section titled “totalDiscountAmount”Money!
No description.
shippingAmount
Section titled “shippingAmount”Money!
No description.
totalTaxAmount
Section titled “totalTaxAmount”Money!
No description.
totalAmount
Section titled “totalAmount”Money!
No description.
DraftOrderCreateInput
Section titled “DraftOrderCreateInput”A new draft.
[DraftOrderLineInput!]
No description.
customerId
Section titled “customerId”ID
No description.
companyId
Section titled “companyId”ID
The company the draft is quoted for. One the shop does not hold is
NOT_FOUND on input.companyId, and nothing is created.
buyerPhone
Section titled “buyerPhone”String
No description.
buyerEmail
Section titled “buyerEmail”String
No description.
buyerName
Section titled “buyerName”String
No description.
shippingAddress
Section titled “shippingAddress”AddressInput
No description.
manualDiscount
Section titled “manualDiscount”ManualDiscountInput
No description.
shippingAmount
Section titled “shippingAmount”MoneyInput
No description.
deliveryOptionTitle
Section titled “deliveryOptionTitle”String
No description.
deliveryMethod
Section titled “deliveryMethod”DeliveryMethodType
No description.
invoiceRequest
Section titled “invoiceRequest”DraftInvoiceRequestInput
No description.
reservesInventory
Section titled “reservesInventory”Boolean
No description.
String
No description.
[String!]
No description.
metafields
Section titled “metafields”[MetafieldInput!]
No description.
DraftOrderEdge
Section titled “DraftOrderEdge”One draft, with its cursor.
cursor
Section titled “cursor”String!
No description.
DraftOrder!
No description.
DraftOrderFilter
Section titled “DraftOrderFilter”A filter on the draft list.
status
Section titled “status”[DraftOrderStatus!]
No description.
createdById
Section titled “createdById”ID
No description.
customerId
Section titled “customerId”ID
No description.
String
No description.
createdAfter
Section titled “createdAfter”DateTime
No description.
paymentLinkExpired
Section titled “paymentLinkExpired”Boolean
Drafts whose payment link has expired unpaid. The follow-up queue.
DraftOrderLine
Section titled “DraftOrderLine”One line of a draft.
ID!
No description.
variant
Section titled “variant”ProductVariant
What is being sold, when it comes from the catalogue.
Null for a custom line — a made-to-order item, an alteration charge, a delivery surcharge the merchant is quoting by hand. Custom lines are the reason this field is nullable, and they are common in exactly the conversational selling this object exists for.
String!
No description.
variantTitle
Section titled “variantTitle”String
No description.
String
No description.
quantity
Section titled “quantity”Int!
No description.
unitPrice
Section titled “unitPrice”Money!
What the merchant is charging. Overridable per line, unlike a cart.
originalUnitPrice
Section titled “originalUnitPrice”Money
The catalogue price, when there is one and it differs. For showing the gap.
totalPrice
Section titled “totalPrice”Money!
No description.
requiresShipping
Section titled “requiresShipping”Boolean!
No description.
taxable
Section titled “taxable”Boolean!
No description.
attributes
Section titled “attributes”[Attribute!]!
No description.
DraftOrderLineInput
Section titled “DraftOrderLineInput”One line of a draft.
Supply variantId for a catalogue item, or title and unitPrice for a custom
one. Supplying both is INCONSISTENT.
variantId
Section titled “variantId”ID
No description.
String
Required for a custom line, ignored for a catalogue one.
quantity
Section titled “quantity”Int!
No description.
unitPrice
Section titled “unitPrice”MoneyInput
Overrides the catalogue price. Required for a custom line.
Recorded against the staff member who set it: a price typed by hand on a draft is the other number a merchant will be asked to justify.
requiresShipping
Section titled “requiresShipping”Boolean
No description.
taxable
Section titled “taxable”Boolean
No description.
attributes
Section titled “attributes”[AttributeInput!]
No description.
DraftOrderPayload
Section titled “DraftOrderPayload”What the draft-order mutations return.
draftOrder
Section titled “draftOrder”DraftOrder
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
DraftOrderSortKeys
Section titled “DraftOrderSortKeys”How a draft list is ordered.
| Value | Meaning |
|---|---|
CREATED_AT | No description. |
UPDATED_AT | No description. |
TOTAL | No description. |
NUMBER | No description. |
DraftOrderStatus
Section titled “DraftOrderStatus”Where a draft order has got to.
| Value | Meaning |
|---|---|
OPEN | Being built. Nothing has been sent to the buyer. |
AWAITING_PAYMENT | A payment link has been sent and not yet paid. |
COMPLETED | Became an order. |
CANCELLED | Abandoned. Kept, because a merchant quoting the same buyer again wants it. |
DraftOrderUpdateInput
Section titled “DraftOrderUpdateInput”Changes to a draft. Partial; lines and tags replace wholesale when present.
[DraftOrderLineInput!]
No description.
customerId
Section titled “customerId”ID
No description.
companyId
Section titled “companyId”ID
The company, as on a create: absent is unchanged, null clears it, and one the
shop does not hold is NOT_FOUND on input.companyId.
buyerPhone
Section titled “buyerPhone”String
No description.
buyerEmail
Section titled “buyerEmail”String
No description.
buyerName
Section titled “buyerName”String
No description.
shippingAddress
Section titled “shippingAddress”AddressInput
No description.
manualDiscount
Section titled “manualDiscount”ManualDiscountInput
No description.
shippingAmount
Section titled “shippingAmount”MoneyInput
No description.
deliveryOptionTitle
Section titled “deliveryOptionTitle”String
No description.
deliveryMethod
Section titled “deliveryMethod”DeliveryMethodType
No description.
invoiceRequest
Section titled “invoiceRequest”DraftInvoiceRequestInput
No description.
reservesInventory
Section titled “reservesInventory”Boolean
No description.
String
No description.
[String!]
No description.
metafields
Section titled “metafields”[MetafieldInput!]
No description.
InvoiceBuyerType
Section titled “InvoiceBuyerType”Who an official invoice is issued to. The classes سامانه مودیان recognises.
| 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. |
ManualDiscount
Section titled “ManualDiscount”A discount a staff member applied by hand.
ManualDiscountKind!
Fixed amount off, or a percentage.
Decimal!
No description.
amount
Section titled “amount”Money!
What came off, once computed.
reason
Section titled “reason”String
The merchant’s reason. Shown in the audit log and on the order.
grantedBy
Section titled “grantedBy”StaffMember
No description.
ManualDiscountInput
Section titled “ManualDiscountInput”A hand-applied discount.
ManualDiscountKind!
No description.
Decimal!
No description.
reason
Section titled “reason”String
No description.
ManualDiscountKind
Section titled “ManualDiscountKind”How a manual discount is expressed.
| Value | Meaning |
|---|---|
FIXED_AMOUNT | No description. |
PERCENTAGE | No description. |
OrderTextCheck
Section titled “OrderTextCheck”Whether one of Kaladan’s texts with a payment link could go now, as
DraftOrder.paymentLinkTextCheck and Order.paymentLinkTextCheck read it.
sendable
Section titled “sendable”Boolean!
Whether a text sent now would go: the shop has a service line, the credit covers it, and it fits. It says nothing about the buyer’s number, which is read only when the text is sent.
reason
Section titled “reason”OrderTextUnavailableReason
Why it would not, when sendable is false.
segments
Section titled “segments”Int!
What it would cost, in SMS credits (segments), counted with the shop’s name
and its primary domain. Zero when it is TOO_LONG.
OrderTextUnavailableReason
Section titled “OrderTextUnavailableReason”Why Kaladan’s text with a payment link cannot go.
| Value | Meaning |
|---|---|
NO_SERVICE_LINE | The shop has no active service line. Said first, because no top-up fixes it: Kaladan’s support provisions the line. |
NO_CREDIT | The SMS credit does not cover the text. Buy credit — smsCreditPurchase — or copy the link instead. |
TOO_LONG | The text cannot fit three segments even with the shop’s name shortened, which only an unusually long domain does. |
PaymentLink
Section titled “PaymentLink”Where to send a buyer to pay: a draft, or what an order still owes after an edit.
URL!
No description.
expiresAt
Section titled “expiresAt”DateTime!
Short-lived, and re-mintable. An expired link is replaced, not resurrected.
sentAt
Section titled “sentAt”DateTime
When it was last sent, and how. Null for an order’s link a commit minted and nobody sent.
sentVia
Section titled “sentVia”PaymentLinkChannel
No description.
viewCount
Section titled “viewCount”Int!
How many times the buyer has opened it. The signal a merchant reads before chasing.
status
Section titled “status”PaymentLinkStatus!
Where it stands, read rather than stored. A draft’s link is OPEN until it
expires.
amountDue
Section titled “amountDue”Money
What it asks the buyer for now: what the order owes, never more than it was
minted for. Zero once it is not OPEN. Null for a draft’s link, which asks
for the draft’s total.
PaymentLinkChannel
Section titled “PaymentLinkChannel”How a payment link reached the buyer.
| Value | Meaning |
|---|---|
SMS | A text from Kaladan, and the default. Kaladan’s own fixed wording, signed «کالادان», naming the shop and carrying the link, on a service line — nothing the merchant writes ever goes this way — and paid from the shop’s SMS credit at the normal rate: no credit, no text. The link is minted only once the text can go; see draftOrderSendPaymentLink. |
EMAIL | Not carried yet: SMS only until an email provider is chosen. Refused — INVALID_STATE on input.channel, params.available naming manual and sms — and nothing is minted. |
MANUAL | Copied by the staff member to paste into a DM themselves. |
PaymentLinkPayload
Section titled “PaymentLinkPayload”What draftOrderSendPaymentLink returns.
paymentLink
Section titled “paymentLink”PaymentLink
No description.
draftOrder
Section titled “draftOrder”DraftOrder
No description.
textStatus
Section titled “textStatus”PaymentLinkTextStatus
Whether Kaladan’s text with the link went, for SMS; null for MANUAL and
when no link was minted.
userErrors
Section titled “userErrors”[UserError!]!
Why it could not be sent. Empty with a link: minted, and texted as
textStatus says. Non-empty beside a link when the link was minted and
its text did not go (textStatus NOT_SENT): the link exists for the
merchant to copy, and the refusal says why the text did not go. Non-empty
with no link: nothing was minted.
PaymentLinkSendInput
Section titled “PaymentLinkSendInput”How to send a payment link.
channel
Section titled “channel”PaymentLinkChannel
SMS or MANUAL; EMAIL is not carried yet. See PaymentLinkChannel.
String
A draft’s link only, by SMS: the mobile number the text goes to instead
of the draft’s own and its customer’s — the merchant on the telephone with the
buyer knows it. Not a mobile number → INVALID on input.phone, nothing
minted. An order’s link refuses it (INVALID on input.phone): that text
goes to the order’s own buyer. Not used with MANUAL.
expiresInHours
Section titled “expiresInHours”Int
How long the link lives. Capped by the platform.
PaymentLinkStatus
Section titled “PaymentLinkStatus”Where a payment link stands.
| Value | Meaning |
|---|---|
OPEN | Asking the buyer for money. |
PAID | The order owes nothing — paid through this link or any other way. Said first, whatever else became of the link. |
EXPIRED | It outlived its lifetime. Mint another; an expired link is never resurrected. |
REVOKED | A newer link replaced it, or its order was cancelled. |
PaymentLinkTextStatus
Section titled “PaymentLinkTextStatus”Whether Kaladan’s text with a payment link went, for a link sent by SMS.
| Value | Meaning |
|---|---|
SENT | Handed to the SMS provider and charged to the shop’s SMS credit. |
SENDING | Recorded and being sent, by this request or another one already sending it. It goes shortly, or fails and is not charged. |
NOT_SENT | Not sent and not charged; userErrors says why — no credit, no service line, nobody to reach, or the provider refused it. The link exists: copy it. |
UNCONFIRMED | The messaging service did not answer in time. The link exists, and the text may still go — Kaladan sends a text it recorded once the service is back — but nothing here confirms it: copy the link if the buyer must have it now. |