Create Embed Token
Create Embed Token: Agent Java SDK v0.3.0 integration, examples, parameters and response semantics.
This guide targets Agent Java SDK v0.3.0, Java 8+, and the tagged public contract. Examples run in a partner backend after initializing client in Quick Start.
Example prerequisites
The Java snippets share these imports. Initialize client using Quick Start and obtain platformUserId from the saved binding. Example user/order IDs must be replaced with your own persisted values.
Trading Widget Embed Token
Embed token is for Trading Widget SDK partner-token + tokenProvider mode. The
browser calls the partner backend, and the partner backend calls this Java SDK
to create an embedToken.
Integration requirements:
channelIdmust use the value passed by the Trading Widget SDK.symbolis optional and may carry the current initial symbol. It is not a token trading-pair permission restriction.embedTokenis short-lived and one-time. Do not put it into URL query strings.- The partner frontend must never hold
apiSecret. expireAtis a Unix timestamp in seconds, not a TTL.
Partner backend endpoint example:
Partner endpoint contract
Authenticate the partner session and derive agentUserId server-side. Accept the current Widget channelId; return top-level embedToken, expireAt (Unix seconds), and the same channelId. Agent responses do not supply channelId: your backend echoes it. Fetch a fresh token on initialization and renewal; never reuse it. Token creation does not transfer funds or choose the wallet environment.
See Seconds trading for the complete frontend/backend flow.