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

Mutations

No description.

PartnerOtpRequestPayload!

Send a one-time code to a developer’s mobile number.

Returns a challenge whether or not an organization exists, so this cannot be used to enumerate who builds on Kaladan.

ArgumentTypeMeaning
phoneString!No description.
purposeOtpPurpose · default "SIGN_IN"No description.

PartnerOtpVerifyPayload!

Exchange a code for the account session: who the developer is.

Creates their organization when they belong to none, unverified, named provisionally from organizationName, with the developer as its owner. Whether they belong to one is asked at each verification rather than remembered, so a developer who has left every organization gets a new one.

There is no separate create mutation, for the same reason there is no signup mutation on the Merchant Account API: the first successful verification is the create. An unverified partner may build and install on their own development stores and may list nothing publicly — verification is what stands between the app store and anyone, and it is applied for separately.

Whenever there is exactly one organization to open — the one this just created, or the only one the developer belongs to — the payload also carries that organization’s session, so they land inside it. With several, the client renders partnerOrganizations and calls partnerSessionCreate.

A failure after the code is accepted never loses the sign-in. The code is spent by then, so the account session comes back alone, and the next sign-in tries again.

Errors: OTP_INCORRECT with params.attemptsRemaining, EXPIRED, OTP_CONSUMED.

ArgumentTypeMeaning
challengeIdID!No description.
codeString!No description.
organizationNameStringNo description.

PartnerTokenRefreshPayload!

Renew the account session. Rotating; a spent refresh token revokes the session.

ArgumentTypeMeaning
refreshTokenString!No description.

PartnerSessionRevokePayload!

End this account session, and every organization session it opened. Succeeds for a token that was already invalid.

Takes either session, and ends the account session it names: an organization session names the account session that opened it.

ArgumentTypeMeaning
refreshTokenString!No description.

PartnerSessionPayload!

Open an organization: exchange the account session for one acting for a single organization.

Two credentials, deliberately, exactly as shopSessionCreate bridges the Merchant Account and Admin APIs. The account session proves who you are; the organization session says which organization you are acting for. Revoking one does not revoke the other. A surface that accepted the account session directly would give every request the blast radius of an account takeover, and a developer’s blast radius is every shop their app is installed on.

Membership is asked once, here, and carried. A member removed afterwards keeps access until the session expires, and its short lifetime is what bounds that.

Takes the account session. Errors: NOT_FOUND for an organization the developer does not belong to — indistinguishable from one that does not exist.

ArgumentTypeMeaning
organizationIdID!No description.

PartnerSessionPayload!

Renew an organization session without returning to the picker.

Rotating, exactly as partnerTokenRefresh is: the presented token is spent, and presenting a spent one revokes the organization session as stolen. Refused with EXPIRED once the account session that opened it has gone — an organization session must not outlive the sign-in that authorized it.

ArgumentTypeMeaning
refreshTokenString!No description.

PartnerSessionRevokePayload!

End a session on another device.

A partner session can publish an app version that runs inside every shop which installed it, so a developer noticing a session they do not recognise is the cheapest detection this surface has.

Takes either credential: both name the developer, and a device is theirs whichever organization they were acting for on it.

ArgumentTypeMeaning
sessionIdID!No description.

PartnerPayload!

Change the organization’s name or how Kaladan reaches it.

ArgumentTypeMeaning
inputPartnerUpdateInput!No description.

AppCreatePayload!

Register an app.

CUSTOM by default — built for named shops, skipping review, and unlistable. It is the commonest kind, and making it the default means an agency building for one merchant never touches the store process.

Returns the app’s client secret and its webhook signing secret, each once. A public client is issued neither.

ArgumentTypeMeaning
inputAppCreateInput!No description.

AppSecretPayload!

Issue a new client secret, invalidating the old one immediately.

Returned once. Be ready to deploy before calling it.

ArgumentTypeMeaning
idID!No description.

AppSigningSecretPayload!

Issue a new webhook signing secret. Returned once.

The previous one keeps signing deliveries for a day. Until then every delivery carries both signatures, so an app that has not deployed the new secret keeps verifying.

There is no immediate rotation, because there is nothing it would protect. After a leak, deploy the new secret and stop trusting the old one: which secrets your code trusts decides whether a forged request is accepted.

ArgumentTypeMeaning
idID!No description.

AppVersionPayload!

Start a new version.

Copies the published version’s declaration as a starting point, so a developer changing one scope does not re-enter everything and lose an extension by omission.

ArgumentTypeMeaning
appIdID!No description.
inputAppVersionInput!No description.

AppVersionPayload!

Change a draft version.

Refused with VERSION_FROZEN once submitted. A merchant who approved a set of scopes must be able to trust that the version they approved is the one running, and a mutable version makes that untrue.

ArgumentTypeMeaning
idID!No description.
inputAppVersionInput!No description.

AppSubmitPayload!

Submit for review.

Returns every blocker at once rather than the first, so a developer fixes them in one pass instead of discovering the next a week later. CUSTOM apps skip review and go straight to publishable.

ArgumentTypeMeaning
idID!No description.

AppVersionPayload!

Make a version the one new installs get.

Existing installs are not moved. A merchant on an older version keeps running it until they re-approve, which is the whole reason reauthorizationRequired exists — an app must not silently gain scopes a merchant never saw.

ArgumentTypeMeaning
idID!No description.

AppPayload!

Withdraw an app from the store.

Existing installations keep working. A developer who stops selling must not break the shops already running it.

ArgumentTypeMeaning
idID!No description.

AppPayload!

Save or change how an app appears in the store.

ArgumentTypeMeaning
appIdID!No description.
inputAppListingInput!No description.

AppInstallLinkPayload!

A link that installs a custom app on one named shop.

The way a CUSTOM app reaches its shop. A custom app is never listed, so no merchant finds it in the store: its developer creates a link naming the shop it was built for and sends it to the merchant, who opens it in their admin and approves on Kaladan’s page, which says Kaladan did not review the app. The link installs on that shop alone and on no other, whoever opens it; it lasts thirty days, and a new one can be made at any time.

It grants nothing by itself. Nothing is installed until a person in that shop holding WRITE_APPS and every scope the app asks for approves.

Errors: NOT_FOUND for an app this organization does not own; INVALID_STATE for an app that is not CUSTOM, or has no published version.

ArgumentTypeMeaning
appIdID!No description.
shopHandleHandle!No description.

DevelopmentStorePayload!

Create a free shop to build against.

Every capability switched on regardless of plan, so a developer builds against what their merchants will have rather than discovering a plan gate after shipping. Payments are test-mode and not changeable.

ArgumentTypeMeaning
inputDevelopmentStoreInput!No description.

DevelopmentStorePayload!

No description.

ArgumentTypeMeaning
idID!No description.

AppChargePayload!

Ask a merchant to accept a charge.

Only for an organization Kaladan collects for: at launch Kaladan’s own and commissioned apps, which an operator records. Any other organization’s charge is refused NOT_APPROVED, with params.capability charges, and third-party paid apps wait for a payout program. A USAGE charge waits for a prepaid wallet: NOT_APPROVED, with usage_charges.

Returns the charge with a confirmationUrl on a Kaladan page. An app that shows its own approval screen is one a merchant cannot tell apart from a phishing page, so the platform owns that screen. Send the merchant there, in the same window; they come back to returnUrl.

Kaladan bills it as the seller, on an invoice of its own with VAT on top, and the merchant pays at acceptance: the charge is PENDING until that payment verifies, then ACTIVE. With trialDays it is ACTIVE at once and the first period falls due when the trial ends. Each later period is an invoice of its own, and one left unpaid makes this charge MERCHANT_PAST_DUE until it is paid.

idempotencyKey is required. A retry with the same key and the same input answers the first charge and the same confirmationUrl; with a different input it is IDEMPOTENCY_CONFLICT.

Errors: NOT_FOUND on input.installationId for an installation of another organization’s app, or none. INVALID_STATE on input.installationId for an installation not active, or one installed before Kaladan kept its shop’s handle (reinstalling fixes it). OUT_OF_RANGE on input.amount for an amount that is not a whole number of rial above zero, and on input.trialDays outside 0 to 365. INVALID on input.trialDays for a trial on a one-time charge, on input.interval given for a charge that is not recurring, REQUIRED on it for one that is, INVALID on input.cappedAmount for a charge that is not usage, and on input.returnUrl for an address not on the origin of the app’s applicationUrl.

ArgumentTypeMeaning
inputAppChargeInput!No description.
idempotencyKeyString!No description.

AppChargePayload!

Cancel a charge. The merchant is not billed again from the next period.

Does not refund the current one: they have had the period they paid for.

ArgumentTypeMeaning
idID!No description.

UsageRecordPayload!

Record metered usage.

No usage charge can be created yet (usage waits for a prepaid wallet), so this answers only for one created before. An amount is above zero: a correction is Kaladan’s to make, never a negative record.

idempotencyKey is required — metering is exactly the operation a client retries blindly, and a double-billed merchant uninstalls.

Errors: OUT_OF_RANGE when the record would exceed cappedAmount, which is the merchant’s protection against a runaway app and is enforced rather than advised.

ArgumentTypeMeaning
inputUsageRecordInput!No description.

WebhookDeliveryPayload!

Send one dead-lettered delivery again, now.

The original payload, not a reconstruction — which is why it is worth retaining bytes rather than regenerating from current state. An event replayed from state is not the event that happened, and an accounting app reconciling a ledger needs the one that happened.

Refused with INVALID_STATE for a delivery that already succeeded: replaying those is how a developer double-posts their own ledger. Idempotent per delivery, so a developer hammering the button sends one.

ArgumentTypeMeaning
idID!No description.

WebhookSubscriptionPayload!

Switch a disabled subscription back on, and drain what the queue still holds.

Replays every dead-lettered delivery still inside the retention window, oldest first — order matters, and a ledger rebuilt out of order is worse than one with a hole.

Refused with INVALID_STATE while the endpoint is still failing its health probe: re-enabling into a dead endpoint just refills the queue, and the developer learns nothing they did not already know.

params.replayedCount on success says how many went, and params.expiredCount how many had already fallen out of retention — which is the number that tells a developer whether they must reconcile by hand.

ArgumentTypeMeaning
idID!No description.