Skip to main content
A storefront, a marketplace feed or an integration can hold a copy of the prices Elastly publishes, without asking for a price on every page view. You load a snapshot of a channel’s live prices once, then read the changes each time a new price list version goes live. This page covers the three read endpoints and the order to call them in. To price one customer and basket at the moment of the request, see Price requests.

Before you start

  • A Live, Test, Read-only or Storefront API key. A Connector key cannot read channels. See Authentication.
  • A Storefront key limited to a list of channels reads only those channels.
  • Test keys read the same published prices as Live keys.

List the channels

GET /v1/channels lists the channels the key can read, ordered by name. Each price list has a channel of kind price_list. A connected storefront has a channel of kind storefront.
Each channel has its id, name, kind, the currencies it has live prices in, and liveVersions: the currency, version and validFrom of each live price list version. Page with limit (1 to 100, default 50) and after. See Pagination.

Load a snapshot

GET /v1/channels/{channelId}/prices returns the live prices of a channel, one page at a time.
Page with limit (1 to 1,000, default 500) and the nextCursor of the previous page as after. Add currency to read one currency. Later pages stay on the versions the first page read, so a version that goes live while you are paging does not mix into the snapshot. Every page carries a snapshotCursor. Keep the one from the first page: it marks the point in the change feed where the snapshot was taken. While a new version is being published, the first page answers 409 with channel_publishing and a Retry-After header. Wait for the number of seconds in the header and send the request again.

Follow the changes

GET /v1/channels/{channelId}/price-changes lists every price that was set or removed when a version of the channel went live, in order.
1

Start from the snapshot

Send the snapshotCursor of your snapshot as after.
2

Apply each change

A change with change set to set carries the new price and priceId. A change set to removed means the item is no longer priced on the channel; its price and priceId are null.
3

Keep the cursor

Store the nextCursor of every page, including an empty page, and send it as after on the next call.
Each change also has sku, unit, quantityTier, currency, version, validFrom, validUntil and occurredAt. Page with limit (1 to 1,000, default 500). Add currency to read one currency. Changes are kept for 30 days. A cursor older than that is refused with 400 and invalid_cursor; load a new snapshot and continue from its snapshotCursor.

Know when to read

The channel.published webhook event is sent when a version has gone live on a channel and its changes are ready to read. Treat the event as a signal and read the change feed for the content. The event is delivered in live mode. See Webhooks.

When a request is refused

Price requests

Price a customer’s lines at the moment of the request.

Webhooks

Receive channel.published and every other event.