Authenticate your backend to the Direct API and mint per-user preauth tokens that the widget or your client app exchanges for a user access token.
Authentication. POST /direct/login accepts API key + secret. All other endpoints require a Direct API host token (Bearer JWT obtained from /direct/login).
Token lifetimes.
- Direct API token — short-lived; refresh via
GET /direct/refresh-tokenbefore it expires. - Refresh token — returned alongside the Direct token; use to obtain a fresh access token without re-presenting credentials.
- Preauth token — single-use, 30-second lifetime. Generate immediately before sending to the widget/client.
Authenticates a customer host using API key and secret credentials, returning a JWT access token and a refresh token. The access token must be included as a Bearer token in the Authorization header for all /direct/* endpoints.
Requirements: The host must be active.
Expiration: The access token is valid for 1 hour and the refresh token is valid for 2 hours.
- Production Server URLhttps://efx-wgt.stitchcredit.com/api/direct/login
- Development Server URLhttps://efx-dev.stitchcredit.com/api/direct/login
Login Request
curl -i -X POST \
https://efx-wgt.stitchcredit.com/api/direct/login \
-H 'Content-Type: application/json' \
-d '{
"apikey": "your-api-key",
"secret": "your-api-secret"
}'Response
Login Response
{ "token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1NTBlODQwMCJ9.abc", "expires": 3600, "refresh": "eyJhbGciOiJIUzI1NiJ9.ref.xyz" }