Create and Manage Products in a Catalog
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.
You use the Buy with Prime Catalog interface to create, update, and delete products in your Buy with Prime catalog.
For an overview of catalog terminology, see Catalog Interface. 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 = {
externalId: "external-listing-id",
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"
};
Create a product
You can use the createProduct
mutation to create a product within your Buy with Prime catalog.
Request
// GraphQL mutation
mutation CreateProduct {
createProduct(input: $input) {
id
}
}
// Input Variables
{
input: {
externalId: inSearchOfLostTime.externalId
amazonSku: {
value: inSearchOfLostTime.amazonSku
}
sku: inSearchOfLostTime.sku
offerPrime: true
productDetailPageUrl: inSearchOfLostTime.detailPageUrl
image: {
sourceUrl: inSearchOfLostTime.imageUrl
altText: inSearchOfLostTime.imageAltText
}
}
}
Response
{
"data": {
"createProduct": {
"id": "example-buy-with-prime-product-id"
}
}
}
Update multiple fields of a product
You can use the updateProduct
mutation to update a product in your Buy with Prime catalog. You can use any of the four product identifiers (product ID, external ID, SKU, or Amazon SKU) to identify the product. However, we recommend that you use your own identifiers, such as the SKU and external ID, when you call the Buy with Prime API.
The updateProduct
mutation enables you to choose the specific attributes you want to update.
The following example, which uses the external ID as the product identifier, updates multiple fields of a product in your Buy with Prime catalog.
Request
// GraphQL mutation
mutation UpdateProduct{
updateProduct(identifier: $identifier, input: $input) {
id
}
}
// Input Variables
{
identifier: {
externalId: inSearchOfLostTime.externalId
},
input: {
externalId: inSearchOfLostTime.externalId,
sku: inSearchOfLostTime.sku,
amazonSku: {
value: inSearchOfLostTime.amazonSku
},
offerPrime: true,
productDetailPageUrl: inSearchOfLostTime.detailPageUrl,
image: {
sourceUrl: inSearchOfLostTime.imageUrl,
altText: inSearchOfLostTime.imageAltText
}
}
}
Response
{
"data": {
"updateProduct": {
"id": "example-buy-with-prime-product-id"
}
}
}
Update a product to offer Buy with Prime
The following example updates only the "Offer Buy with Prime" field of the product identified by a certain external ID.
Request
// Graph QL mutation
mutation UpdateProduct{
updateProduct(identifier: $identifier, input: $input) {
id
}
}
// Input Variables
{
identifier: {
externalId: inSearchOfLostTime.externalId
},
input: {
offerPrime: true
}
}
Response
{
"data": {
"updateProduct": {
"id": "example-buy-with-prime-product-id"
}
}
}
Delete a product
You can use the deleteProduct
mutation to delete a product from your Buy with Prime catalog. The deleted product is not recoverable.
You can use any of the four product identifiers (product ID, external ID, SKU, or Amazon SKU) to identify the product. However, we recommend that you use your own identifiers, such as the SKU and external ID, when you call the Buy with Prime API.
The following example, which uses the external ID as the product identifier, deletes a product from your Buy with Prime catalog.
Request
// GraphQL mutation
mutation DeleteProduct{
deleteProduct(identifier: $identifier) {
id
}
}
// Input Variables
{
"identifier": {
"externalId": inSearchOfLostTime.externalId
}
}
Response
{
"data": {
"deleteProduct": {
"id": "example-buy-with-prime-product-id"
}
}
}
Related topics
Updated 23 days ago