Skip to content

Reports Endpoints ​

Report generation is asynchronous. You request a report, poll for its status, and download it when complete.

Request Report ​

Initiate a report generation job.

POST /reports/request

Query Parameters (use one):

ParameterTypeRequiredDescription
product_skustringConditionalGenerate a report for a specific SKU
dps_datestringConditionalGenerate a daily product sales report for a specific date (Y-m-d)
last_updated_datestringConditionalGenerate a report for records updated since this date (Y-m-d)

Provide exactly one of the above parameters. Plus an account selection parameter.

Example Request:

bash
curl -X POST "https://app.sellerlegend.com/api/reports/request?account_title=My Store US&product_sku=MY-SKU-001" \
  -H "Authorization: Bearer {ACCESS_TOKEN}"

Response:

json
{
  "report_id": "rpt_abc123def456",
  "status": "processing",
  "message": "Report generation started"
}

Response Fields:

FieldTypeDescription
report_idstringUnique report identifier — use this to check status and download
statusstringInitial status (processing)
messagestringStatus message

Python SDK:

python
from sellerlegend_api import SellerLegendClient

client = SellerLegendClient(access_token="YOUR_ACCESS_TOKEN")

report = client.reports.request(
    account_title="My Store US",
    product_sku="MY-SKU-001"
)

print(f"Report ID: {report['report_id']}")

Check Report Status ​

Check the progress of a report generation job.

GET /reports/status

Query Parameters:

ParameterTypeRequiredDescription
report_idstringYesThe report ID returned from the request endpoint

Example Request:

bash
curl -X GET "https://app.sellerlegend.com/api/reports/status?report_id=rpt_abc123def456" \
  -H "Authorization: Bearer {ACCESS_TOKEN}"

Response (in progress):

json
{
  "status": "processing",
  "progress": 45,
  "message": "Processing records..."
}

Response (complete):

json
{
  "status": "completed",
  "progress": 100,
  "message": "Report is ready for download"
}

Response Fields:

FieldTypeDescription
statusstringprocessing or completed
progressintegerPercentage complete (0–100)
messagestringHuman-readable status message

Python SDK:

python
import time

status = client.reports.get_status(
    account_title="My Store US",
    report_id=report['report_id']
)

while status['status'] == 'processing':
    time.sleep(5)
    status = client.reports.get_status(
        account_title="My Store US",
        report_id=report['report_id']
    )
    print(f"Progress: {status.get('progress', 0)}%")

Download Report ​

Download a completed report in your preferred format.

GET /reports/download

Query Parameters:

ParameterTypeRequiredDescription
report_idstringYesThe report ID
formatstringNoDownload format: csv or json (default: json)

Example Request:

bash
curl -X GET "https://app.sellerlegend.com/api/reports/download?report_id=rpt_abc123def456&format=json" \
  -H "Authorization: Bearer {ACCESS_TOKEN}"

Response (JSON format):

json
[
  {
    "sku": "MY-SKU-001",
    "product_name": "My Product Name",
    "units_ordered": 150,
    "product_sales": 4497.00
  }
]

Python SDK:

python
report_data = client.reports.download(
    account_title="My Store US",
    report_id=report['report_id'],
    format="csv"
)

with open('report.csv', 'w') as f:
    f.write(report_data)

WARNING

Reports are only available for download after the status shows completed. Attempting to download a report that is still processing will return an error.

Workflow

  1. Call POST /reports/request to start generation
  2. Poll GET /reports/status until status is completed
  3. Call GET /reports/download to retrieve the data