Store products overview

How a store product, with its variants and stock, is synced to Localoy and sold.

A store product is something you sell through your Localoy store, with optional variants (such as size and colour) and stock per combination. Set the store up once in the Partner Portal; until then a write answers 409 store_not_set_up.

OperationEndpointScope
Create or replacePUT /store/products/:externalIdREGISTRATION
List and retrieveGET /store/productsREGISTRATION
Publish, unpublish, deletePOST …/publishUPDATE

The flow#

A store product, from draft to sale
A store product, from draft to saleYour serverLocaloyCustomer1. POST /media { url }2. 201 { url: Localoy's copy }3. PUT /store/products/pj-set4. 201 draft, every variant combination5. POST …/pj-set/publish6. The product appears in your store7. Order Size M, White8. Inventory check, if enabled9. Order placedWhen stock changes10. PUT with the new stock11. 200 counts updated
  1. Your server → Localoy: POST /media { url }
  2. Localoy → Your server: 201 { url: Localoy's copy }
  3. Your server → Localoy: PUT /store/products/pj-set
  4. Localoy → Your server: 201 draft, every variant combination
  5. Your server → Localoy: POST …/pj-set/publish
  6. Localoy → Customer: The product appears in your store
  7. Customer → Localoy: Order Size M, White
  8. Localoy → Your server: Inventory check, if enabled
  9. Localoy → Customer: Order placed
  10. — When stock changes —
  11. Your server → Localoy: PUT with the new stock
  12. Localoy → Your server: 200 counts updated
  1. Import images, then PUT the whole product. The first PUT creates a draft (201); later ones replace it (200).
  2. Variants expand to combinations. Two sections of two options give four combinations, each returned with its own stock, price and sku.
  3. stock is the one field you may leave out. Leave it out and the counts stay as they are. A combination with no stock row is not counted and never sells out; once any row is counted, a combination without one counts as zero.
  4. Publish it to show it. A PUT never changes whether a product is published.
  5. Customers order it. With inventory checks on, Localoy asks your system (module=store_order) before accepting. A paid-online order holds its stock for your hold time.

Rules to remember#

  • Variant rules are checked on every PUT: variants_too_few_options, variants_option_repeated, variants_name_repeated, and stock rows that name a combination the product does not have (stock_combination_invalid) or name one twice (stock_combination_duplicate).
  • Two simultaneous writes of a new externalId give one 201 and one 409 resource_busy.
  • A sandbox key validates everything and changes nothing ("dryRun": true).
  • A Technology Provider needs the Store module.

Guide: Sync your listings.