Cannot update inventory : "Server error"

359 views
Skip to first unread message

Robin M

unread,
Jan 28, 2018, 11:26:02 AM1/28/18
to Etsy API
Hi,

I'm able to successfully create draft listings, and even set the inventory on them, but after they're published, getting the inventory, adjusting the quantity and then trying to edit it, results in either the error "Server error". Here's a walk through example of what I'm trying.

1. Create draft product with a default of 1 item (no variations) using the createlisting method.
2. Set inventory, pushing the following JSON (I construct this based off https://www.etsy.com/developers/documentation/getting_started/inventory#section_creating_a_complex_listing_with_two_variations)

{
   
"products":  [
                     
{
                         
"property_values":  [
                                                 
{
                                                     
"property_id":  "52047899294",
                                                     
"property_name":  "Size",
                                                     
"values":  "S",
                                                     
"scale_id":  26
                                                 
}
                                             
],
                         
"sku":  "",
                         
"offerings":  [
                                           
{
                                               
"price":  28,
                                               
"quantity":  6,
                                               
"is_enabled":  1
                                           
}
                                       
]
                     
},
                     
{
                         
"property_values":  [
                                                 
{
                                                     
"property_id":  "52047899294",
                                                     
"property_name":  "Size",
                                                     
"values":  "M",
                                                     
"scale_id":  26
                                                 
}
                                             
],
                         
"sku":  "",
                         
"offerings":  [
                                           
{
                                               
"price":  28,
                                               
"quantity":  6,
                                               
"is_enabled":  1
                                           
}
                                       
]
                     
},
                     
{
                         
"property_values":  [
                                                 
{
                                                     
"property_id":  "52047899294",
                                                     
"property_name":  "Size",
                                                     
"values":  "L",
                                                     
"scale_id":  26
                                                 
}
                                             
],
                         
"sku":  "",
                         
"offerings":  [
                                           
{
                                               
"price":  28,
                                               
"quantity":  5,
                                               
"is_enabled":  1
                                           
}
                                       
]
                     
}
                 
],
   
"quantity_on_property":  [
                                 
"52047899294"
                             
],
   
"price_on_property":  [
                             
"52047899294"
                         
]
}

3. Etsy won't return data for draft products, so I manually confirm this has worked, update anything else I haven't figured out how to do with the API, then publish the item.
4. Get the inventory data for the same product. It returns JSON akin to this, which as you can notice, is quite different from the JSON I sent originally. I guess Etsy adds a bunch more stuff when publishing.

{
   
"products":  [
                     
{
                         
"product_id":  2015633571,
                         
"sku":  "",
                         
"property_values":  [
                                                 
{
                                                     
"property_id":  52047899294,
                                                     
"property_name":  "Size",
                                                     
"scale_id":  26,
                                                     
"scale_name":  "UK",
                                                     
"value_ids":  [
                                                                       
52637354132
                                                                   
],
                                                     
"values":  [
                                                                   
"S"
                                                               
]
                                                 
}
                                             
],
                         
"offerings":  [
                                           
{
                                               
"offering_id":  2231745990,
                                               
"price":  {
                                                             
"amount":  2800,
                                                             
"divisor":  100,
                                                             
"currency_code":  "GBP",
                                                             
"currency_formatted_short":  "?28.00",
                                                             
"currency_formatted_long":  "?28.00 GBP",
                                                             
"currency_formatted_raw":  "28.00"
                                                         
},
                                               
"quantity":  6,
                                               
"is_enabled":  1,
                                               
"is_deleted":  0
                                           
}
                                       
],
                         
"is_deleted":  0
                     
},
                     
{
                         
"product_id":  2267913728,
                         
"sku":  "",
                         
"property_values":  [
                                                 
{
                                                     
"property_id":  52047899294,
                                                     
"property_name":  "Size",
                                                     
"scale_id":  26,
                                                     
"scale_name":  "UK",
                                                     
"value_ids":  [
                                                                       
54743434201
                                                                   
],
                                                     
"values":  [
                                                                   
"M"
                                                               
]
                                                 
}
                                             
],
                         
"offerings":  [
                                           
{
                                               
"offering_id":  2231745992,
                                               
"price":  {
                                                             
"amount":  2800,
                                                             
"divisor":  100,
                                                             
"currency_code":  "GBP",
                                                             
"currency_formatted_short":  "?28.00",
                                                             
"currency_formatted_long":  "?28.00 GBP",
                                                             
"currency_formatted_raw":  "28.00"
                                                         
},
                                               
"quantity":  6,
                                               
"is_enabled":  1,
                                               
"is_deleted":  0
                                           
}
                                       
],
                         
"is_deleted":  0
                     
},
                     
{
                         
"product_id":  2015633573,
                         
"sku":  "",
                         
"property_values":  [
                                                 
{
                                                     
"property_id":  52047899294,
                                                     
"property_name":  "Size",
                                                     
"scale_id":  26,
                                                     
"scale_name":  "UK",
                                                     
"value_ids":  [
                                                                       
53637087616
                                                                   
],
                                                     
"values":  [
                                                                   
"L"
                                                               
]
                                                 
}
                                             
],
                         
"offerings":  [
                                           
{
                                               
"offering_id":  2123354799,
                                               
"price":  {
                                                             
"amount":  2800,
                                                             
"divisor":  100,
                                                             
"currency_code":  "GBP",
                                                             
"currency_formatted_short":  "?28.00",
                                                             
"currency_formatted_long":  "?28.00 GBP",
                                                             
"currency_formatted_raw":  "28.00"
                                                         
},
                                               
"quantity":  4,
                                               
"is_enabled":  1,
                                               
"is_deleted":  0
                                           
}
                                       
],
                         
"is_deleted":  0
                     
}
                 
],
   
"price_on_property":  [
                             
52047899294
                         
],
   
"quantity_on_property":  [
                                 
52047899294
                             
],
   
"sku_on_property":  [

                       
]
}

5. I then modify the 'quantity' property and try to resend the data. If I don't compress the JSON (minify it) I get "Error: URI Too Long". If I do compress it, I just get 'Server Error'.

If I try to just set the inventory using the method I use originally (i.e. with that slimmed down JSON) it says 'quantity must be consistent across all products'.

I don't know how to troubleshoot this, because the examples use some framework I don't.

I guess I'll check back here in 3 days to see if this post has been approved.

Rob



david olick

unread,
Jan 31, 2018, 7:00:44 PM1/31/18
to Etsy API V2
The 'Server Error' typically means that there's something wrong with what you sent Etsy.  It's an error they didn't catch and haven't bothered updating the API to check for.

What's the exact data you are sending and at what API endpoint?

--
You received this message because you are subscribed to the Google Groups "Etsy API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etsy-api-v2+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oguzhan Topcu

unread,
Mar 25, 2018, 3:13:25 PM3/25/18
to Etsy API
Hi Robin, 

Did you find a solution?

mic...@shineweddinginvitations.com

unread,
May 14, 2018, 12:49:29 PM5/14/18
to Etsy API
I am also having this issue. 

mic...@shineweddinginvitations.com

unread,
May 22, 2018, 4:45:45 PM5/22/18
to Etsy API
I'll reply to this with what I'm doing that's producing the same issue. 

{
"quantity": 1,
    "title": "Test Custom Order",
    "description": "some description",
    "price": 0.99,
    "state": "active",
    "who_made": "i_did",
    "when_made": "made_to_order",
    "is_supply": false,
    "is_private": true,
    "shipping_template_id": 164649096
}

The item gets created in my Listings, but again "Server Error" is all I receive. I have submitted a bug ticket to Etsy but have not heard back from a human. 

For posterity I will note that the documentation says shipping_template_id is NOT required, but when this JSON is POSTed to https://openapi.etsy.com/v2/listings without shipping_template_id, the response is "A shipping_template_id is required".
To unsubscribe from this group and stop receiving emails from it, send an email to etsy-api-v2...@googlegroups.com.

A Whites

unread,
Aug 12, 2021, 9:13:40 AM8/12/21
to Etsy API
I know this has been awhile but I just found this group. Has anyone found the answer to the URI is too long error? I am getting the same error using updateinventory method with Python when I have more than about 20 SKUs.

Thank you 
Allen
Reply all
Reply to author
Forward
0 new messages