etsy

ShopListingInventoryApi

All URIs are relative to https://openapi.etsy.com

Method HTTP request Description
getListingInventory GET /v3/application/listings/{listing_id}/inventory  
updateListingInventory PUT /v3/application/listings/{listing_id}/inventory  

getListingInventory

ListingInventoryWithAssociations getListingInventory(listingId, showDeleted, includes, legacy)

<div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><span class=\"wt-badge wt-badge–notificationPrimary wt-bg-slime-tint wt-mr-xs-2\">General Release</span><a class=\"wt-text-link\" href=\"https://github.com/etsy/open-api/discussions\" target=\"_blank\" rel=\"noopener noreferrer\">Report bug</a></div><div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><p class=\"wt-text-body-01 banner-text\">This endpoint is ready for production use.</p></div> Retrieves the inventory record for a listing. Listings you did not edit using the Etsy.com inventory tools have no inventory records. This endpoint returns SKU data if you are the owner of the inventory records being fetched.

Example

// Import classes:
//import com.etsy.infrastructure.*
//import com.etsy.models.*

val apiInstance = ShopListingInventoryApi()
val listingId : kotlin.Long = 789 // kotlin.Long | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
val showDeleted : kotlin.Boolean = true // kotlin.Boolean | A boolean value for inventory whether to include deleted products and their offerings. Default value is false.
val includes : kotlin.String = includes_example // kotlin.String | An enumerated string that attaches a valid association. Default value is null.
val legacy : kotlin.Boolean = true // kotlin.Boolean | This parameter needed to enable new parameters and response values related to processing profiles.
try {
    val result : ListingInventoryWithAssociations = apiInstance.getListingInventory(listingId, showDeleted, includes, legacy)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling ShopListingInventoryApi#getListingInventory")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling ShopListingInventoryApi#getListingInventory")
    e.printStackTrace()
}

Parameters

| listingId | kotlin.Long| The numeric ID for the listing associated to this transaction. | | | showDeleted | kotlin.Boolean| A boolean value for inventory whether to include deleted products and their offerings. Default value is false. | [optional] | | includes | kotlin.String| An enumerated string that attaches a valid association. Default value is null. | [optional] [enum: Listing] | | Name | Type | Description | Notes | | ————- | ————- | ————- | ————- | | legacy | kotlin.Boolean| This parameter needed to enable new parameters and response values related to processing profiles. | [optional] |

Return type

ListingInventoryWithAssociations

Authorization

Configure api_key: ApiClient.apiKey[“x-api-key”] = “” ApiClient.apiKeyPrefix[“x-api-key”] = “” Configure oauth2: ApiClient.accessToken = “”

HTTP request headers

updateListingInventory

ListingInventory updateListingInventory(listingId, legacy, updateListingInventoryRequest)

<div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><span class=\"wt-badge wt-badge–notificationPrimary wt-bg-slime-tint wt-mr-xs-2\">General Release</span><a class=\"wt-text-link\" href=\"https://github.com/etsy/open-api/discussions\" target=\"blank\" rel=\"noopener noreferrer\">Report bug</a></div><div class=\"wt-display-flex-xs wt-align-items-center wt-mt-xs-2 wt-mb-xs-3\"><p class=\"wt-text-body-01 banner-text\">This endpoint is ready for production use.</p></div> Updates the inventory for a listing identified by a listing ID. The update fails if the supplied values for product sku, offering quantity, and/or price are incompatible with values in `*_on_property*` fields. When setting a price, assign a float equal to amount divided by divisor as specified in the Money resource.

Example

// Import classes:
//import com.etsy.infrastructure.*
//import com.etsy.models.*

val apiInstance = ShopListingInventoryApi()
val listingId : kotlin.Long = 789 // kotlin.Long | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
val legacy : kotlin.Boolean = true // kotlin.Boolean | This parameter needed to enable new parameters and response values related to processing profiles.
val updateListingInventoryRequest : UpdateListingInventoryRequest =  // UpdateListingInventoryRequest | 
try {
    val result : ListingInventory = apiInstance.updateListingInventory(listingId, legacy, updateListingInventoryRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling ShopListingInventoryApi#updateListingInventory")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling ShopListingInventoryApi#updateListingInventory")
    e.printStackTrace()
}

Parameters

| listingId | kotlin.Long| The numeric ID for the listing associated to this transaction. | | | legacy | kotlin.Boolean| This parameter needed to enable new parameters and response values related to processing profiles. | [optional] | | Name | Type | Description | Notes | | ————- | ————- | ————- | ————- | | updateListingInventoryRequest | UpdateListingInventoryRequest| | [optional] |

Return type

ListingInventory

Authorization

Configure api_key: ApiClient.apiKey[“x-api-key”] = “” ApiClient.apiKeyPrefix[“x-api-key”] = “” Configure oauth2: ApiClient.accessToken = “”

HTTP request headers