read_products to read, write_products to change (it includes read_products). The same scopes cover categories.
The product
Apps never see the product’s cost, its pixel price and ad pixels, the cloaking and fake stock settings, the landing page sections, the drop-shipping settings, the custom currency, a digital product’s codes and links, or whether the product waits for a content review. Reviews have their own endpoints.
Lists and joins
List products leaves out each product’sdescription: read it with Get a product. Both take join, comma-separated:
optionsaddsoptions,variantsaddsvariants,categoriesaddscategory_ids.
HTML descriptions
description is HTML. Before it is saved, it is cleaned to a fixed list, and the cleaned HTML is what the product answers and the storefront shows. Anything else is removed, keeping its text; script and style go with their content.
So
style attributes, event handlers, forms, other iframes, relative URLs and data: images are all removed. Invalid UTF-8 or a NUL character is refused (422, rule text). The description has no limit of its own, only the product’s 50 KB.
Options and variants
Options are what the shopper picks, such as size or color: up to 3, each with 1 to 100 values. An option’stype says how the storefront draws its values: button (a label), color (a #rgb or #rrggbb color) or image (an https image URL).
Variants are the combinations, each with its own price and stock: up to 100. A variant’s options names one value of every option, by name, and no two variants name the same values:
optionsreplaces every option of the product, and must come withvariantsin the same request. Variants sent alone are checked against the product’s current options.variantslists every variant the product keeps, matched byid:- a variant with an
idis updated in place and keeps its ID, which orders point at; - a variant without an
idis created; - a variant you leave out is deleted. One that an order’s cart item points at is only unlinked from the product, so the order still reads it.
- a variant with an
- Each variant and option is sent whole: a field you leave out takes its empty value (
0,"",false), not the current one. - An
idthat is not one of the product’s variants is refused (422, rulevariant). On create, send noid.
images and category_ids also replace the product’s whole list. category_ids takes up to 50 categories of the store.
Stock
quantity is the product’s stock; each variant has its own. Set it with quantity in a PATCH, or add and take away with Adjust stock, which changes it in one step so adjustments that meet are all counted. Stock stays from 0 to 1,000,000,000.
Size
A product is limited to keep the storefront fast:
Numbers and flags don’t count toward the product’s size. A product made larger than 50 KB in the dashboard can still be changed, as long as your change does not make it larger.
Creating products
name,priceandthumbare required. Without aslug, one is made from the name.- A store with unpaid dues cannot get new products:
402 store_overdue. - Each product created charges the store its import fee, as importing products from the dashboard does.
source_appis set to your app’s name.
Content review
The name, description and meta description of a product go through the same automatic content review as the dashboard’s, on create and on every change to them. Content it flags goes to EasyOrders’ review team. The write still succeeds, and the flag is not part of the API: your app cannot read it or clear it. Content is also flagged when the review fails, and without a review past its budget: 20 reviews a minute per store, and 200 a minute per app across its stores, shared with pages and articles.Digital products
is_digital: true products are sold as codes or links (digital_type). Apps cannot create one, and their codes and links are never shown. An app can change their other fields, but:
- a digital product has no options or variants (
422, ruledigital); - the stock of one sold as
codeis the number of codes left, soquantity,track_stockanddisable_orders_for_no_stockcannot change (422, ruledigital), and its stock cannot be adjusted (409 stock_follows_codes).
Deleting
Delete a product removes it from lists and reads (404). It cannot be restored through the API.
Changes and events
The storefront shows a change right away. Creating, changing, adjusting and deleting a product send theproducts/created, products/updated and products/deleted events; a PATCH that changes nothing sends none.