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

Tax and Moadian

Input

One line’s commodity code.

Exactly one of orderLineId and lineId. A line that came from the sale is named by its order line; one that came from no order line — the delivery charge — by MoadianInvoiceLine.id. Both, or neither, is INVALID.

ID

No description.

ID

No description.

String!

No description.

Object

What a bulk filing returns.

Job

The job doing the filing. Poll it, or wait for its completion event.

Int!

How many invoices were queued.

[UserError!]!

No description.

Object

An electronic invoice — صورتحساب الکترونیکی.

The record of what is owed to the tax system for one order, and of every attempt to file it.

ID!

No description.

Order!

No description.

String

شماره منحصر به فرد مالیاتی — assigned when a submission is accepted.

Null until then, which is why it cannot be used as this object’s identity.

MoadianInvoiceStatus!

No description.

MoadianInvoiceType!

الگوی صورتحساب — the legal pattern. Type 1 is the ordinary retail sale.

Distinct from subject below, and conflating them was a real defect: the tax system asks two separate questions and this schema answered them with one field.

MoadianInvoiceSubject!

موضوع صورتحساب — what this filing does to the record.

اصلی for an original, اصلاحی to correct one, ابطالی to cancel one, برگشتی for a sales return. A correction of a type-1 retail sale is still type 1; only the subject changes. Filing it as a different type is a rejection.

InvoiceBuyerType!

Who it is issued to.

String

No description.

String

کد ملی or شناسه ملی, masked.

String

No description.

[MoadianInvoiceLine!]!

No description.

Money!

No description.

Money!

No description.

Money!

No description.

[MoadianSubmission!]!

Every attempt to file it, newest first.

Plural because rejection is normal: a mistyped identifier produces a rejection with a code, the merchant corrects it, and a second submission goes out. A merchant asking “why has this not been accepted” is asking to read this list.

DateTime

When it must be filed by.

Computed from the order date and the regulated window. An admin should sort by it and shout before it passes, because the penalty lands on the merchant and the platform is what they will blame.

MoadianInvoice

The accepted invoice this supersedes, cancels or returns against.

Null for an original. Required for every other subject, and the tax system refuses a correction that does not name what it corrects.

[MoadianInvoice!]!

Filings made against this one — corrections, a cancellation, returns.

The other direction, and the one an accountant actually reads: given an invoice, what happened to it afterwards. An accepted invoice with a return filed against it is not the same as an accepted invoice, and nothing but this said so.

DateTime!

No description.

Object

A page of electronic invoices.

[MoadianInvoiceEdge!]!

No description.

[MoadianInvoice!]!

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.

Input

Corrections to an invoice before it is resubmitted.

InvoiceBuyerType

No description.

String

No description.

String

No description.

String

No description.

[CommodityCodeInput!]

Commodity codes for lines that lacked one, each naming its line by the order line it came from or by its own id.

Object

One invoice, with its cursor.

String!

No description.

MoadianInvoice!

No description.

Input

A filter on the invoice list.

[MoadianInvoiceStatus!]

No description.

[MoadianInvoiceType!]

No description.

[MoadianInvoiceSubject!]

Filter by what a filing does — originals, corrections, returns.

ID

No description.

DateTime

No description.

DateTime

No description.

Boolean

Invoices whose filing deadline has passed or is close.

The queue that matters. Everything else on this screen is history.

Boolean

Invoices rejected and not yet corrected.

Object

One line of an electronic invoice.

ID!

This line of the filing, as a correction names it.

The only way to name a line that came from no order line — the delivery charge, which no product’s category classifies and which takes its commodity code by hand.

OrderLine

The order line it came from. Null for a line added by hand.

String!

No description.

String

شناسه کالا/خدمت — the tax system’s own commodity code.

Required, and the field most likely to be missing: it comes from the product’s taxonomy mapping, and a product nobody classified has none.

Float!

No description.

Money!

No description.

Money!

No description.

Float!

No description.

Money!

No description.

Money!

No description.

Object

What the invoice mutations return.

MoadianInvoice

No description.

[UserError!]!

No description.

Enum

Where an invoice stands with the tax system.

ValueMeaning
DRAFTOwed, not yet queued. The state that accrues quietly.
QUEUEDWaiting to be sent.
SUBMITTEDSent. No verdict yet — inquiry is a separate call.
ACCEPTEDNo description.
REJECTEDRefused. The latest submission carries the code and the message. Not terminal: correct and resubmit.
CANCELLEDWithdrawn after acceptance, by a cancellation filing.
Enum

موضوع صورتحساب — what this filing does to the tax record.

Orthogonal to MoadianInvoiceType. A correction to a retail sale is type 1, subject اصلاحی. Filing it as its own type is rejected, which is the mistake conflating the two would have produced on every correction a merchant ever filed.

ValueMeaning
ORIGINALاصلی — an original filing.
CORRECTIVEاصلاحی — corrects an accepted invoice. Replaces it: the corrected invoice supersedes the original, which stays on file. Used for a mistyped identifier or a wrong rate.
VOIDابطالی — cancels an accepted invoice outright. For a sale that did not happen. Distinct from a return, where it did happen and the goods came back.
RETURNبرگشتی — برگشت از فروش, a sales return. What an accepted invoice needs when its order is later refunded: MoadianInvoiceStatus.ACCEPTED is terminal, so a refund afterwards is filed as a return.
Enum

الگوی صورتحساب — which legal pattern this invoice follows.

The tax system’s own typing, and it answers “what sort of transaction is this”, not “what is this filing doing”. The second question is MoadianInvoiceSubject.

ValueMeaning
TYPE_1_SALEنوع ۱ — فروش. The ordinary retail sale, and almost everything a shop files.
TYPE_2_AGGREGATEنوع ۲ — a sale to a buyer with no شناسه, filed in aggregate. Declared because a shop selling to walk-in buyers without collecting a national id files these, and a model that could not express one would send the merchant back to a spreadsheet at exactly the wrong moment.
TYPE_3_GOLDطلا و جواهر — gold and jewellery, which are taxed on the wage, not the metal.
TYPE_4_EXPORTصادرات — an export sale, zero-rated.
TYPE_5_CONTRACTقرارداد پیمانکاری — a contracting agreement.
Enum

How invoices reach the tax system.

ValueMeaning
DIRECTThe merchant files directly, holding their own certificate.
INTERMEDIARYThrough a شرکت معتمد — a trusted intermediary. What most merchants do.
Input

What is coming back, for a برگشت از فروش filing.

[MoadianReturnLineInput!]

The lines returned, and how many of each.

Empty returns the whole invoice, which is the common case for a cancelled order — and wrong for a buyer who sent back one of three items.

ID

The refund this return accounts for, so the two records agree.

String

No description.

Input

One line coming back.

ID!

No description.

Float!

No description.

Object

One attempt to file an invoice.

ID!

No description.

String

The reference the tax system returned for this attempt.

MoadianSubmissionStatus!

No description.

DateTime!

When it went.

DateTime

When the platform last asked what became of it.

Int!

No description.

String

The tax system’s own error code and message, untranslated.

A pass-through of somebody else’s error rather than this API’s taxonomy: it is actionable only by the merchant or their accountant, and translating it would lose the code they will be asked to quote.

String

No description.

String

Which field the error names, when it names one.

Enum

Where one filing attempt stands.

ValueMeaning
PENDINGSent; the tax system has not answered.
ACCEPTEDNo description.
REJECTEDNo description.
TIMED_OUTThe tax system did not respond at all. Retried by the platform. Distinct from REJECTED: a rejection needs the merchant, a timeout needs patience.
Input

An electronic seal certificate to install.

ID!

A staged upload of the certificate file — .p12 or .pfx.

String!

The passphrase protecting it.

Write-only: no field returns it, and it is stored encrypted beside the key it protects. A merchant who loses it re-uploads.

Object

The shop’s tax settings.

Boolean!

Whether the merchant charges VAT — مالیات بر ارزش افزوده.

Float!

The rate, as a fraction. 0.09 for nine per cent.

A single rate, because that is what Iranian retail charges. Per-category rates are a later problem and would change this to a list.

Boolean!

Whether displayed prices already include VAT.

Almost always true here: an Iranian shop shows the price the buyer pays. It changes how every total is computed, so it is a shop-level fact rather than a per-product one.

Boolean!

Whether official invoices are filed with سامانه مودیان at all.

MoadianMode

How invoices reach the tax system.

Direct requires the merchant to hold their own certificate and memory-unit id. Through a trusted intermediary — شرکت معتمد — is what most merchants do.

String

شناسه یکتای حافظه مالیاتی — the memory-unit id.

Nothing can be filed without it. Masked on read.

String

The intermediary, when filing through one.

VerificationState!

Whether the electronic seal certificate is present and unexpired.

Its expiry is the failure nobody notices until filings start bouncing, so it is surfaced with a date rather than a boolean alone.

DateTime

No description.

Int!

How long after a sale an invoice must be filed.

Set by regulation and carried here so an admin can count down rather than making every merchant remember it.

Input

Changes to the shop’s tax settings. Partial.

Boolean

No description.

Float

No description.

Boolean

No description.

Boolean

No description.

MoadianMode

No description.

String

Write-only. Never returned; stored encrypted.

String

No description.

Object

What the tax-configuration mutation returns.

TaxConfiguration

No description.

[UserError!]!

No description.