Skip to content

Channels

Channels are isolated pricing namespaces. Each channel has its own pricelists, promotions, customers, and currency. This allows you to run separate pricing configurations for different storefronts, regions, or sales contexts — all within the same API instance.

The x-channel Header

To operate within a channel, include the x-channel header in your request with the channel's slug:

x-channel: my-channel-slug

When this header is omitted, the API operates in global mode (see below).

Global Mode

When no x-channel header is provided, the API uses the global configuration — the default pricelists, promotions, and customers not assigned to any specific channel. This is the default behavior.

Request Examples

Catalog endpoint — with channel

bash
curl -X GET http://localhost:3000/api/pricing-products \
  -H "x-channel: my-channel-slug"

Catalog endpoint — global mode (no channel)

bash
curl -X GET http://localhost:3000/api/pricing-products

Cart endpoint — with channel

bash
curl -X POST http://localhost:3000/api/cart/price \
  -H "Content-Type: application/json" \
  -H "x-channel: my-channel-slug" \
  -d '{"items": [{"sku": "PRODUCT-1", "quantity": 2}]}'

Cart endpoint — global mode

bash
curl -X POST http://localhost:3000/api/cart/price \
  -H "Content-Type: application/json" \
  -d '{"items": [{"sku": "PRODUCT-1", "quantity": 2}]}'

Response Behavior

The x-channel header affects:

  • Base prices — resolved from the channel's primary pricelist
  • Active promotions — only promotions assigned to the channel are applied
  • Customer prices — only customers belonging to the channel are considered
  • Currency — prices are returned in the channel's configured currency