Skip to content

API Version Management and Response Format Fix ​

September 2, 2025

Overview ​

Fixed an issue where API responses included HTTP headers in the response body, making JSON responses unparseable. To maintain backward compatibility with existing integrations, we've introduced API versioning.

The Issue ​

API endpoints were returning responses like:

HTTP/1.1 200 OK
Cache-Control: no-cache, private
Content-Type: application/json
Date: Mon, 01 Sep 2025 08:25:40 GMT

{"status":"Success","code":200,"message":"Request Submitted"}

Instead of clean JSON:

json
{"status":"Success","code":200,"message":"Request Submitted"}

Solution: API Versioning ​

Version Detection (Priority Order) ​

  1. Request Header: SellerLegend-Api-Version: v2
  2. User Preference: Stored user default (configurable)
  3. System Default: Based on account creation date
    • Accounts created after Sept 1, 2025: Default to v2
    • Older accounts: Default to v1

API Version Behaviors ​

Version 1 (Legacy -- Default for existing users)

  • Maintains the current behavior with headers in response body
  • For existing integrations that may have adapted to parse the malformed responses

Version 2 (Fixed -- Default for new users)

  • Clean JSON responses without header pollution
  • Proper JSON/data responses
  • Properly formatted gzipped content with correct headers for downloads

Usage Instructions ​

Testing Version 2 ​

Add the header to your API requests:

bash
curl -H "SellerLegend-Api-Version: v2" \
     -H "Authorization: Bearer YOUR_TOKEN" \
     https://app.sellerlegend.com/api/reports/request

Migrating to Version 2 ​

  1. Test your integration with the version header: SellerLegend-Api-Version: v2
  2. Update your parser to handle clean JSON responses (remove any header-stripping logic)
  3. Once stable, you can set v2 as your default (contact support)

What to Expect ​

If you stay on v1:

  • No changes required to your integration
  • Responses continue to include headers in body

If you migrate to v2:

  • Clean JSON responses
  • Proper content-type headers for downloads
  • Better error handling
  • Improved performance (no double-wrapping)

Affected Endpoints ​

All API endpoints are affected, including:

  • /api/reports/request
  • /api/reports/status
  • /api/reports/download
  • /api/sales/*
  • /api/inventory/*
  • /api/user/*

Rollout Plan ​

  • Immediate: All new accounts default to v2
  • Available now: Existing users can opt-in via header
  • Future: Gradual migration tools and notifications for v1 users
  • Long-term: v1 deprecation (with ample notice)