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

Mutations

No description.

OtpRequestPayload!

Send a one-time code to a mobile number.

Returns a challenge whether or not an account exists — there is no way to use this to test which numbers shop here. purpose lets the platform pick the right message template and the right rate-limit budget.

Errors: INVALID for a number that is not a valid Iranian mobile; RATE_LIMITED with params.retryAfterSeconds when this number or this caller has asked too recently, including before a previous challenge’s resendAfter.

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

OtpVerifyPayload!

Exchange a code for a session.

Creates the account if this is the first successful verification for the number; isNewCustomer says whether it did.

Errors: OTP_INCORRECT with params.attemptsRemaining; EXPIRED when the code aged out; OTP_CONSUMED when the challenge is burned or already used; NOT_FOUND for an unknown challenge id.

ArgumentTypeMeaning
challengeIdID!No description.
codeString!No description.

TokenRefreshPayload!

Exchange a refresh token for a new pair.

Refresh tokens rotate: the one presented is spent, and presenting a spent one revokes the whole session on the assumption it was stolen. Call this before the access token expires, not after it fails.

Errors: EXPIRED, or NOT_FOUND for a token that is unrecognized, already rotated, or revoked. Treat all of them the same — clear local state and sign in.

From a browser, with X-Kaladan-Session: cookie, leave refreshToken out: the session cookie is presented instead, and the new one is set in its place. A refusal clears the cookie. refreshToken given with the header is INVALID, and neither given is NOT_FOUND.

ArgumentTypeMeaning
refreshTokenStringNo description.

SessionRevokePayload!

End this session.

Succeeds for a token that was already invalid. Signing out twice is not an error, and reporting it as one only tells a caller which tokens were real.

The session ended is the one the Authorization header names, so refreshToken may be left out. With X-Kaladan-Session: cookie the session cookie is cleared, whatever else happened.

ArgumentTypeMeaning
refreshTokenStringNo description.

CustomerPayload!

Change the buyer’s own details.

Merges: a member left out is left alone. Setting email marks it unverified and sends a confirmation.

The mobile number is not here. It is the account’s identity, and changing it with the session it authenticates would let anyone who borrowed a signed-in phone once keep it forever.

ArgumentTypeMeaning
inputCustomerUpdateInput!No description.

SessionRevokePayload!

End a session on another device.

The one recovery a buyer has after a SIM swap or a borrowed phone, which is why the session list is surfaced at all.

Errors: NOT_FOUND for a session that is not this buyer’s.

Naming this device’s own session (isCurrent) with X-Kaladan-Session: cookie clears the session cookie too, as signing out does; customerSessionRevokeOthers leaves it.

ArgumentTypeMeaning
sessionIdID!No description.

SessionRevokePayload!

Revoke every session except the one making the request.

AddressPayload!

Add an address to the book.

Errors: NOT_FOUND for an unknown province or city code; INCONSISTENT when the city does not sit in the province; PATTERN for a malformed postal code or mobile number; LIST_SIZE when the book is full.

ArgumentTypeMeaning
addressAddressInput!No description.
setDefaultBoolean · default falseNo description.

AddressPayload!

Replace an address entirely. Every field is set from the input.

ArgumentTypeMeaning
idID!No description.
addressAddressInput!No description.

AddressPayload!

Remove an address.

Orders already placed to it keep their own copy — an order’s shipping address is a snapshot, not a reference, so deleting from the book never rewrites history.

ArgumentTypeMeaning
idID!No description.

AddressPayload!

Mark an address as the one checkout preselects.

Marking a new one unmarks the old; there is always at most one.

ArgumentTypeMeaning
idID!No description.

InvoiceProfilePayload!

Save a legal identity for official invoices — فاکتور رسمی.

Which fields are required depends on buyerType, and the rules are the tax system’s: a missing one comes back as REQUIRED against its own path.

Errors: INVALID for a کد ملی or شناسه ملی that fails its checksum; NOT_FOUND for an addressId that is not this buyer’s.

ArgumentTypeMeaning
inputInvoiceProfileInput!No description.
setDefaultBoolean · default falseNo description.

InvoiceProfilePayload!

Replace an invoice identity.

Changing nationalId clears nationalIdVerified and re-queues the Shahkar match — an identifier verified against one number says nothing about another.

ArgumentTypeMeaning
idID!No description.
inputInvoiceProfileInput!No description.

InvoiceProfilePayload!

Remove an invoice identity. Invoices already issued are unaffected.

ArgumentTypeMeaning
idID!No description.

InvoiceProfilePayload!

Mark an invoice identity as the one checkout preselects.

ArgumentTypeMeaning
idID!No description.

WishlistPayload!

Save a product — and optionally a specific variant, when the buyer chose one.

Saving something already saved succeeds and changes nothing, so a heart button that fires twice is harmless.

Errors: NOT_FOUND for a product that does not exist or is not published; LIST_SIZE when the list is full.

ArgumentTypeMeaning
productIdID!No description.
variantIdIDNo description.

WishlistPayload!

Remove a product. Removing something not saved succeeds.

ArgumentTypeMeaning
productIdID!No description.

MarketingConsentPayload!

Change what the buyer agrees to be contacted on.

Channels named in neither list are left alone, so a form covering one channel cannot silently reset another.

ArgumentTypeMeaning
inputMarketingConsentInput!No description.

DataRequestPayload!

Ask for everything the shop holds about this buyer.

Assembled asynchronously, usually within the hour. Nothing is sent to the buyer when it is ready: customer.dataRequests shows it READY, with downloadExpiresAt, and the account page is where they find it. One open export at a time.

Errors: INVALID_STATE when one is already open; RATE_LIMITED when they are asked for too often, with params.retryAfterSeconds.

DataExportDownloadPayload!

Hand over a ready export’s file: a link to it, once.

The file is the buyer’s whole history with the shop, so the link is made at the moment they press download, lives minutes, and is never shown again. Follow it at once rather than keeping it. Downloading completes the export: it reads COMPLETED afterwards, and the buyer may ask for a new one once customerDataExportRequest allows.

Errors: NOT_FOUND for a request that is not this buyer’s export; INVALID_STATE for one not ready yet, or cancelled; EXPIRED once it has been downloaded or downloadExpiresAt has passed — one answer for both, because to whoever is holding the button they are the same fact.

ArgumentTypeMeaning
idID!No description.

DataRequestPayload!

Ask to be erased.

Takes effect after a grace period given by effectiveAt, during which it can be withdrawn. Erasure redacts personal data; it does not delete orders, which are tax records the merchant is required to keep. The order survives with its buyer redacted.

Errors: INVALID_STATE when a deletion is already pending, or when the buyer has an open order that must settle first.

DataRequestPayload!

Withdraw a pending deletion.

Errors: EXPIRED once the grace period has passed and the erasure has run — at which point there is no account left to restore it to.

ArgumentTypeMeaning
idID!No description.