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

Install and authorize

There is no partner dashboard yet: everything on this page is a Partner API call, which any GraphQL client can make.

POST partners.kaladan.shop/api/2026-10/graphql
mutation { partnerOtpRequest(phone: "09121234567") { challenge { challengeId resendAfter } userErrors { code } } }

The code arrives by SMS. Exchange it for your account session:

mutation {
partnerOtpVerify(challengeId: "…", code: "12345", organizationName: "Studio Mehr") {
tokens { accessToken refreshToken }
organization { id }
userErrors { code field }
}
}

Your first verification creates your organization, with you as its owner. Then open an organization session, which nearly every other call needs:

mutation { partnerSessionCreate(organizationId: "…") { tokens { accessToken refreshToken } } }

Send it as Authorization: Bearer …. Refresh tokens rotate and are single-use: presenting a spent one ends the session, on the assumption it was stolen. Never refresh twice at once.

mutation {
appCreate(input: {
name: "Anbar Sync"
handle: "anbar-sync"
distribution: CUSTOM
applicationUrl: "https://anbar.example.ir/kaladan"
}) {
app { id oauth { clientId } }
clientSecret
signingSecret
userErrors { code field }
}
}
  • The client id (client_…) is permanent.
  • The client secret authenticates your server at the token endpoint. appSecretRotate replaces it immediately.
  • The signing secret (whsec_…) signs your webhooks. appSigningSecretRotate keeps the old one signing alongside the new for a day.

Both secrets are returned once. Store them before you do anything else.

mutation {
appVersionCreate(appId: "…", input: {
versionName: "1.0.0"
requestedScopes: [READ_PRODUCTS, WRITE_INVENTORY, READ_ORDERS]
requiresOfflineAccess: true
redirectUris: ["https://anbar.example.ir/kaladan/callback"]
webhookSubscriptions: [
{ topic: "orders/paid", endpoint: "https://anbar.example.ir/hooks" }
{ topic: "app/uninstalled", endpoint: "https://anbar.example.ir/hooks" }
]
}) { appVersion { id status } userErrors { code field } }
}

Then appVersionSubmit, which reports every blocker at once, and appVersionPublish. A submitted version is frozen. Publishing makes it the version new installs get; existing installs keep theirs until the merchant re-approves.

For a custom app, make a link for the one shop it is for:

mutation { appInstallLinkCreate(appId: "…", shopHandle: "golnar") { installLink expiresAt } }

The merchant opens the link (it lasts 30 days) and is sent to your applicationUrl with ?shop=…. Your app then starts the authorization.

Send the merchant’s browser to Kaladan’s approval page:

https://admin.kaladan.shop/oauth/authorize
?client_id=client_…
&redirect_uri=https://anbar.example.ir/kaladan/callback
&state=… # yours; check it on the way back
&code_challenge=… # BASE64URL(SHA256(code_verifier))
&code_challenge_method=S256
&shop=golnar.kaladan.store # the platform host, not a custom domain

The approval page lists every scope in the merchant’s own words, whether the app works offline, and its data disclosure. Only someone allowed to manage apps, and holding every scope the app asks for, can approve. A wrong client id or an unregistered redirect URI shows an error and never redirects.

Kaladan then redirects to your redirect_uri with code, state and shop, or with error=access_denied if the merchant declined.

Terminal window
curl https://golnar.kaladan.store/admin/oauth/token \
-d grant_type=authorization_code \
-d code=… \
-d code_verifier=… \
-d redirect_uri=https://anbar.example.ir/kaladan/callback \
-d client_id=client_… \
-d client_secret=…
{
"access_token": "…",
"token_type": "bearer",
"expires_in": 900,
"refresh_token": "…",
"scope": "READ_PRODUCTS WRITE_INVENTORY READ_ORDERS"
}

The token endpoint is standard RFC 6749: form-encoded, client_secret_post or HTTP Basic, and the PKCE verifier is always required.

OfflineOnline
WhenThe version sets requiresOfflineAccessOtherwise
Acts asThe appOne staff member, and never more than they may do
Access token15 minutes15 minutes
RefreshA single-use refresh token, valid 30 days from its last useNone: authorize again

Each refresh issues a token with the scopes as currently approved. Uninstalling the app revokes every token at once.

POST {shop}.kaladan.store/admin/api/2026-10/graphql
Terminal window
curl https://golnar.kaladan.store/admin/api/2026-10/graphql \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"query":"{ products(first: 5) { nodes { title } } }"}'

The shop is read from the host and must match the token, or the answer is 401. A query that touches any field outside the grant is refused whole with SCOPE_ESCALATION, listing what was missing. See the Admin API.