These docs match the active app-store routes, app-engine scope planning, auth-core token contracts, and webhook-service HMAC dispatcher.
Live contract
Authorization code
A merchant authorizes a published app through `/v1/app-store/apps/:id/oauth/authorize`. The gateway verifies store ownership, requested scopes, and redirect URI before upserting an active installation.
Grant type is `authorization_code`.
Authorization codes are short lived and expire after 15 minutes.
The response includes `redirect_to`, `code`, `state`, granted scopes, app id, installation id, and store id.
Live contract
Access token exchange
`POST /v1/app-store/oauth/token` exchanges the authorization code for a scoped app access token after checking client id, redirect URI, active installation, and one-time code redemption.
Token response includes `access_token`, `token_type`, `expires_in`, `expires_at`, `scope`, and `scopes`.
Auth-core signs app access tokens as JWTs with normalized scopes.
The installation config stores token hashes, not raw returned tokens.
Live contract
Embedded token exchange
`POST /v1/app-store/oauth/token-exchange` exchanges an authenticated merchant session for an embedded app token tied to an installation and store.
Requires protected merchant auth middleware.
Validates active installation and store ownership.
Used by embedded app surfaces and the app bridge fetch contract.
Webhook verification
HMAC over timestamp and raw body
The dispatcher sends `X-LetBuyy-Timestamp`, `X-LetBuyy-Hmac-SHA256`, event id, event type, request id, and trace id.