This document explains how to prepare an eBay Developers Program account, configure Your eBay Sign-in Settings (RuName / redirect URLs), set GoupixDex API environment variables, and connect a seller from Settings → Marketplaces.
- Create an account on developer.ebay.com and an Application Keyset (sandbox for tests, production when ready).
- Note the App ID (Client ID) and Cert ID (Client Secret) — these are not API access tokens; they are only used for OAuth on the server.
In the developer portal, configure OAuth:
| Field | Role |
|---|---|
| Display Title | Name shown on the consent page (e.g. GoupixDex). |
| Your privacy policy URL | URL of a privacy policy (developer program requirement). |
| Your auth accepted URL | OAuth callback URL: eBay redirects here with ?code=...&state=... after approval. It must match EBAY_REDIRECT_URI / the URL opened in the app. Example: https://your-domain.fr/settings/marketplaces or locally http://localhost:3000/settings/marketplaces (sandbox often allows HTTP in dev). |
| Your auth declined URL | Page if the user declines (e.g. return to dashboard). |
Important: no mismatch in trailing slash, http vs https, or host (localhost vs 127.0.0.1) between the eBay portal, EBAY_REDIRECT_URI, and the URL actually opened in the browser.
The API requests these scopes (already set in the backend):
https://api.ebay.com/oauth/api_scope/sell.inventory— listings (Inventory API).https://api.ebay.com/oauth/api_scope/sell.account— fulfillment, payment, and return policies.
Add to api/.env (see api/.env.example):
| Variable | Description |
|---|---|
EBAY_CLIENT_ID |
App ID (Client ID) — sandbox or prod depending on EBAY_USE_SANDBOX. |
EBAY_CLIENT_SECRET |
Cert ID (Client Secret). |
EBAY_REDIRECT_URI |
Exactly the same URL as Your auth accepted URL (e.g. https://.../settings/marketplaces). |
EBAY_USE_SANDBOX |
true for auth.sandbox.ebay.com / api.sandbox.ebay.com, false for production. |
Restart the API after changes.
Fulfillment shipping options (multiple domestic rates, international, handling time) are created or updated via the Account API when you run onboarding or POST /ebay/policies/fulfillment/ensure — no manual policy setup on ebay.fr is required in the default flow.
- Settings → Marketplace: enable eBay, save if needed.
- Click Connect to eBay: redirect to eBay consent.
- After approval, eBay redirects to
/settings/marketplaces?code=...&state=...: the frontend sendscodeto the backend (POST /ebay/oauth/exchange), which stores encrypted tokens on the user row. - Onboarding: after connection, enter the ship-from address and call
POST /ebay/onboarding/setup, which opts into business policies if needed, creates a default inventory location and policies for eBay France when missing, and saves IDs in GoupixDex. - Category: the default leaf category for listings (single JCC / Pokémon cards on eBay France) is defined in code (
EBAY_FR_DEFAULT_LEAF_CATEGORY_IDinapi/config.py). A different value can still be stored per user inebay_category_idif needed.
- Listing images must be HTTPS (e.g. Supabase URLs) — required by the eBay Inventory API.
- In sandbox, use test accounts and listings; category and policy IDs must exist for the chosen marketplace (e.g.
EBAY_FR).
- Authorization code grant
- Getting user consent
- Exchanging the authorization code
- Inventory API — createOrReplaceInventoryItem
- createOffer / publishOffer
- Token exchange error:
redirect_uridoes not match what is registered at eBay, orcodealready used / expired (codes are single-use and short-lived). - “User is not eligible for Business Policy” (logs: error 20403 on
fulfillment_policy): the account must be enrolled in business policies. The API callsoptInToProgramwithSELLING_POLICY_MANAGEMENTbefore loading policies; eBay can take up to ~24 h to activate — retry later or check withgetOptedInPrograms. - Publishing error: wrong category, policies incompatible with the marketplace, or condition descriptors required for some card categories — see API logs (
ebay_body).