Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions etsy_python/v3/enums/ListingInventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@

class Includes(Enum):
LISTING = "listing"


class MaxVariationsSupported(Enum):
TWO = "2"
THREE = "3"
16 changes: 10 additions & 6 deletions etsy_python/v3/models/Listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ def __init__(
]):
warnings.warn(
"personalization_is_required, personalization_char_count_max, and "
"personalization_instructions are deprecated and will be removed "
"from the Etsy API on April 9, 2026. Use the personalization "
"endpoint (update_listing_personalization) instead.",
"personalization_instructions are deprecated by the Etsy API and "
"scheduled for removal. Use the personalization endpoint "
"(update_listing_personalization) instead. See "
"https://developers.etsy.com/documentation/tutorials/personalization-migration "
"for migration details.",
DeprecationWarning,
stacklevel=2,
)
Expand Down Expand Up @@ -212,9 +214,11 @@ def __init__(
]):
warnings.warn(
"personalization_is_required, personalization_char_count_max, and "
"personalization_instructions are deprecated and will be removed "
"from the Etsy API on April 9, 2026. Use the personalization "
"endpoint (update_listing_personalization) instead.",
"personalization_instructions are deprecated by the Etsy API and "
"scheduled for removal. Use the personalization endpoint "
"(update_listing_personalization) instead. See "
"https://developers.etsy.com/documentation/tutorials/personalization-migration "
"for migration details.",
DeprecationWarning,
stacklevel=2,
)
Expand Down
10 changes: 9 additions & 1 deletion etsy_python/v3/resources/ListingInventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from etsy_python.v3.exceptions.RequestException import RequestException
from etsy_python.v3.enums.Listing import InventoryIncludes
from etsy_python.v3.enums.ListingInventory import MaxVariationsSupported
from etsy_python.v3.models.Listing import UpdateListingInventoryRequest
from etsy_python.v3.resources.Session import EtsyClient
from etsy_python.v3.resources.enums.Request import Method
Expand Down Expand Up @@ -31,9 +32,16 @@ def get_listing_inventory(
def update_listing_inventory(
self, listing_id: int, listing_inventory: UpdateListingInventoryRequest,
legacy: Optional[bool] = None,
max_variations_supported: Optional[MaxVariationsSupported] = None,
) -> Union[Response, RequestException]:
endpoint = f"/listings/{listing_id}/inventory"
query_params: Dict[str, Any] = {
"legacy": legacy,
"max_variations_supported": max_variations_supported.value
if max_variations_supported is not None
else None,
}
return self.session.make_request(
endpoint, method=Method.PUT, payload=listing_inventory,
query_params={"legacy": legacy},
query_params=query_params,
)
Loading
Loading