> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Read the prices published to a channel

> List the channels a key can read, load a full snapshot of a channel's live prices and follow every later change through a cursor feed.

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](/docs/developers/price-requests.md).

## Before you start

* A **Live**, **Test**, **Read-only** or **Storefront** API key. A **Connector** key cannot read channels. See [Authentication](/docs/developers/authentication.md).
* 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`.

```bash theme={null}
curl "https://api.elastly.ai/v1/channels?limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

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](/docs/developers/pagination.md).

## Load a snapshot

`GET /v1/channels/{channelId}/prices` returns the live prices of a channel, one page at a time.

```bash theme={null}
curl "https://api.elastly.ai/v1/channels/6b1f0c2e-7a45-4d39-9e08-3c5a1d7f2b64/prices?limit=500" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

| Field | Meaning |
| - | - |
| `sku`, `unit` | The item and its selling unit |
| `quantityTier` | The quantity range the price applies to, as `from` and `to`. `to` is `null` when the range has no upper end |
| `price`, `currency` | The price as a money object and its currency |
| `priceId` | The identifier of the price decision. Send it back on the order line to link the order to this price. See [Data ingestion](/docs/developers/data-ingestion.md#echo-the-price-on-an-order-line) |
| `version` | The number of the price list version the price belongs to |
| `validFrom` | When that version went live |
| `validUntil` | When the next scheduled version goes live, or `null` when none is scheduled |

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.

```bash theme={null}
curl "https://api.elastly.ai/v1/channels/6b1f0c2e-7a45-4d39-9e08-3c5a1d7f2b64/price-changes?after=SNAPSHOT_CURSOR" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**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](/docs/developers/webhooks.md).

## When a request is refused

| Status | Code | Cause |
| - | - | - |
| `400` | `invalid_cursor` | The `after` value is malformed, belongs to another channel, or is older than 30 days |
| `403` | `insufficient_scope` | The key type cannot read channels |
| `404` | `not_found` | The channel does not exist or the key cannot read it |
| `409` | `channel_publishing` | A new version is being published. Retry after the `Retry-After` seconds |

> [card] [Price requests](/docs/developers/price-requests.md)
>
> Price a customer's lines at the moment of the request.

> [card] [Webhooks](/docs/developers/webhooks.md)
>
> Receive `channel.published` and every other event.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.