Skip to main content
POST
Mint a short-lived ws_token for browser/mobile websocket auth

Overview

Use this endpoint to mint a short-lived token for WebSocket authentication. Tokens are scoped (merchant or commerce) and can be issued with a TTL.

Authentication

  • Server auth: x-api-key (merchant) or x-commerce-api-key (commerce)

Request

SDK

cURL

Response

Errors

  • 400 invalid scope/ttl (or scope mismatch for the provided API key type)
  • 401 invalid API key

Examples

Connect to merchant events with the minted token:
Next: Search commerce products

Authorizations

x-api-key
string
header
required

API key for server-to-server operations (scope=merchant or commerce)

Body

application/json
scope
enum<string>
Available options:
merchant,
commerce
ttl_seconds
integer
Example:

60

Response

Token minted

Standard ws_token mint response envelope.

success
boolean
Example:

true

data
object

Minted ws_token payload. Use data.token as token=<ws_token> when connecting to /ws/* streams.