Merchant API: listed products
About this article
This article explains how to use the GET /v2/channels/{channelId}/products endpoint of the Merchant API to retrieve the listed products of a channel, including the export status and the channel status of each product.
Table of contents
Endpoint: retrieve listed products
Introduction
You store your products on ChannelEngine and select them to list on a channel. Next, you want to know what happened: did the export run, and did the channel accept the products?
The channels endpoint answers both questions. The endpoint returns the export status and the channel status for each product on a channel, plus the channel product reference, the last price, and the last stock that ChannelEngine exported. Use the channels endpoint to confirm a sync, audit a whole channel, or spot products that need attention.
Overview
Refer to the flowchart below to visualize how listed product statuses travel between the channel, ChannelEngine, and your system.
The GET /v2/channels endpoint reports two kinds of statuses for every product:
- Export status: what ChannelEngine did with the product on the last export (e.g.: created or updated).
- Channel status: what the channel reports back about the product (e.g.: published or not published).
The response also includes products that ChannelEngine deleted earlier and that are now set to be created again.
ChannelStatus stays NONE and the response only contains the export status.
Requirements
-
Tenant URL: the base URL is
https://{tenant}.channelengine.net/api. -
Merchant API key: a unique code that identifies your account to ChannelEngine. Send it in the
X-CE-KEYheader. A Channel API key does not work here. -
Channel ID: call
GET /v2/channels. Each global channel in the response has aChannelsarray, and every item in it has aChannelId. Use that value, not theGlobalChannelId. - Selected products: only products in the product selection of the channel appear in the response.
Available API endpoints
Use these endpoints to find and check the listed products of a channel.
-
Retrieve channels:
GET /v2/channels
Use this endpoint to find theChannelIdof the channel you want to check. -
Retrieve listed products:
GET /v2/channels/{channelId}/products
Use this endpoint to retrieve the listed products of a channel, with the export status, the channel status, the last exported price, and the last exported stock of each product.
Endpoint: retrieve listed products
Send a GET request to /v2/channels/{channelId}/products with your Merchant API key in the X-CE-KEY header.
Parameters
| Parameter | In | Type | Description |
channelId (required) |
Path | Integer | The ID of the channel you want to check. |
MerchantProductNos |
Query | Array of strings | One or more of your SKUs. Repeat the parameter for each SKU. If you leave it out, the response contains all listed products. |
Page |
Query | Integer | The page to retrieve. The first page is 1. |
Step by step
- Call
GET /v2/channelsto find your channel ID. Note theChannelIdof the channel you want to check, found underChannelsin each global channel. - Send the request to
GET /v2/channels/{channelId}/productswith your key in theX-CE-KEYheader. AddMerchantProductNosto check specific SKUs, orPageto move through a large catalog. You receive HTTP 200 withSuccess: true. - Read
ExportStatusandChannelStatusfor each product. Refer to Status values for the meaning of each value.
Example requests
cURL
curl -X GET "https://{tenant}.channelengine.net/api/v2/channels/123/products?Page=1&MerchantProductNos=SHIRT-RED-M&MerchantProductNos=SHIRT-BLUE-L" \
-H "Accept: application/json" \
-H "X-CE-KEY: YOUR_MERCHANT_API_KEY"Python
import requests
BASE = "https://your-tenant.channelengine.net/api"
HEADERS = {"X-CE-KEY": "YOUR_MERCHANT_API_KEY", "Accept": "application/json"}
def get_listed_products(channel_id):
page = 1
while True:
response = requests.get(
f"{BASE}/v2/channels/{channel_id}/products",
headers=HEADERS,
params={"Page": page},
)
response.raise_for_status()
data = response.json()
if not data["Success"]:
raise RuntimeError(data.get("Message"))
yield from data["Content"]
if page * data["ItemsPerPage"] >= data["TotalCount"]:
break
page += 1
not_published = [
p for p in get_listed_products(123)
if p["ChannelStatus"] == "NOT_PUBLISHED"
]Reading the response
The response is a paginated collection. Each item in Content is one listed product.
| Field | Description |
MerchantProductNo |
Your product number (SKU). |
Ean |
The EAN of the product. |
ChannelProductNo |
The unique product reference that the channel uses. Empty until the channel has a reference for the product. |
ExportStatus |
The result of the last export from ChannelEngine to the channel. Can be null. |
ChannelStatus |
The status that the channel reports for the product. |
LastExportedPrice |
The price that ChannelEngine last exported. |
LastExportedStock |
The stock that ChannelEngine last exported, after any stock buffer or stock limit. |
Around the items, the response contains the standard collection fields:
| Field | Description |
Count |
The number of items on this page. |
TotalCount |
The number of listed products across all pages. |
ItemsPerPage |
The maximum number of items per page. |
StatusCode |
The HTTP status code. |
Success |
true if the request succeeded. Check this field as well as the HTTP status. |
Message, ExceptionType, ValidationErrors
|
Details about a failed request. Empty when Success is true. |
RequestId, LogId
|
Reference IDs for the request. Include them when you contact Support. |
Example response for GET /v2/channels/123/products?Page=1:
{
"Content": [
{
"MerchantProductNo": "SHIRT-RED-M",
"Ean": "8715342024592",
"ChannelProductNo": "9876543210",
"ExportStatus": "CREATED",
"ChannelStatus": "PUBLISHED",
"LastExportedPrice": 24.99,
"LastExportedStock": 12
},
{
"MerchantProductNo": "SHIRT-BLUE-L",
"Ean": "8715342024608",
"ChannelProductNo": null,
"ExportStatus": "CREATE_FAILED",
"ChannelStatus": "INVALID_ON_CREATE",
"LastExportedPrice": 24.99,
"LastExportedStock": 0
}
],
"Count": 2,
"TotalCount": 1500,
"ItemsPerPage": 100,
"StatusCode": 200,
"Success": true
}Status values
These are the values that the API returns. They correspond to the statuses you see in Listed products on ChannelEngine.
ExportStatus
| Value | Meaning |
CREATED |
ChannelEngine created the product on the channel. |
UPDATED |
ChannelEngine updated the product. |
DELETED |
ChannelEngine removed the product from the channel. |
CREATE_FAILED |
The channel refused the product, or the product failed validation before export. ChannelEngine tries again on the next export. |
null |
No export status is available for this product yet. |
ChannelStatus
| Value | Meaning |
NONE |
No feedback from the channel yet, or the channel does not offer feedback. |
PUBLISHED |
The channel reports the product as active. |
NOT_PUBLISHED |
The product is not listed. Check the validation messages on ChannelEngine for the reason. |
UNDER_REVIEW |
The channel reviews the product before it publishes the product. |
INVALID_ON_CREATE |
The product failed validation when ChannelEngine tried to create it, for example because of an invalid EAN or a price of 0. |
UNKNOWN |
ChannelEngine received feedback, but the feedback contained nothing about this product. |
Common workflows
Check specific products after a sync
Pass the SKUs you just updated in MerchantProductNos. This is faster than paging through the whole channel.
Audit a full channel
- Request
Page=1and readTotalCountandItemsPerPage. - Calculate the number of pages:
TotalCount / ItemsPerPage, rounded up. - Request each page from
1to the last page and collect the items.
MerchantProductNos.
Testing the endpoint
Test in your development environment before you go live.
- Call the endpoint without filters for a channel that has selected products. Expect HTTP 200,
Success: true, and items inContent. - Call it again with one SKU in
MerchantProductNos. Expect only that product in the response and aTotalCountof 1. - Compare the result with Listed products for the same channel on ChannelEngine. Expect the export status, channel status, price, and stock to match the values in the UI.
Common issues
| What you see | Likely cause and fix |
HTTP 401 or Success: false
|
The API key is missing, wrong, or a Channel API key. Use a Merchant API key in the X-CE-KEY header. |
Empty Content
|
The channelId is wrong, no products are selected for the channel, or the SKUs in MerchantProductNos do not match your MerchantProductNo values. |
ChannelStatus is NONE
|
ChannelEngine did not export the product yet, or the channel does not send feedback. Check the export status first. |
ChannelStatus is INVALID_ON_CREATE
|
The product failed validation on creation. Open Listed products for the channel, click the information icon on the product, fix the reported issue, and export again. |
LastExportedStock differs from your stock |
A stock buffer or stock limit applies to the channel, or open orders reserve stock. ChannelEngine also sends offers incrementally, so an update only goes out when stock or price changes. |
ExportStatus is CREATE_FAILED
|
The channel refused the product or validation failed. Check the validation messages in the Listed products step. If the same errors repeat, the product may appear in the Blocked products tab. |
If the issue persists, contact ChannelEngine Support and include the RequestId and LogId from the response.
Next steps
- Managing products via the Merchant API: submit and update product content.
- Managing offers via the Merchant API: update stock and price on your products.
- Authentication and rate limits: set up your Merchant API key and learn about request throttling.
Comments
0 comments
Article is closed for comments.