open-api
open-api copied to clipboard
[ENDPOINT] Proposed design change for getListingInventory
Current Endpoint Design There is no way to just fetch all listings and all of products associated with it including the SKUs that are under the listing. Most omni channel sellers use SKUs as unique identifiers yet Etsy doesn't have an endpoint to fetch SKUs on a listing or product other than "getListingProduct" or the "getListingInventory" endpoints. This requires developers to make unique calls for each listing to get a "sku". Additionally, there doesn't seem to be a way to fetch all listings and it's constituent products regardless of active or inactive status.
Proposed Endpoint Design Change Create an endpoint that returns ALL listings, the SKUs under the listings, and the quantities for each SKU under the listing.
Why are you proposing this change? Because it is freaking obvious.
Please provide a reason for the change you're proposing. Our use cases are as follows:
- We want to import all Etsy Products into our applications to map them to "master products" that already exist in the application. We want to import all of the SKUs from the Etsy products as well so that we can map accordingly.
- We then want to fetch all orders and calculate the cost of goods sold on the orders based on the master product's cost (which is inherited by the Etsy product).
Problems we're experiencing:
- There doesn't seem to be one endpoint in the V3 API that gets us all of the inventory (active and inactive), nor are we able to get the SKU returned on all inventory as well. The shops we work with do have a SKU entered into Etsy but this variable seems to only be available using the "getListingProduct" or the "getListingInventory" endpoints that can only be called on one product at a time.
- There doesn't seem to be a way to get inactive inventory. This presents a problem because there are likely transactions that we pull that do not "map" to any inventory that is currently active (because the product went out of stock for instance). This would force us to keep track of non-existing Etsy inventory through orders that come in and fetch the inventory details from using the "getListingInventory" endpoint from orders of Etsy products that were not initially fetched during onboarding.
Our first proposed solution is:
- Get all active listings using the findAllActiveListingsByShop
- Make a getListingInventory on each "listing_id" that is returned
- Save the inventory items with the SKUs.
- Save the receipts and then create Etsy inventory items on the missing Etsy products from the findAllActiveListingsByShop Too many calls We don't have a complete list of inventory (only active)
Our second proposed solution is:
- getShopReceiptTransactions and grab the listing_id and product_id from the receipts
- getListingInventory (listing_id) → Grab the listing data and the SKU
- Save the relevant listing data and create Etsy inventory items as the orders are saved.
Too many calls We will not save inventory that is inactive or active that had no sales
@bitcoinbullbullbull We are working on exposing the SKUs on the various listing endpoints, but the main thing to know is that this will only be visible if the shop owner is the user that is requesting this information via your app. So, for instance you wouldn't be able to see the SKU if you had a global account call or were using a token generated for the creator of the app. But if your app requests a token for a shop that has added your app, then that data will be available to you (once we have completed this work).
Thanks for the response. So as I understand it, as long as the seller authorizes our application we would have access to their SKU. I'm assuming that the SKUs would be available on the listing endpoints that pull all of the listings for instance, this would solve the problem for us I suppose. Do you have any time table for this?
Yes. The seller can authorize your app but it has to be done I believe when the app is added (or you force it by not having a valid token for the user anymore) because you have to request the scope of listings_r
(https://developer.etsy.com/documentation/essentials/authentication#scopes) and once they approve you go through the authorization grant process which will give you the token for that user. It will also give you the refresh token that you can use to re-fetch a new token for that user once the previous token has expired.
Thank you for the detail. Can you share when you anticipate this might be rolled out into the API? I would prefer waiting if that is feasible.
We don't have a specific timeline but we are working on it.
Is there any update on this?
We don't have a specific timeline but we are working on it.
It looks like getListingsByShop response contains a property with array of SKUs called skus Did you check this API's actual result?
We need the SKUs exposed, it is incredible costly to have to make individual getListing calls just to get one attribute that should be exposed on getListingsByShop
@jakeleventhal the skus are included as an array on the getListingsByShop endpoint but only if the user querying the endpoint is the listing owner. The skus are for the owners only so we won't be making them available to buyers etc.
@jakeleventhal the skus are included as an array on the getListingsByShop endpoint but only if the user querying the endpoint is the listing owner. The skus are for the owners only so we won't be making them available to buyers etc.
If an Etsy listing owner has authenticated it's account with a third-party Etsy application does that third-party application have the ability to query the SKUs? I'm assuming you mean the listing owner indirectly and not in the general sense?
yes correct. If you have a user that's browsing listings and sees someone else's shop and your app queries getListingsByShop it won't include the SKUs. But if the listing owner is managing their own listings the skus will be returned.
@bitcoinbullbullbull I'm going back through the tickets. Where are you at with this. Has adding the skus helped in mitigating the prolong process you've had to work with?
One thing I realized I hadn't addressed is the inactive inventory. For each shop managed by your users, you can do (getListingsByShop
)[https://developers.etsy.com/documentation/reference#operation/getListingsByShop] and pass in the state for "sold_out", "inactive", "expired". You could also do "draft" if you want listings that haven't been published.
Sorry I didn't catch that one before.
Please also see https://github.com/etsy/open-api/issues/120 as this is directly related to listing inventory and SKU issues
@cal-tec I haven't tested this yet as I've deprioritized this Etsy integration until there was a fix. I have on my todo this week to check out the update @etsyachristensen mentions above. From what I understand, the getListingsByShop now exposes the SKU (even though this is not reflected in the documentation). I will follow up with this this week to verify that this is the case.
@etsyachristensen - Can you clarify how the API functions when you use the state param?
Do these two API endpoints do the same thing?
/v3/application/shops/{shop_id}/listings?state=active
/v3/application/shops/{shop_id}/listings/active
And to be extra clear, this alternative API endpoint doesn't exist and wont work, correct?
/v3/application/shops/{shop_id}/listings/inactive
Does the optional state parameter also work for shop sections?
/v3/application/shops/{shop_id}/shop-sections/listings?state=active
/v3/application/shops/{shop_id}/shop-sections/listings?state=inactive
@etsyachristensen is there a way to pass in multiple states at once?
@etsyachristensen it appears that this does work now, but looking forward to when I don’t need to pass in the sold_out, inactive, and expired types