Skip to main content
Issue a Session Token for a buyer to create orders in your store. This is an API Key exclusive endpoint — JWT authentication is not supported.
POST /v1/actions/auth/issue-session-token
Authentication: API Key

Session Types

TypeTTLBehaviorDescription
customer5 minAuto-renew on each API callMerchant-issued, single-store scope, can create orders
buyer30 minAuto-renew on each API callUser-initiated login, cross-store scope
shopper1 minSingle-use, deleted after first API callMerchant-issued, one-time checkout only
The current version always issues customer role tokens. The table above lists all supported session types for reference.
Shopper Sessions are single-use tokens. The first API call (e.g., create-order) consumes the session. Subsequent requests with the same token will return authentication failure.

Request Body

FieldTypeRequiredDescription
storeIdstringYesTarget store ID (Short ID format STO_xxx)
buyerIdentitystringYesBuyer identity (e.g., email address)

Example Request

const { token, expiresAt } = await client.auth.issueSessionToken({
  storeId: "STO_2aUyqjCzEIiEcYMKj7TZtw",
  buyerIdentity: "customer@example.com",
});

Success Response (200)

{
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiresAt": "2024-01-15T11:00:00.000Z"
  }
}

Response Fields

FieldTypeDescription
tokenstringJWT Session Token
expiresAtstringExpiration time (ISO 8601)

Error Responses

StatusErrorDescription
400Missing required field: storeIdstoreId not provided
400Missing required field: buyerIdentitybuyerIdentity not provided
400Store is not activeStore is inactive or suspended
403Access denied: you do not have permission to this storeMerchant does not own this store
404Store not foundStore ID does not exist