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

Extensions and billing

Object

What an app charges, on one shop.

The app never takes the money. It creates a charge, the merchant accepts it on a Kaladan page, and Kaladan invoices the merchant for it as the seller, with VAT on top, and takes the payment. The charge is active once that invoice is paid.

ID!

No description.

App!

No description.

InstalledShop!

No description.

AppChargeKind!

No description.

AppChargeStatus!

No description.

String!

No description.

Money!

No description.

AppChargeInterval

The billing interval, for a recurring charge.

Int!

Free days before the first period falls due, on a recurring charge.

Honoured by the platform — nothing is invoiced until they have passed — so an app does not implement its own trial and get it wrong.

URL

What the merchant is sent to, to accept it.

A charge does not exist until a merchant accepts it on a Kaladan page, not the app’s. An app that shows its own approval screen is one a merchant cannot distinguish from a phishing page.

Answered by appChargeCreate, and by a retry of it with the same key, and null on every read: the page carries a token Kaladan keeps only as a hash. It stops answering once the merchant answers, or 48 hours after creation.

UsageRecordConnection!

Usage recorded against a usage charge.

ArgumentTypeMeaning
firstIntNo description.
afterStringNo description.

Money

The most a usage charge may reach in one interval.

DateTime

When the period paid for, or the trial, ends, and the next period falls due. Null on a one-time charge.

DateTime

When the merchant accepted it. Set while its first invoice waits to be paid.

DateTime

When it became active: its invoice paid, or its trial begun.

DateTime

No description.

DateTime!

No description.

Input

A charge to create.

ID!

The installation it bills — which names the shop and the app, so a charge can only ever be for an app the organization owns, on a shop running it.

AppChargeKind!

No description.

String!

What the merchant sees, on the charge page and on Kaladan’s invoice.

MoneyInput!

The price before VAT: per period on a recurring charge, or the whole. A whole number of rial above zero. Kaladan adds VAT on top.

AppChargeInterval

Required on a RECURRING charge, and refused on any other.

Int

A RECURRING charge’s free days, zero to 365. Refused on any other.

MoneyInput

Required for a USAGE charge. The merchant’s protection against a runaway app.

URL!

Where to send the merchant after they answer. On the origin of the app’s applicationUrl, so Kaladan’s page sends nobody anywhere the app does not answer.

Enum

How often a recurring charge falls due.

ValueMeaning
MONTHLYNo description.
ANNUALAnnual, and the one that actually works here. Iranian SaaS is bought prepaid for a year at a time because recurring card-on-file barely exists. A monthly app charge means twelve chances for a merchant to lapse.
Enum

What kind of charge this is.

ValueMeaning
ONE_TIMEOnce.
RECURRINGEvery interval, for as long as the app is installed and the merchant pays.
USAGEMetered — messages sent, rows processed. Capped, and the cap is the merchant’s protection. Not offered until a prepaid wallet exists: creating one is refused NOT_APPROVED.
Object

What the charge mutations return.

AppCharge

No description.

[UserError!]!

No description.

Enum

Where a charge stands.

ValueMeaning
PENDINGCreated and not yet answered, or accepted and waiting for its payment (acceptedAt is set).
ACTIVEPaid to currentPeriodEnd, or one-time and paid, or in its trial.
DECLINEDThe merchant declined.
MERCHANT_PAST_DUEThis charge’s renewal was left unpaid when its period ended. This charge only: the merchant’s other charges and their plan are untouched, and paying the renewal makes it ACTIVE again. The app should degrade rather than cut off: the merchant has not refused, they are late, and cutting them off is how an app gets uninstalled.
CANCELLEDNo description.
EXPIREDThe app was uninstalled, or the request lapsed: unanswered for 48 hours, or accepted and never paid.
Object

One place an app adds something.

ID!

No description.

Handle!

Unique within the app version.

AppExtensionKind!

No description.

String!

No description.

String!

Which named mount point it attaches to.

admin.product.detail.card, checkout.delivery.after, theme.section.block. The catalogue of points is published so a developer — and a coding agent — targets one that exists rather than guessing.

JSON!

Configuration, whose shape belongs to the extension point rather than to this API.

Validated at submission against that point’s own schema, so an invalid one is a SubmissionBlocker rather than a runtime surprise in a merchant’s admin.

[AccessScope!]!

Scopes this extension needs, a subset of the version’s.

Input

An extension as supplied.

Handle!

No description.

AppExtensionKind!

No description.

String!

No description.

String!

No description.

JSON!

No description.

[AccessScope!]

No description.

Enum

What kind of thing an app adds.

ValueMeaning
ADMIN_UIA card or a page inside the Kaladan admin. Rendered in an isolated frame and talking to the platform over a message channel, never sharing a document with the admin. It uses Diba, so an app does not look foreign inside the admin — which is what Diba is for.
THEME_APP_BLOCKA block a merchant can drop into a theme section. The platform calls the app, caches, times out and sanitizes, then hands the markup to the theme — see the theme contract. The theme’s author need never have heard of the app.
APP_PROXYContent served under the shop’s own domain at /apps/{handle}/*. Handled at the edge and proxied to the app with a signed request. Same-origin for the buyer’s browser, and the app never sees the theme.
CHECKOUT_UIA step or a field inside hosted checkout. The most constrained surface on the platform, because it sits between a buyer and their money.
SALES_CHANNELA sales channel the app provides — a marketplace sync, a feed.
FUNCTIONServer-side logic the platform runs: a discount rule, a delivery customization, a cart validation. Not yet implemented. Declared here because Discount.source on the Admin API already carries FUNCTION, and because the shape of a function — sandboxed, deterministic, with no network — is better fixed before apps depend on it than after.
Object

An event an app subscribes to, declared on its version.

String!

A topic from the published catalogue — orders/paid, products/update.

URL!

Where it is delivered. HTTPS only.

[String!]!

Which fields of the payload the app wants.

Narrowing keeps a payload small and, more importantly, keeps an app from receiving fields it never justified a scope for. A subscription that asks for more than the app’s scopes allow is refused at submission.

Boolean!

Whether the platform waits for the app’s answer and uses it.

Synchronous webhooks can change what the platform does — adjust a price, refuse a cart — and carry very different guarantees. See the webhooks contract.

Input

An event subscription as supplied.

String!

No description.

URL!

No description.

[String!]

No description.

Boolean

No description.

Object

One mount point an extension can attach to.

Published so a developer targets a point that exists, and so a coding agent generating an extension has a schema to validate against rather than an example to copy.

String!

admin.product.detail.card.

AppExtensionKind!

No description.

String!

No description.

JSON!

The JSON Schema an extension’s configuration must satisfy here.

JSON!

What the platform passes the extension when it renders or runs.

[AccessScope!]!

Scopes an extension at this point will always need.

Boolean!

Whether this point is available yet.

Object

What a partner is owed, and what has been paid.

Money!

Approved charges not yet paid out.

Money!

Paid, historically.

Float!

Kaladan’s share, as a fraction despite the name: 0.2 for twenty per cent. Deducted before payout.

Stated rather than left to be inferred from the difference, because a partner reconciling their own books should not have to derive it.

DateTime

No description.

Object

One metered event billed against a usage charge.

ID!

No description.

String!

No description.

Money!

No description.

DateTime!

No description.

Object

A page of usage records.

[UsageRecordEdge!]!

No description.

[UsageRecord!]!

No description.

PageInfo!

No description.

Int!

No description.

Object

One usage record, with its cursor.

String!

No description.

UsageRecord!

No description.

Input

Usage to record.

ID!

No description.

String!

No description.

MoneyInput!

No description.

String!

So a retried call does not bill twice. Required, because metering is exactly the operation a client retries blindly.

Object

What appUsageRecord returns.

UsageRecord

No description.

AppCharge

The charge, so a client sees how close it now is to the cap.

[UserError!]!

No description.

Object

One attempt to deliver one event to one endpoint.

ID!

No description.

WebhookSubscription!

No description.

String!

No description.

ID!

The envelope’s event id. Stable across every attempt at the same event.

WebhookDeliveryStatus!

No description.

Int!

No description.

JSON

The envelope as it was sent, verbatim.

Retained rather than regenerated, because an event replayed from current state is not the event that happened — and an accounting app rebuilding a ledger needs the one that happened.

Int

What the endpoint returned: status, headers we kept, and the body we read.

Verbatim, and truncated only by length. A developer debugging their own 500 needs what we saw rather than our interpretation of it.

String

No description.

String

Set when nothing came back at all — a timeout, a TLS failure, a bad host.

DateTime!

No description.

DateTime!

No description.

DateTime

When this falls out of the seven-day queue and can no longer be replayed.

Object

A page of deliveries.

[WebhookDeliveryEdge!]!

No description.

[WebhookDelivery!]!

No description.

PageInfo!

No description.

Int!

No description.

Object

One delivery, with its cursor.

String!

No description.

WebhookDelivery!

No description.

Object

What webhookDeliveryReplay returns.

WebhookDelivery

No description.

[UserError!]!

No description.

Enum

Where one delivery ended up.

ValueMeaning
PENDINGWaiting for its next attempt.
DELIVEREDThe endpoint answered 2xx.
RETRYINGFailed, and will be retried.
DEAD_LETTEREDOut of attempts. Sitting in the queue, replayable until it expires.
EXPIREDFell out of retention unreplayed. The shop’s state must be re-read.
WITHDRAWNWithdrawn before it was sent, and never will be: a shop/redact held after an uninstall, when the shop installed the app again inside the 48 hours. Nothing is owed for it.
Object

A live subscription: one app’s declared topic, on one shop.

ID!

No description.

App!

No description.

Handle!

Which shop’s events these are.

A handle rather than the shop, deliberately: a partner is entitled to know which install is broken, not to a directory of Kaladan’s merchants.

String!

No description.

URL!

No description.

Boolean!

No description.

WebhookSubscriptionStatus!

No description.

DateTime

When the platform switched it off. Null while it is healthy.

Set after sustained failure, at which point the partner is notified — and until webhookSubscriptionReenable existed, that notification was the end of the story.

Int!

Consecutive failures. Reset by any success, and with it the escalation toward disabling the subscription.

Int!

How many deliveries are still in the dead-letter queue, and replayable.

DateTime

No description.

DateTime

No description.

Object

What the subscription mutations return.

WebhookSubscription

No description.

[UserError!]!

No description.

Enum

Whether a subscription is receiving events.

ValueMeaning
ACTIVENo description.
FAILINGFailing, still being retried. Not yet switched off.
DISABLEDSwitched off by the platform after sustained failure.
UNINSTALLEDSwitched off because the merchant uninstalled the app.