Listings API putListingsItem How To Update price and quantity?

See original GitHub issue

All I want to do is use the Amazon SP-API Listings API’s putListingsItem call to update the price and quantity of an item I have listed.

productType

According to the ListingsItemPutRequest docs, productType and attributes are required for this call.

Firstly, to obtain the correct productType value, you are supposed to search for a product definitions type using the Product Type Definitions API. So, I do that, and call searchDefinitionsProductTypes, just to discover my product has no matching product type.

Ultimately, I gave the value PRODUCT for productType field. Using PRODUCT, I made the getDefinitionsProductType call and got an object containing an array of propertyNames, shown below:

        "propertyNames": [
            "skip_offer",
            "fulfillment_availability",
            "map_policy",
            "purchasable_offer",
            "condition_type",
            "condition_note",
            "list_price",
            "product_tax_code",
            "merchant_release_date",
            "merchant_shipping_group",
            "max_order_quantity",
            "gift_options",
            "main_offer_image_locator",
            "other_offer_image_locator_1",
            "other_offer_image_locator_2",
            "other_offer_image_locator_3",
            "other_offer_image_locator_4",
            "other_offer_image_locator_5"
        ]
    },

On seeing this, I decide list_price and fulfillment_availability must be the price and quantity and then try using these in my code below.

attributes

The attributes value is also required. However, their current docs show no clear example of what to put for these values, which are where I must put price and quantity somewhere.

I found this link about patchListingsItem and tried to implement that below but got an error.

code:

// trying to update quantity… failed.

    a.response =  await a.sellingPartner.callAPI({
        operation:'putListingsItem',
        path:{
          sellerId: process.env.SELLER_ID,
          sku: `XXXXXXXXXXXX`
        },
        query: {
          marketplaceIds: [ `ATVPDKIKX0DER` ]
        },
        body: {
          "productType": `PRODUCT`
          "requirements": "LISTING_OFFER_ONLY",
          "attributes": {
                "fulfillment_availability": {
                    "fulfillment_channel_code": "AMAZON_NA",
                            "quantity": 4,
                            "marketplace_id": "ATVPDKIKX0DER"
                        }
                    }
      });

    console.log( `a.response: `, a.response )

error:

{
	"sku": "XXXXXXXXXXXX",
	"status": "INVALID",
	"submissionId": "34e1XXXXXXXXXXXXXXXXXXXX",
	"issues": [{
		"code": "4000001",
		"message": "The provided value for 'fulfillment_availability' is invalid.",
		"severity": "ERROR",
		"attributeName": "fulfillment_availability"
	}]
}

I also tried using list_price :

// list_price attempt… failed.

    a.response =  await a.sellingPartner.callAPI({
        operation:'putListingsItem',
        path:{
          sellerId: process.env.SELLER_ID,
          sku: `XXXXXXXXXXXX`
        },
        query: {
          marketplaceIds: [ `ATVPDKIKX0DER` ]
        },
        body: {
          "productType": `PRODUCT`
          "requirements": "LISTING_OFFER_ONLY",
          "attributes": {
                "list_price": {
                    "Amount": 90,
                    "CurrencyCode": "USD"
                }
      });

    console.log( `a.response: `, a.response )

Error (this time seems I got warmer… maybe?):


{
	"sku": "XXXXXXXXXXXX",
	"status": "INVALID",
	"submissionId": "34e1XXXXXXXXXXXXXXXXXXXX",
	"issues": [{
		"code": "4000001",
		"message": "The provided value for 'list_price' is invalid.",
		"severity": "ERROR",
		"attributeName": "list_price"
	}]
}

How do you correctly specify the list_price or the quantity so this call will be successful?

Just tryin to update a single item’s price and quantity.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
amz-toolscommented, Apr 12, 2022

Yes, you should be able to do so with POST_FLAT_FILE_INVLOADER_DATA. Alternatively this should also be possible with putListingsItem or with the JSON_LISTINGS_FEED, which is actually the same data format as putListingsItem, but uploaded as a feed.

0reactions
amz-toolscommented, Apr 13, 2022

@doverradio,

great! Yes, we will put this on our list to cover some examples of the most common use cases in the nearer future in the README.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Listings API putListingsItem How To Update price ... - GitHub
All I want to do is use the Amazon SP-API Listings API's putListingsItem call to update the price and quantity of an item...
Read more >
Amazon SP-API Listings API putListingsItem How To Update ...
All I want to do is use the Amazon SP-API Listings API's putListingsItem call to update the price and quantity of an item...
Read more >
Manage your product listings lifecycle with Selling Partner API
putListingsItem allows you to create a given SKU and update attributes like price, inventory, or both. patchListingsItem allows you to update ...
Read more >
Correct way of updating Product Price and QTY
I want to change the listing Price and Qty for a product using the bulkUpdatePriceQuantity API. I'm not sure what the offer does...
Read more >
Using selling partner api to add product to Amazon - Forums
Hello Amazon,. I want to add product to Amazon using API. I find 2 ways to do this. First way: I use this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found