ebay_get_oauth_url
Generate an eBay OAuth authorization URL for user consent. Open the URL in a browser to grant permissions and start the OAuth 2.0 Authorization Code flow.
Instructions
Generate the eBay OAuth authorization URL for user consent. The user should open this URL in a browser to grant permissions to the application. This supports the OAuth 2.0 Authorization Code grant flow. The redirect URI can be provided as a parameter or will be read from EBAY_REDIRECT_URI environment variable.
IMPORTANT: eBay has different OAuth scopes available for production vs sandbox environments:
Sandbox includes additional Buy API scopes (e.g., buy.order.readonly, buy.guest.order, buy.shopping.cart) and extended Identity scopes
Production includes sell.edelivery, commerce.message (explicit), and commerce.shipping scopes not available in sandbox
If you provide custom scopes, they will be validated against the current environment (set via EBAY_ENVIRONMENT). Any scopes not valid for the environment will generate warnings.
OAUTH FLOW INSTRUCTIONS:
Generate OAuth URL with this tool (optionally specify scopes)
User opens URL in browser, authorizes, and gets redirected with a code parameter
Use ebay_exchange_authorization_code tool with the code (URL-encoded format accepted)
Tokens are automatically stored and will auto-refresh every 2 hours
COMMON SCOPES:
Basic (always included): https://api.ebay.com/oauth/api_scope
Inventory: https://api.ebay.com/oauth/api_scope/sell.inventory
Inventory (readonly): https://api.ebay.com/oauth/api_scope/sell.inventory.readonly
Account: https://api.ebay.com/oauth/api_scope/sell.account
Fulfillment: https://api.ebay.com/oauth/api_scope/sell.fulfillment
TROUBLESHOOTING:
Authorization codes expire in ~5 minutes - get fresh code if "invalid grant" error
"Insufficient permissions" errors mean you need to re-authorize with additional scopes
OAuth URL format: Use + to separate scopes (e.g., scope=scope1+scope2), not %2B
Refresh tokens last 18 months and are saved to .env file for persistence
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| redirectUri | No | Optional redirect URI registered with your eBay application (RuName). If not provided, will use EBAY_REDIRECT_URI from .env file. | |
| scopes | No | Optional array of OAuth scopes. If not provided, uses environment-specific default scopes (production or sandbox based on EBAY_ENVIRONMENT). Custom scopes will be validated against the environment. | |
| state | No | Optional state parameter for CSRF protection |