After adding your eBay API credentials to Vercel, use these endpoints to verify everything is working correctly.
Replace your-site.vercel.app with your actual Vercel deployment URL:
https://ebay-store.vercel.app/api/ebay-status
What it does: Checks if environment variables are configured
Expected Response (Success):
{
"success": true,
"mode": "client_credentials",
"marketplaceId": "EBAY_US",
"missing": [],
"timestamp": "2026-02-14T21:35:00.000Z"
}Expected Response (Missing Credentials):
{
"success": true,
"mode": "disabled",
"marketplaceId": "EBAY_US",
"missing": ["EBAY_CLIENT_ID", "EBAY_CLIENT_SECRET"],
"timestamp": "2026-02-14T21:35:00.000Z"
}https://ebay-store.vercel.app/api/ebay-test
What it does: Actually fetches products from eBay to verify credentials work
Expected Response (Success):
{
"success": true,
"status": {
"mode": "client_credentials",
"marketplaceId": "EBAY_US",
"missing": []
},
"test": {
"query": "electronics",
"productsFound": 5,
"totalAvailable": 5000,
"affiliateTrackingActive": true,
"sampleProduct": {
"title": "Apple iPhone 15 Pro Max 256GB",
"price": 1199,
"currency": "USD",
"affiliateLink": "https://www.ebay.com/itm/123456?mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5338903178&customid=api-electronics",
"hasCorrectCampaignId": true
}
},
"timestamp": "2026-02-14T21:35:00.000Z"
}- Visit:
https://ebay-store.vercel.app/api/ebay-status - Check the response:
- ✅
"mode": "client_credentials"= Credentials are configured - ❌
"mode": "disabled"= Credentials missing (checkmissingarray)
- ✅
- Visit:
https://ebay-store.vercel.app/api/ebay-test - Look for:
- ✅
"success": true - ✅
"productsFound": 5(or more) - ✅
"affiliateTrackingActive": true - ✅
"hasCorrectCampaignId": true
- ✅
In the test response, check the affiliateLink:
https://www.ebay.com/itm/123456
?mkcid=1
&mkrid=711-53200-19255-0
&siteid=0
&campid=5338903178 ← YOUR Campaign ID
&customid=api-electronics
✅ All parameters should be present, especially campid=5338903178
Problem: Environment variables not set in Vercel
Solution:
- Go to Vercel Dashboard → Your Project → Settings → Environment Variables
- Add:
EBAY_CLIENT_ID= Your Production App IDEBAY_CLIENT_SECRET= Your Production Cert ID
- Redeploy your site (or wait for automatic deployment)
Problem: Credentials might be invalid or wrong type
Possible causes:
- Using Sandbox credentials instead of Production
- Credentials have typos or extra spaces
- eBay API is temporarily down
Solution:
- Double-check credentials at developer.ebay.com/my/keys
- Ensure you're using Production keyset (not Sandbox)
- Copy credentials carefully (no extra spaces)
- Update in Vercel and redeploy
Problem: Campaign ID not being added to URLs
Solution:
- Check if
lib/ebay-api.tshas the latest code - Verify
CAMPID = '5338903178'is set - Redeploy to pull latest code changes
Problem: OAuth authentication failing
Solution:
- Verify credentials are Production keys (not Sandbox)
- Check that CLIENT_ID and CLIENT_SECRET match exactly
- Ensure no trailing spaces in environment variables
- Try regenerating keys in eBay Developer Portal
Problem: API permissions issue
Solution:
- Check marketplace ID matches your account region
- Ensure your eBay developer account is fully activated
- Verify OAuth scope is correct (defaults should work)
To test on your local machine:
- Create
.env.local:
EBAY_CLIENT_ID=your-production-app-id
EBAY_CLIENT_SECRET=your-production-cert-id
EBAY_MARKETPLACE_ID=EBAY_US- Run development server:
npm run dev- Test endpoints:
- Open browser DevTools (F12)
- Go to Network tab
- Visit test endpoint
- Check:
- Response status: Should be
200 OK - Response time: Should be < 2 seconds
- Response body: Should match examples above
- Response status: Should be
# Check status
curl https://ebay-store.vercel.app/api/ebay-status
# Test product fetching
curl https://ebay-store.vercel.app/api/ebay-test# Check status
http https://ebay-store.vercel.app/api/ebay-status
# Test product fetching
http https://ebay-store.vercel.app/api/ebay-test- Go to Vercel Dashboard → Your Project → Logs
- Filter for
/api/ebay-testrequests - Look for errors or warnings
- Log in to partnernetwork.ebay.com
- Go to Reports → Campaign Reports
- Filter by Campaign ID:
5338903178 - Within 24-48 hours, you should see:
- Test clicks from your verification
- Real user clicks once site is live
-
/api/ebay-statusreturns"mode": "client_credentials" -
/api/ebay-testreturns"success": true - Test response shows
"productsFound": 5or more - Affiliate link contains
campid=5338903178 -
"affiliateTrackingActive": true -
"hasCorrectCampaignId": true - No errors in Vercel logs
- Click appears in EPN dashboard (wait 24-48 hours)
Once tests pass:
- ✅ Update your pages to use
searchEbayProducts() - ✅ Replace static products with API calls
- ✅ Deploy changes to production
- ✅ Monitor EPN dashboard for actual user clicks
- ✅ Optimize based on performance data
See API_INTEGRATION_GUIDE.md for implementation examples.
If tests fail after trying solutions above:
- Check eBay API Status
- Review eBay Developer Forums
- Open an issue in this repository
- Contact eBay Partner Network support
Your Campaign ID: 5338903178
Test Endpoints Created: February 14, 2026