Skip to main content

Channels

A channel is a sales connection owned by a seller inside a tenant. Secrets live on IntegrationConnection, not on Channel.config.

Responsibilities​

  • Represent Shopify, WooCommerce, Amazon, Flipkart, BigCommerce, WhatsApp, Meesho, and CUSTOM connections. Channel.type is a String, not a Prisma enum.
  • Store publish defaults (allocation mode, buffers, fulfillment mode, manageState).
  • Record sync runs on SyncJobLog.
  • Stop sync when status is INACTIVE or SUSPENDED.

Architecture​

Code map​

PiecePath
Schema21-channel.prisma
Sellersrc/modules/commerce/seller
Channel featuresrc/modules/commerce/channel
Registrysrc/integrations/registry
Connection vaultsrc/integrations/connection
Auto registrationIntegrationAutoRegistrationService

Entities: Channel, Seller, WarehouseChannelLocation, ChannelInventoryState, ChannelInventoryFeedSubmission, SyncJobLog, IntegrationRegistry, IntegrationConnection.

Business rules​

Implementation behavior

INACTIVE is only for an explicit user update. Automated code must not write INACTIVE or turn an inactive channel back to ACTIVE. SUSPENDED is for the sync circuit breaker. Both stop sync. Only INACTIVE means a person turned the channel off.

Status

Schema comment. See ADR 0002.

Implementation behavior

5 consecutive non-transient failures of one sync type inside 6 hours set SUSPENDED. Auth-shaped failures use a threshold of 2 in that window.

Status

sync-job.processor.ts. How a human returns the channel to ACTIVE is unknown.

Cadence constants: product 6 hours, customer 12 hours, settlement 24 hours. Order interval is tenant-configured. The comment says production uses 5 minutes. That number is not the constant. The storage field and UI control are unknown.

CUSTOM has no marketplace handler. The scheduler skips types with no handler. Whether CUSTOM is a supported selling mode or only a seed placeholder is unknown.

API surface​

Channel and channel-admin controllers, plus per-provider controllers under src/integrations/*/controllers. OpenAPI lists the fields.

Events​

channel.created and channel.updated are in-process. They are not outbox types. channel.created auto-binds locations. channel.updated is observed by webhook health.

Failure scenarios​

Repeated sync failure suspends the channel. Later ticks skip it. Bull still retries the job (3 attempts) before the history accumulates. An unknown channel type logs a warning and is not retried until a handler exists.

Development​

Register marketplace classes with the expected names or they will not sync. Keep credentials on the connection vault.

Troubleshooting​

Sync and inventory.