Exchange OAuth Code For Access Token
tiendanube_oauth_exchange_codeExchange a temporary OAuth authorization code for a permanent access token, including granted scopes and store user ID, to complete Tiendanube/Nuvemshop app authentication.
Instructions
Exchange the temporary OAuth 'code' (received on the app's redirect URL as ?code=...) for the permanent access_token. The response includes access_token, token_type, scope (granted scopes) and user_id — which is the store_id to use as TIENDANUBE_STORE_ID. Tokens do not expire unless the app is uninstalled or the token is rotated. The code is single-use and short-lived. Requires client credentials: pass client_id/client_secret or set TIENDANUBE_CLIENT_ID / TIENDANUBE_CLIENT_SECRET. Does not need a store access token. HTTP: POST https://www.tiendanube.com/apps/authorize/token (or nuvemshop.com.br).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Authorization code from the redirect URL | |
| region | No | 'tiendanube' (Hispanoamérica) or 'nuvemshop' (Brasil) | tiendanube |
| client_id | No | App client_id (default: env TIENDANUBE_CLIENT_ID) | |
| client_secret | No | App client_secret (default: env TIENDANUBE_CLIENT_SECRET) |