Skip to main content

Integrations overview

Provider code lives in src/integrations. Feature modules must not import provider SDKs. The architecture check enforces that.

Registration​

KindHow it is discovered
MarketplaceClass names {Provider}OrderService and {Provider}CatalogService. Optional: Customer, Settlement, OutboundOrder, Inventory, Webhook, WebhookHealth. Prefix must be Shopify, WooCommerce, Amazon, Flipkart, BigCommerce, or Meesho
CourierDuck typing: integrationCode, ship, cancel, track
WhatsAppNot this regex. Agent module plus meta-commerce
CUSTOMSeed only. Scheduler skips it

Registry seed: src/migrations/seed/integration-registry.seed.ts. Runtime: IntegrationAutoRegistrationService.

Direction​

FlowDirection
Order, product, customer, settlement pullChannel → PointNXT on the scheduler
Inventory publishPointNXT → channel
Order status pushPointNXT → channel when Channel.manageState is true. A change the channel itself reported (source: CHANNEL_SYNC on order.status.changed) is never pushed back
Price pushchannel-price-push.adapter.ts exists. Call sites were not fully traced
Labels and trackingPointNXT → courier, then courier → PointNXT by webhook or poll

Marketplace pattern​

Every marketplace integration is a translator: it reads the channel and maps what it reads, and leaves every decision about orders to the shared code below. Nothing in an integration writes Order.orderStatus, decides a hold, or stores an address itself.

ConcernShared codeIntegration supplies
Channel and sellerloadSyncChannel / resolveChannelSeller (marketplace/utils/channel-sync-context.util.ts): the channel of the integration's type, and the tenant's first sellerThe channel type
Poll loopChannelOrderSyncRun (order/services/channel-order-sync-run.ts): each order imported on its own, counted, failures kept in ChannelOrderRetryList (<channel>:order-sync:failed:<channelId>, 25 re-read a run, 7 days) and re-read by id; finish() says whether the watermark may moveHow a page is fetched, and how one order is read by id
Creating and updating an orderMarketplaceOrderIngestionService.create / update: fields, payment hold, lines, status through transitionFromChannel, customer note, outbox events in the same transactionorderData, a replaceItems callback, the channel's own hold (resolveChannelHold), events to raise (an AWB report)
A deleted orderMarketplaceOrderIngestionService.cancelRemovedThe channel order id
AddressesprocessAddresses (OrderAddressHandler): updates before shipment, keeps an operator's correction and a shipped order's address, records a conflict; an address with no street line (redacted PII) never replaces a full oneThe address in ChannelAddressInput shape
CustomersupsertChannelCustomer, channelCustomerKey (customer/utils/channel-customer.util.ts)The customer fields
Order linesOrderItemSyncService.sync: lines matched by id, stock released for removed or cancelled linesThe lines
Reporting parcels backchannelReportableShipmentsWhere (shipment/domain): forward, PointNXT-made, live, with an AWBWhat the channel calls a fulfilment
Webhook deliverieswebhook_queue → WebhookProcessor → the channel's registered {Provider}WebhookServiceprocessWebhook(job)
Payload helperstoJson, parseMoney (common/utils/channel-payload.util.ts), normalizeCurrency, booleanSetting

The watermark rule is the same everywhere: it moves only when the window was read to the end and no failed order would be lost. Each failure is either kept to re-read by id, or, for a channel that cannot read an order by id (Meesho), holds the watermark. Flipkart needs neither: open shipments are searched every run, and orders already held are re-read by shipment id.

Shared failure behavior​

sync_queue attempts 3, exponential backoff 5 seconds. Circuit breaker writes SUSPENDED, not INACTIVE. Outbox retries then DEAD, with no replay API identified. Inventory feed poll reaper runs every 10 minutes. Stale outbox PROCESSING locks return to PENDING after 5 minutes.

Credentials​

Encrypted on IntegrationConnection with CREDENTIAL_VAULT_KEY_V1. Not stored in Channel.config.

Pages​

Shopify, WooCommerce, Amazon, Flipkart, BigCommerce, Meesho, WhatsApp, Couriers, Payments, Payment gateway settlements, Accounting systems, Platform services.