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

Draft orders

Object

A request for an official invoice, collected on a draft.

Boolean!

No description.

InvoiceBuyerType!

No description.

String

No description.

String

کد ملی for an individual, شناسه ملی for a company.

String

No description.

String

No description.

Input

An official-invoice request as supplied.

Boolean!

No description.

InvoiceBuyerType

No description.

String

No description.

String

No description.

String

No description.

String

No description.

Object

An order being built by a staff member, before the buyer has paid.

ID!

No description.

Version!

No description.

String!

Merchant-facing, and distinct from an order number so the two never collide.

DraftOrderStatus!

No description.

[DraftOrderLine!]!

No description.

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

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.

String

No description.

String

No description.

String

No description.

Address

No description.

DraftOrderCost!

What it comes to. Recomputed on every change.

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.

String

Delivery, when the merchant has chosen one.

Money

No description.

DeliveryMethodType!

No description.

[TaxLine!]!

No description.

Boolean!

Whether prices already include VAT, as most Iranian shop prices do.

DraftInvoiceRequest

A request for an official invoice — فاکتور رسمی.

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.

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.

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.

DateTime

No description.

Order

The order this became, once completed.

String

No description.

[String!]!

No description.

StaffMember

No description.

DateTime!

No description.

DateTime!

No description.

DateTime

No description.

Metafield

No description.

ArgumentTypeMeaning
namespaceStringNo description.
keyString!No description.

[Metafield]!

No description.

ArgumentTypeMeaning
identifiers[MetafieldIdentifier!]!No description.
Input

How to complete a draft.

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.

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.

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.

Boolean

No description.

Object

What draftOrderComplete returns.

Order

The order it became.

DraftOrder

No description.

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

Object

A page of drafts.

[DraftOrderEdge!]!

No description.

[DraftOrder!]!

No description.

PageInfo!

No description.

Int!

No description.

Object

What a draft comes to.

Money!

No description.

Money!

No description.

Money!

No description.

Money!

No description.

Money!

No description.

Input

A new draft.

[DraftOrderLineInput!]

No description.

ID

No description.

ID

The company the draft is quoted for. One the shop does not hold is NOT_FOUND on input.companyId, and nothing is created.

String

No description.

String

No description.

String

No description.

AddressInput

No description.

ManualDiscountInput

No description.

MoneyInput

No description.

String

No description.

DeliveryMethodType

No description.

DraftInvoiceRequestInput

No description.

Boolean

No description.

String

No description.

[String!]

No description.

[MetafieldInput!]

No description.

Object

One draft, with its cursor.

String!

No description.

DraftOrder!

No description.

Input

A filter on the draft list.

[DraftOrderStatus!]

No description.

ID

No description.

ID

No description.

String

No description.

DateTime

No description.

Boolean

Drafts whose payment link has expired unpaid. The follow-up queue.

Object

One line of a draft.

ID!

No description.

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.

String

No description.

String

No description.

Int!

No description.

Money!

What the merchant is charging. Overridable per line, unlike a cart.

Money

The catalogue price, when there is one and it differs. For showing the gap.

Money!

No description.

Boolean!

No description.

Boolean!

No description.

[Attribute!]!

No description.

Input

One line of a draft.

Supply variantId for a catalogue item, or title and unitPrice for a custom one. Supplying both is INCONSISTENT.

ID

No description.

String

Required for a custom line, ignored for a catalogue one.

Int!

No description.

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.

Boolean

No description.

Boolean

No description.

[AttributeInput!]

No description.

Object

What the draft-order mutations return.

DraftOrder

No description.

[UserError!]!

No description.

Enum

How a draft list is ordered.

ValueMeaning
CREATED_ATNo description.
UPDATED_ATNo description.
TOTALNo description.
NUMBERNo description.
Enum

Where a draft order has got to.

ValueMeaning
OPENBeing built. Nothing has been sent to the buyer.
AWAITING_PAYMENTA payment link has been sent and not yet paid.
COMPLETEDBecame an order.
CANCELLEDAbandoned. Kept, because a merchant quoting the same buyer again wants it.
Input

Changes to a draft. Partial; lines and tags replace wholesale when present.

[DraftOrderLineInput!]

No description.

ID

No description.

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.

String

No description.

String

No description.

String

No description.

AddressInput

No description.

ManualDiscountInput

No description.

MoneyInput

No description.

String

No description.

DeliveryMethodType

No description.

DraftInvoiceRequestInput

No description.

Boolean

No description.

String

No description.

[String!]

No description.

[MetafieldInput!]

No description.

Enum

Who an official invoice is issued to. The classes سامانه مودیان recognises.

ValueMeaning
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.
Object

A discount a staff member applied by hand.

ManualDiscountKind!

Fixed amount off, or a percentage.

Decimal!

No description.

Money!

What came off, once computed.

String

The merchant’s reason. Shown in the audit log and on the order.

StaffMember

No description.

Input

A hand-applied discount.

ManualDiscountKind!

No description.

Decimal!

No description.

String

No description.

Enum

How a manual discount is expressed.

ValueMeaning
FIXED_AMOUNTNo description.
PERCENTAGENo description.
Object

Whether one of Kaladan’s texts with a payment link could go now, as DraftOrder.paymentLinkTextCheck and Order.paymentLinkTextCheck read it.

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.

OrderTextUnavailableReason

Why it would not, when sendable is false.

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.

Enum

Why Kaladan’s text with a payment link cannot go.

ValueMeaning
NO_SERVICE_LINEThe shop has no active service line. Said first, because no top-up fixes it: Kaladan’s support provisions the line.
NO_CREDITThe SMS credit does not cover the text. Buy credit — smsCreditPurchase — or copy the link instead.
TOO_LONGThe text cannot fit three segments even with the shop’s name shortened, which only an unusually long domain does.
Object

Where to send a buyer to pay: a draft, or what an order still owes after an edit.

URL!

No description.

DateTime!

Short-lived, and re-mintable. An expired link is replaced, not resurrected.

DateTime

When it was last sent, and how. Null for an order’s link a commit minted and nobody sent.

PaymentLinkChannel

No description.

Int!

How many times the buyer has opened it. The signal a merchant reads before chasing.

PaymentLinkStatus!

Where it stands, read rather than stored. A draft’s link is OPEN until it expires.

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.

Enum

How a payment link reached the buyer.

ValueMeaning
SMSA 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.
EMAILNot 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.
MANUALCopied by the staff member to paste into a DM themselves.
Object

What draftOrderSendPaymentLink returns.

PaymentLink

No description.

DraftOrder

No description.

PaymentLinkTextStatus

Whether Kaladan’s text with the link went, for SMS; null for MANUAL and when no link was minted.

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

Input

How to send a payment link.

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.

Int

How long the link lives. Capped by the platform.

Enum

Where a payment link stands.

ValueMeaning
OPENAsking the buyer for money.
PAIDThe order owes nothing — paid through this link or any other way. Said first, whatever else became of the link.
EXPIREDIt outlived its lifetime. Mint another; an expired link is never resurrected.
REVOKEDA newer link replaced it, or its order was cancelled.
Enum

Whether Kaladan’s text with a payment link went, for a link sent by SMS.

ValueMeaning
SENTHanded to the SMS provider and charged to the shop’s SMS credit.
SENDINGRecorded and being sent, by this request or another one already sending it. It goes shortly, or fails and is not charged.
NOT_SENTNot 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.
UNCONFIRMEDThe 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.