- Replace inventory (
PUT /v1/workspace/listings/{id}/inventory) sends the whole inventory. - Patch offerings (
PATCH /v1/workspace/listings/{id}/inventory) changes a few variants and leaves the rest as Etsy holds them.
PATCH /v1/workspace/listings/{id}) already sets its price, quantity and SKU. With apply_to: "all_variants" it also sets one price or quantity on every variant at once, over REST and with update_my_listing in an AI assistant. A write is charged only when it lands on Etsy, and dry_run=true shows the planned write for free. See API credits.
Replace the whole inventory
Replace inventory works like Etsy’s own inventory write: it replaces everything. A product you leave out is removed from the listing, and so is aprice_on_property, quantity_on_property, sku_on_property or processing_profile_on_property you leave out. Read the current inventory first with GET /v1/workspace/listings/{id}?expand=inventory, change it, and send all of it back: per product its sku and property_values (property_id, property_name, values, and value_ids and scale_id when set), per offering its price (the amount string), quantity, is_enabled and processing_profile_id, and the four *_on_property lists. Leave out the ids: Etsy issues new ones.
This replaces a mug’s inventory with two sizes, each with its own price, stock and SKU:
- Add a variation value by adding its products; remove one by leaving its products out. Going back to a single product (
"property_values": []) removes the variations. Removing a value or a variation removes its variation images on Etsy too, and a revert doesn’t bring them back. - Every offering of a physical listing needs a
processing_profile_id. Without one the call is 400 before anything is sent. property_idis a category property (GET /v1/etsy/categories/{id}/properties), or 513 and 514 for your shop’s own variations.
Change single variants
A patch names each variant by its property values, inselect, and sends only what changes. This sets the price of a mug’s black variant (its price varies by color, so price_on_property already names the color property):
- Alura reads the inventory on Etsy right before the write and applies your patch to that, never to its own copy. An edit you made on Etsy since Alura’s last sync is kept.
- A value that differs between variants needs its property in
*_on_property. To give one variant its own price, the property it varies by must be inprice_on_property(the same for quantity, SKU and processing profile); change that with Replace. - A selector must pick exactly one product. Names and values ignore case and surrounding spaces. Naming one property is enough when its value is unique (
{"Size": "A3"}on a listing with one A3). A selector that picks no product, more than one, or a product another entry already picked is 400 and names the entry, for exampleinventory_selector_no_match, offerings.1. Nothing is sent. {}picks the only product of a listing without variations.
Address variants by their values, not IDs
Etsy can issue new product and offering IDs whenever the inventory is written, by anyone, and does whenever variants are added or removed. Each write’s answer carries the current IDs, but don’t keep them to address a variant later. Select variants by their property values, which stay the same across writes.Retries, concurrency and reverts
- Only one inventory write runs per listing at a time. A second one while the first runs is
409 listing_busywithRetry-After; retry after it. - A write can answer 202. When Etsy is slow to answer, or Alura can’t tell yet whether the write landed, the answer is
202with the change instead of the inventory. Poll the change atLocation(GET /v1/workspace/changes/{id}) until itsoutcomeis known, and don’t send the write again. A retry with the sameIdempotency-Keyanswers from the first write and never writes twice, so send one with every write, as the examples do. - Revert a change (
POST /v1/workspace/changes/{id}/revert) restores an inventory change’s prices, SKUs and enabled flags. It never restores quantities: the variants keep the quantities Etsy holds now, because restoring an old quantity could sell stock you no longer have.not_revertednames the inventory’s quantity. A change that added or removed variants is not revertable (variations_changed).