ebay_client/README.md

1.3 KiB

eBay REST Client

This workspace contains a Python-first eBay REST client foundation with:

  • a shared OAuth 2.0 core
  • a shared HTTP transport layer
  • public API wrappers per eBay REST domain
  • an isolated Pydantic model generation script for each contract in this folder

Currently wired API domains include Notification, Inventory, Fulfillment, Account, Feed, and Media.

Generate Low-Level Clients

The project uses a dedicated code generation environment because the main runtime is currently on Python 3.14 while the model generator still targets earlier Python versions.

Run the generator script from the project root:

& .\.venv\Scripts\python.exe .\scripts\generate_clients.py

To generate only one API package:

& .\.venv\Scripts\python.exe .\scripts\generate_clients.py --api notification

This regenerates Pydantic v2 models into ebay_client/generated/<api>/models.py.

Webhook Helpers

The Notification package also includes framework-agnostic webhook utilities for:

  • responding to eBay challenge requests
  • parsing and validating the X-EBAY-SIGNATURE header
  • verifying signed notification payloads against the cached public key
  • turning a verified notification body into a normalized WebhookEventEnvelope

A concrete FastAPI integration example is available in examples/fastapi_notification_webhook.py.