implement ebay oauth user-token flow with refresh tokens

domain: ebay.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Redirect the user to eBay's authorization endpoint with query parameters: `client_id`, `redirect_uri` (your RuName registered in the developer portal), `response_type=code`, and `scope` (space-separated list of required scopes).
  2. After user consent, eBay redirects to your `redirect_uri` with a `code` parameter; exchange it for tokens by POSTing to eBay's token endpoint with `grant_type=authorization_code`, `code`, and `redirect_uri`, using HTTP Basic Auth with your client ID and secret.
  3. Store the returned `access_token` (short-lived, typically 2 hours) and `refresh_token` (long-lived, typically 18 months) securely, associated with the user.
  4. When the access token expires (check the `expires_in` field or catch a 401), obtain a new one by POSTing to the token endpoint with `grant_type=refresh_token` and `refresh_token`.
  5. If the refresh token itself expires or is revoked, re-initiate the full authorization flow — detect this when the refresh token exchange returns an error.
  6. For application-level calls that don't require user context, use the client credentials grant (`grant_type=client_credentials`) to obtain an application token.

Known gotchas

Related routes

Implement the Shopify Customer Account API token refresh flow and handle token expiry gracefully in a headless app
shopify.dev · 6 steps · unrated
Authenticate with the project44 API using OAuth 2.0 client credentials and manage token refresh for continuous shipment visibility calls
project44.com · 5 steps · unrated
Authenticate to Xero with OAuth 2.0, handle multi-tenant token storage, and refresh access tokens
developer.xero.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans