Extensions and billing
AppCharge
Section titled “AppCharge”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.
status
Section titled “status”AppChargeStatus!
No description.
String!
No description.
amount
Section titled “amount”Money!
No description.
interval
Section titled “interval”AppChargeInterval
The billing interval, for a recurring charge.
trialDays
Section titled “trialDays”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.
confirmationUrl
Section titled “confirmationUrl”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.
usageRecords
Section titled “usageRecords”UsageRecordConnection!
Usage recorded against a usage charge.
| Argument | Type | Meaning |
|---|---|---|
first | Int | No description. |
after | String | No description. |
cappedAmount
Section titled “cappedAmount”Money
The most a usage charge may reach in one interval.
currentPeriodEnd
Section titled “currentPeriodEnd”DateTime
When the period paid for, or the trial, ends, and the next period falls due. Null on a one-time charge.
acceptedAt
Section titled “acceptedAt”DateTime
When the merchant accepted it. Set while its first invoice waits to be paid.
approvedAt
Section titled “approvedAt”DateTime
When it became active: its invoice paid, or its trial begun.
cancelledAt
Section titled “cancelledAt”DateTime
No description.
createdAt
Section titled “createdAt”DateTime!
No description.
AppChargeInput
Section titled “AppChargeInput”A charge to create.
installationId
Section titled “installationId”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.
amount
Section titled “amount”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.
interval
Section titled “interval”AppChargeInterval
Required on a RECURRING charge, and refused on any other.
trialDays
Section titled “trialDays”Int
A RECURRING charge’s free days, zero to 365. Refused on any other.
cappedAmount
Section titled “cappedAmount”MoneyInput
Required for a USAGE charge. The merchant’s protection against a runaway app.
returnUrl
Section titled “returnUrl”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.
AppChargeInterval
Section titled “AppChargeInterval”How often a recurring charge falls due.
| Value | Meaning |
|---|---|
MONTHLY | No description. |
ANNUAL | Annual, 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. |
AppChargeKind
Section titled “AppChargeKind”What kind of charge this is.
| Value | Meaning |
|---|---|
ONE_TIME | Once. |
RECURRING | Every interval, for as long as the app is installed and the merchant pays. |
USAGE | Metered — 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. |
AppChargePayload
Section titled “AppChargePayload”What the charge mutations return.
charge
Section titled “charge”AppCharge
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
AppChargeStatus
Section titled “AppChargeStatus”Where a charge stands.
| Value | Meaning |
|---|---|
PENDING | Created and not yet answered, or accepted and waiting for its payment (acceptedAt is set). |
ACTIVE | Paid to currentPeriodEnd, or one-time and paid, or in its trial. |
DECLINED | The merchant declined. |
MERCHANT_PAST_DUE | This 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. |
CANCELLED | No description. |
EXPIRED | The app was uninstalled, or the request lapsed: unanswered for 48 hours, or accepted and never paid. |
AppExtension
Section titled “AppExtension”One place an app adds something.
ID!
No description.
handle
Section titled “handle”Handle!
Unique within the app version.
AppExtensionKind!
No description.
String!
No description.
target
Section titled “target”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.
configuration
Section titled “configuration”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.
requiredScopes
Section titled “requiredScopes”[AccessScope!]!
Scopes this extension needs, a subset of the version’s.
AppExtensionInput
Section titled “AppExtensionInput”An extension as supplied.
handle
Section titled “handle”Handle!
No description.
AppExtensionKind!
No description.
String!
No description.
target
Section titled “target”String!
No description.
configuration
Section titled “configuration”JSON!
No description.
requiredScopes
Section titled “requiredScopes”[AccessScope!]
No description.
AppExtensionKind
Section titled “AppExtensionKind”What kind of thing an app adds.
| Value | Meaning |
|---|---|
ADMIN_UI | A 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_BLOCK | A 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_PROXY | Content 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_UI | A step or a field inside hosted checkout. The most constrained surface on the platform, because it sits between a buyer and their money. |
SALES_CHANNEL | A sales channel the app provides — a marketplace sync, a feed. |
FUNCTION | Server-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. |
DeclaredWebhook
Section titled “DeclaredWebhook”An event an app subscribes to, declared on its version.
String!
A topic from the published catalogue — orders/paid, products/update.
endpoint
Section titled “endpoint”URL!
Where it is delivered. HTTPS only.
includeFields
Section titled “includeFields”[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.
synchronous
Section titled “synchronous”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.
DeclaredWebhookInput
Section titled “DeclaredWebhookInput”An event subscription as supplied.
String!
No description.
endpoint
Section titled “endpoint”URL!
No description.
includeFields
Section titled “includeFields”[String!]
No description.
synchronous
Section titled “synchronous”Boolean
No description.
ExtensionPoint
Section titled “ExtensionPoint”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.
target
Section titled “target”String!
admin.product.detail.card.
AppExtensionKind!
No description.
description
Section titled “description”String!
No description.
configurationSchema
Section titled “configurationSchema”JSON!
The JSON Schema an extension’s configuration must satisfy here.
contextSchema
Section titled “contextSchema”JSON!
What the platform passes the extension when it renders or runs.
impliedScopes
Section titled “impliedScopes”[AccessScope!]!
Scopes an extension at this point will always need.
available
Section titled “available”Boolean!
Whether this point is available yet.
PartnerEarnings
Section titled “PartnerEarnings”What a partner is owed, and what has been paid.
pending
Section titled “pending”Money!
Approved charges not yet paid out.
paidOut
Section titled “paidOut”Money!
Paid, historically.
platformSharePercent
Section titled “platformSharePercent”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.
nextPayoutAt
Section titled “nextPayoutAt”DateTime
No description.
UsageRecord
Section titled “UsageRecord”One metered event billed against a usage charge.
ID!
No description.
description
Section titled “description”String!
No description.
amount
Section titled “amount”Money!
No description.
recordedAt
Section titled “recordedAt”DateTime!
No description.
UsageRecordConnection
Section titled “UsageRecordConnection”A page of usage records.
[UsageRecordEdge!]!
No description.
[UsageRecord!]!
No description.
pageInfo
Section titled “pageInfo”PageInfo!
No description.
totalCount
Section titled “totalCount”Int!
No description.
UsageRecordEdge
Section titled “UsageRecordEdge”One usage record, with its cursor.
cursor
Section titled “cursor”String!
No description.
UsageRecord!
No description.
UsageRecordInput
Section titled “UsageRecordInput”Usage to record.
chargeId
Section titled “chargeId”ID!
No description.
description
Section titled “description”String!
No description.
amount
Section titled “amount”MoneyInput!
No description.
idempotencyKey
Section titled “idempotencyKey”String!
So a retried call does not bill twice. Required, because metering is exactly the operation a client retries blindly.
UsageRecordPayload
Section titled “UsageRecordPayload”What appUsageRecord returns.
usageRecord
Section titled “usageRecord”UsageRecord
No description.
charge
Section titled “charge”AppCharge
The charge, so a client sees how close it now is to the cap.
userErrors
Section titled “userErrors”[UserError!]!
No description.
WebhookDelivery
Section titled “WebhookDelivery”One attempt to deliver one event to one endpoint.
ID!
No description.
subscription
Section titled “subscription”WebhookSubscription!
No description.
String!
No description.
eventId
Section titled “eventId”ID!
The envelope’s event id. Stable across every attempt at the same event.
status
Section titled “status”WebhookDeliveryStatus!
No description.
attemptCount
Section titled “attemptCount”Int!
No description.
payload
Section titled “payload”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.
responseStatus
Section titled “responseStatus”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.
responseBody
Section titled “responseBody”String
No description.
transportError
Section titled “transportError”String
Set when nothing came back at all — a timeout, a TLS failure, a bad host.
firstAttemptedAt
Section titled “firstAttemptedAt”DateTime!
No description.
lastAttemptedAt
Section titled “lastAttemptedAt”DateTime!
No description.
expiresAt
Section titled “expiresAt”DateTime
When this falls out of the seven-day queue and can no longer be replayed.
WebhookDeliveryConnection
Section titled “WebhookDeliveryConnection”A page of deliveries.
[WebhookDeliveryEdge!]!
No description.
[WebhookDelivery!]!
No description.
pageInfo
Section titled “pageInfo”PageInfo!
No description.
totalCount
Section titled “totalCount”Int!
No description.
WebhookDeliveryEdge
Section titled “WebhookDeliveryEdge”One delivery, with its cursor.
cursor
Section titled “cursor”String!
No description.
WebhookDelivery!
No description.
WebhookDeliveryPayload
Section titled “WebhookDeliveryPayload”What webhookDeliveryReplay returns.
delivery
Section titled “delivery”WebhookDelivery
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
WebhookDeliveryStatus
Section titled “WebhookDeliveryStatus”Where one delivery ended up.
| Value | Meaning |
|---|---|
PENDING | Waiting for its next attempt. |
DELIVERED | The endpoint answered 2xx. |
RETRYING | Failed, and will be retried. |
DEAD_LETTERED | Out of attempts. Sitting in the queue, replayable until it expires. |
EXPIRED | Fell out of retention unreplayed. The shop’s state must be re-read. |
WITHDRAWN | Withdrawn 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. |
WebhookSubscription
Section titled “WebhookSubscription”A live subscription: one app’s declared topic, on one shop.
ID!
No description.
App!
No description.
shopHandle
Section titled “shopHandle”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.
endpoint
Section titled “endpoint”URL!
No description.
synchronous
Section titled “synchronous”Boolean!
No description.
status
Section titled “status”WebhookSubscriptionStatus!
No description.
disabledAt
Section titled “disabledAt”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.
consecutiveFailures
Section titled “consecutiveFailures”Int!
Consecutive failures. Reset by any success, and with it the escalation toward disabling the subscription.
deadLetteredCount
Section titled “deadLetteredCount”Int!
How many deliveries are still in the dead-letter queue, and replayable.
lastDeliveryAt
Section titled “lastDeliveryAt”DateTime
No description.
lastSuccessAt
Section titled “lastSuccessAt”DateTime
No description.
WebhookSubscriptionPayload
Section titled “WebhookSubscriptionPayload”What the subscription mutations return.
subscription
Section titled “subscription”WebhookSubscription
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
WebhookSubscriptionStatus
Section titled “WebhookSubscriptionStatus”Whether a subscription is receiving events.
| Value | Meaning |
|---|---|
ACTIVE | No description. |
FAILING | Failing, still being retried. Not yet switched off. |
DISABLED | Switched off by the platform after sustained failure. |
UNINSTALLED | Switched off because the merchant uninstalled the app. |