Exchange Alza OAuth code
auth_exchangeExchange the OAuth authorization code from the redirect for mobile API tokens, completing sign-in and authenticating account tools like cart, profile, and orders.
Instructions
Complete the OAuth 2.0 PKCE sign-in: exchange the authorization code for mobile API tokens and load them into this server. Use immediately after the user finishes the auth_start flow in the browser. Pass exactly the code and state from the alza://identity redirect — never a password and never a refresh token here. Fails if the state does not match a pending auth_start session (start over from auth_start in that case). Side effect: replaces the token set currently loaded in this process; afterwards account tools such as cart, profile, and order are authenticated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Authorization code from the `alza://identity` redirect (the `code` query parameter). | |
| state | Yes | State value returned by `auth_start`; must match the pending PKCE session exactly. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| err | No | ||
| msg | No | ||
| data | No |