Get the Result of a Catalog Upload
Buy with Prime API is now available for early access
Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.
After you upload your catalog and start feed processing, you can retrieve the feed file processing results by doing the following steps:
- Perform a catalog feed query to get result file ID and signals
- Get a link to a catalog feed result.
- Download a catalog feed result file.
For an overview of catalog terminology, see Create and Manage Catalogs. To learn how to call the Buy with Prime API, see Call the Buy with Prime API.
Sample data
The examples in this topic use the following sample data.
Sample catalog data
let inSearchOfLostTime = {
title: "In Search of Lost Time",
isbn: "12345",
offerPrime: true,
sku: "12345",
amazonSku: "12345",
imageUrl: "https://example.com/image-12345.jpg",
detailPageUrl: "https://www.amazon.com/dp/12345"
};
let prideAndPrejudice = {
title: "Pride and Prejudice",
isbn: "678910",
offerPrime: true,
sku: "678910",
amazonSku: "678910",
imageUrl: "https://example.com/image-678910.jpg",
detailPageUrl: "https://www.amazon.com/dp/678910"
};
Perform a catalog feed query to get result file ID and signals
To obtain the catalog feed result, you first perform a catalogFeed
query. In the query, use the id
from the CreateCatalogFeedResponse
you received when you started feed processing.
Depending on the status of the catalogFeed
query, you get different responses:
- For COMPLETED status, the response contains a
fileId
that you use to get a link to the catalog feed result. - For FAILED status, the response contains a list of signals indicating why the catalog feed processing failed. There is no result file in this case. For a description of the fields, see Signal.
The following example shows how to make a catalogFeed
query.
Request
// GraphQL query to get the catalog feed result
query catalogFeed($catalogFeedId: String!) {
catalogFeed(catalogFeedId: $catalogFeedId) {
id
status
result {
signals {
code
signalMessage {
locale
message
}
impactSummary {
locale
message
}
reactionSummary {
locale
message
}
}
resultReport {
... on UploadedFile {
fileId
}
}
}
}
}
// Query variables
{
catalogFeedId: createCatalogFeedResponseJson.data.createCatalogFeed.id
}
Response for COMPLETED status
{
"data": {
"catalogFeed": {
"id": "example-catalog-feed-id",
"status": "COMPLETED",
"signals": null,
"result": {
"resultReport": {
"fileId": "example-file-id"
}
}
}
}
}
Response for FAILED status
{
"data": {
"catalogFeed": {
"id": "example-id",
"status": "FAILED",
"result": {
"signals": [
{
"code": "MissingRequiredColumn",
"signalMessage": {
"locale": "en",
"message": "Missing required column for External ID."
},
"impactSummary": {
"locale": "en",
"message": "The catalog feed could not be imported."
},
"reactionSummary": {
"locale": "en",
"message": "Ensure that the file you uploaded is a CSV file that uses the correct CSV template. https://amazon-omni-cdn.com/static/catalog/CreateCatalogFeed-template.csv"
}
],
"resultReport": null
}
}
}
}
Get a link to a catalog feed result
To get a link to a catalog feed result, perform a downloadLink
query with the fileId
that you received when you performed a catalogFeed
query in the previous step.
Request
// GraphQL query to get a download link
query DownloadLink($fileId: String!) {
downloadLink(fileId: $fileId) {
downloadUrl
}
}
}
// Query variables
{
fileId: catalogFeedReportResponseJson.data.result.resultReport.fileId
}
Response
{
"data": {
"downloadLink": {
"downloadUrl": "https://example.com/download-url"
}
}
}
Download a catalog feed result file
After you get a link to the catalog feed result, you can download the CSV file by using a standard interface in your chosen programming language. For a description of the fields in the catalog feed result file, see Catalog feed processing result file.
The following example shows how to use the download link to create a stream of the catalog feed result file.
Request
// Using the download link, create a stream of the catalog feed report file
const stream = fs.createWriteStream('./book_library_processing_signals.csv');const { body } = await fetch(catalogFeedReportDownloadLinkResponseJson.data.downloadUrl);await finished(Readable.fromWeb(body).pipe(stream));
Downloaded CSV file
The following example file shows the COMPLETED
, SKIPPED
, and FAILED
statuses that the Catalog feed operation might return.
Import Result,Error Type, Error Code(s),Error Detail(s),External ID,Updated External ID,SKU,Amazon SKU,Offer Prime,Image URL,Product Detail Page URL
SUCCEEDED,,,,externalId,,sku,amazonSku,true,https://example.com/image.jpg,https://example.com/product
SKIPPED,,,,externalId,updatedExternalId,sku,amazonSku,true,https://example.com/image.jpg,https://example.com/product
FAILED,ValidationError,MissingRequiredProductDetailPageUrl,Product detail page URL is required when Is Prime Intended is true.,externalId,updatedExternalId,sku,amazonSku,true,https://example.com/image.xyz,https://example.com/product
Related topics
Updated 6 days ago