eBay listings import

Session-authenticated import contract for syncing active eBay listings into canonical listing rows.

Last updated:

Route

GET /api/ebay/listings/import (also accepts POST)

Purpose

  • Imports active eBay listings into canonical listing rows.
  • Skips ActiveList rows that eBay reports as hidden/out-of-stock (for example HideFromSearch = true, ReasonHideFromSearch, or fixed-price rows with QuantityAvailable <= 0) so Control tower Manage only surfaces buyer-visible listings for stock-sync actions.
  • Optional reconciliation mode marks local published eBay listings that are no longer active on eBay as marketplace_status = 'unknown' (no unsold inference from active-list absence alone).

Query parameters

  • limit: 1..200 (default 50)
  • pages: 1..200 (default 1)
  • reconcile: boolean (1|true|yes|on enables reconciliation, default false)

Response fields

Returned in addition to ok:

  • fetched_listings
  • saved_listings
  • pages_requested
  • pages_fetched
  • pages_target
  • skipped_hidden
  • reconcile_requested
  • reconcile_applied
  • reconcile_skipped_reason (null when not skipped)
  • reconciled_unknown

Reconciliation rules

  • Reconciliation is applied only when all active-list pages were fetched for the run.
  • If active-list page count exceeds the importer cap (200 pages), import still succeeds but reconciliation is skipped.
  • Imported rows are stamped with marketplace_status = 'active'.
  • Hidden/out-of-stock ActiveList rows are excluded from the imported active set.
  • Reconciled rows move to marketplace_status = 'unknown' without changing canonical listing.status.

Import selected eBay listings to stock

Route:

  • POST /api/ebay/listings/import-to-stock

Body:

  • item_ids (optional): eBay ItemID array. When omitted, ChannelWeave attempts import for buyer-visible discovered published eBay listings. When specific item_ids are supplied, ChannelWeave still allows explicit import of already discovered rows, including unknown runtime state rows selected from the Listings workspace.

Behaviour:

  • Creates stock rows when no matching stock exists for the listing SKU.
  • Links listing rows to stock (listing.stock_id).
  • If listing SKU is blank, importer fallback SKU generation still applies.
  • Inventory SKU policy now applies during create. Policy-blocked SKUs are skipped and returned in blocked_items.

Create revision draft for a live listing

Route:

  • POST /api/listings/ebay/revision-drafts

Body:

  • listing_id (required): published eBay ItemID.

Success response:

  • ok: true
  • draft_id
  • listing_id
  • edit_url (draft editor route)

Validation notes:

  • Listing must remain linked to stock.
  • Listing must be in canonical published status and eBay marketplace status active, scheduled, or unknown.
  • If listing has a source draft, ChannelWeave clones that draft.
  • If listing has no source draft (imported listing), ChannelWeave adopts it by creating a new draft seeded from listing data and stock defaults.

Publish endpoint mode (publish vs revise)

Route:

  • POST /api/listings/ebay/drafts/:id/publish

Response now includes: