ebay_exchange_authorization_code
Exchange an OAuth authorization code for access and refresh tokens to complete the OAuth 2.0 Authorization Code grant flow. The tokens are automatically stored for subsequent API calls.
Instructions
Exchange an OAuth authorization code for access and refresh tokens. This completes the OAuth 2.0 Authorization Code grant flow. After the user authorizes the application using the URL from ebay_get_oauth_url, eBay redirects back with an authorization code in the URL. Use this tool to exchange that code for tokens that can be used to make API calls. The tokens will be automatically stored and used for subsequent API requests.
IMPORTANT NOTES:
Authorization codes expire in ~5 minutes - if you get "invalid grant" error, get a fresh code
Codes can be URL-encoded (e.g., v%5E1.1%23...) - this tool automatically decodes them
Extract the code parameter from the redirect URL (your RuName Accept URL): https://your-redirect-uri?code=YOUR_CODE&expires_in=299
Tokens are saved to .env file and will auto-refresh every 2 hours
Refresh tokens last 18 months before requiring re-authorization
COMMON ERRORS:
"invalid or was issued to another client": Code expired, get fresh code
"Insufficient permissions": Re-run OAuth flow with additional scopes in ebay_get_oauth_url
For complete OAuth guide with scopes, troubleshooting, and examples, see: docs/auth/OAUTH_QUICK_REFERENCE.md
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The authorization code received from eBay after user authorization. This is the "code" parameter in the redirect URL. |