5

It is not at all clear to me how to update the price/stock for a listing once it has been created initally using listing->createListing().

To update the stock/price, Etsy's documentation says to call listing->updateInventory(). However, this call requires something called products together with a couple of properties (price_on_property, quantity_on_property and sku_on_property):

  • listing_id
  • products*
  • price_on_property
  • quantity_on_property
  • sku_on_property

where:

  • products is further defined in their documentation as a combination of property_values and offerings which I have no clue about.

  • listing_id is returned from the call to createListing() initially.

Etsy's footnote about price_on_property, stock_on_property and sku_on_property adds to the confusion:

price_on_property is an array of the property_ids of the properties which price depends on (if any).

quantity_on_property is an array of the property_ids of the properties which quantity depends on (if any).

sku_on_property is an array of the property_ids of the properties which sku depends on (if any).

The update will fail if the supplied values for product sku and offering quantity and price are incompatible with the supplied values of the "on_property_*" fields.

When supplying a price, supply a float equivalent to amount divided by divisor as specified in the Money resource.

The products parameter should be a JSON array of products, even if you only send a single product. All field names in the JSON blob should be lowercase.

Taken from https://www.etsy.com/developers/documentation/reference/listinginventory#method_updateinventory

Given that the starting point for adding things for sale on Etsy is just to call createListing() with details of the item that I wish to sell (inc stock quantity and price), I do not understand how to call updateInventory() to update the stock and/or price of this item and so can anybody provide some clarity on this matter please (and yes, I have contacted Etsy developer support, but it might take a while for them to respond).

err1
  • 419
  • 6
  • 16

2 Answers2

4

In python - I assume you have the etsy_api module from github.

Etsy product listings have the following structure:

ListingProduct = {
   "price_on_property": [
       property_ids
     ], 
   "products": [
          LIST OF PRODUCT VARIATIONS FOR THIS LIST. IF YOU HAVE NO VARIATIONS
          THEN THIS LIST WILL HAVE ONLY 1 PRODUCT.

     ], 
   "quantity_on_property": [], 
   "sku_on_property": []

}

To update prices, you need to send back this ListingProduct model, but with the changes you want. Note

  • price_on_property is required if you have variations.
  • sku_on_property is optional if you have different skus for different variations.
  • quantity_on_property is optional if you have different quantities on
    variations.

The easiest way I have found is to do the following:

Get the listing_id for the product you want to change price on. Make a call to the inventory URI to get this listing. I'm doing this to avoid having to construct ListingProduct['products']. It has too much going on with it.

 listing_id = 'the product's listing_id'
 ListingProduct = etsy_api.getInventory(listing_id=listing_id)

ListingProduct['products'] is a list of products for this listing. The size of this list is equal to the number of variations that you have. Take ListingProduct['products'] and for each variation change the price.

If you take a look at ListingProduct['products'], you will see that the changes that need to be done are,

ListingProducts['products'][0]['offerings'][0]['price'] = NewPrice

If a listing has 2 variations, then change the price on that too

ListingProducts['products'][1]['offerings'][0]['price'] = OtherNewPrice

Once you do this make a call with the data.

data = {
'listing_id': listing_id
'products': json.dumps(ListingProduct['products'])
'price_on_property': 200   #If you have variation
}

etsy_api.updateInventory(**data)

  • Thank you Duncan for your detailed answer. Though I'm doing this all from C#, I can't verify answers yet because I'm stuck trying get past their authentication process (again from C#) but together with their Support team's response, I'm sure your response will help. Many thanks again. – err1 Aug 07 '17 at 13:24
2

To update the variations for a product in ETSY, you need to use update inventory call from the API (Expecting you are using Etsy module from GitHub). refer to link https://www.etsy.com/developers/documentation/getting_started/inventory

The data you need to send with this call will include --

array (
     products             => json_encode($products),
     price_on_property    =>
     quantity_on_property =>  
)

price_on_property will include the variation property id provided by etsy quantity_on_property will be included in case of more than one variation attribute

The products index will include an array of variations with the details --

[0]  =>  (
          product_id=> 1234,
         property_values" => [
              property_id   => 500,
            property_name => color,
             'values        => [ green ],
         ],
         offerings" => [
             (
                 price => 200
                 quantity => 1,
             )
         )
[1] => and so on...

Property Id will be provided by etsy for variation attributes.

CedCommerce
  • 299
  • 4
  • 10