Skip to main content

Stores and inventory

Tell GoWit where each product is sold, at what price and with how much stock. Ads then only show what a shopper can actually buy.

You need this when one product can be sold at several places at once: a multi-store retailer, quick commerce with dark stores, store pickup, or local pricing. A retailer with one store and one price per product can skip it: the product's own price and stock are enough.

Two entities carry it, and both are optional:

  • Stores (locations): the places a shopper buys from, each with your store code.
  • Inventory: price and stock rows, one per product per store, or one general row per product.

Three ways to send price and stock​

WayWhat you sendBest when
On the productprice and stock on each productOne price and one stock per product
Per store, inside the productstock_levels on each product: [{location_id, price, stock}]Store data changes with the product, in one push
Dedicated inventoryInventory rows of their own, by feed or pushStock moves faster than the catalog, or comes from another system
One owner

Once your market has an inventory source, it owns price and stock. The price and stock on products are then kept as catalog information only, so two systems never fight over the same number.

Stores​

A store is a place a shopper buys from: a store, a dark store, a restaurant, a kiosk or a warehouse. Each needs your store code (external_id), which never changes, and a status. Everything else is optional.

FieldTypeRequiredDescription
external_idstringYesYour store code. It is what inventory rows, stock_levels and ad requests name the store by. It never changes: a re-coded store is a new store.
statusstringNoWhether the store is trading. An inactive store sells nothing, so its products are not advertised there. open/closed, enabled/disabled and true/false are read too; any other word refuses the row. One of active, inactive. Default active.
namestringNoStore name shown in the console and to advertisers.
kindstringNoWhat kind of place it is. Common synonyms (supermarket, hub, depot…) are recognised; an unknown word is stored as other. One of store, dark_store, restaurant, kiosk, warehouse, other. Default store.
seller_refstringNoThe seller code of the merchant that runs the store, the same code products carry as seller_ref. Two stores of one merchant are two stores.
citystringNoCity.
country_codestringNoCountry, e.g. AE.
latitudenumberNoLatitude of the store.
longitudenumberNoLongitude of the store.
service_area_radius_mnumberNoDelivery radius around the store, in metres. A feed in kilometres is converted in the source mapping.
destination_urlurlNoThe store page on your site, where a click on a store ad goes.

Send stores by feed or by push:

curl --request POST 'https://xxx.edge-stage.gowit.app/api/v1/ingest/locations' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"locations": [
{
"external_id": "STORE-012",
"name": "Downtown Market",
"kind": "store",
"status": "active",
"city": "Dubai",
"country_code": "AE",
"latitude": 25.2048,
"longitude": 55.2708,
"timezone": "Asia/Dubai"
},
{
"external_id": "DS-07",
"name": "Marina dark store",
"kind": "dark_store",
"service_area_radius_m": 3000,
"latitude": 25.08,
"longitude": 55.14
}
]
}'

A snapshot feed that stops naming a store makes it inactive, never deleted, and an inactive store sells nothing.

Inventory rows​

An inventory row names a product by its id and, optionally, a store by its code. A row without a store code is the product's general row: the price and stock that apply wherever a store has none of its own.

FieldTypeRequiredDescription
product_external_idstringYesThe product id from your catalog. A row whose product has not arrived yet is kept and attaches as soon as the product lands.
location_refstringNoYour store code. Leave it empty for the product’s general row: the price and stock that apply wherever a store has none of its own. A code for a store that has not arrived yet is kept and attaches when it does.
product_seller_refstringNoA seller code, when the price and stock are one seller’s offer of the product. Leave it empty and the row is the product’s, read by every seller that sends no row of its own.
pricenumberNoPrice at this store. Absent means the catalog price applies.
sale_pricenumberNoPromotional price. Absent means price is what the shopper pays.
currencystringNoCurrency of both prices. Absent means the currency the source declares.
stockintegerNoUnits available. Absent is not zero: a row without stock still says the product is sold here, count unknown. 0 means out of stock.
availabilitystringNoWhether the product can be bought here right now. preorder and backorder stay advertisable at a stock of 0. One of in_stock, out_of_stock, preorder, backorder, discontinued.
curl --request POST 'https://xxx.edge-stage.gowit.app/api/v1/ingest/inventory' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"inventory": [
{
"product_external_id": "P30001",
"location_ref": "STORE-012",
"price": 124.99,
"currency": "AED",
"stock": 8,
"availability": "in_stock"
},
{
"product_external_id": "P30001",
"location_ref": "STORE-044",
"stock": 0
}
]
}'
Order does not matter

A row may name a product or a store that has not arrived yet. It is kept, and attaches the moment that product or store lands.

Absent is not zero

A row without stock says the product is sold there with an unknown count. stock: 0 says it is out of stock. Send availability: preorder or backorder to keep a product advertisable at zero.

Where a product is sold​

You never fill in "sold at" by hand. GoWit reads it from the rows you send:

  1. A product is sold at every store it is named at, by an inventory row or a stock_levels element.
  2. A product named at no store follows its source's coverage: with exhaustive it is sold nowhere; with exceptions it is sold everywhere at its general price.
  3. If no product names any store at all, everything is sold everywhere.
  4. On top of that, an inactive product and a closed store sell nothing.

Coverage​

Each inventory source declares, once, what a missing row means. You choose it when the source is set up.

CoverageA missing product-store pair meansUse it when
exhaustive (default)not sold thereyour file lists every pair that sells
exceptionssold there at the general priceyour file lists only the stores whose price or stock differ

Product scope​

A product feed that carries a store column (one row per product per store) is read one of two ways:

Product scopeResult
shared (default)One product, plus one price and stock row per store it was listed at
per_locationEach row is a product of its own, sold at that store only

Store codes everywhere​

The same store code travels through the whole integration:

WhereField
Storeexternal_id
Inventory rowlocation_ref
Product, per storestock_levels[].location_id
Ad requestlocation_id: ads use that store's price and stock
Offline salelocation_id on the sale event

Checklist

  • Stores are sent (feed or push) and appear in the console. (Retailer)
  • The inventory source is set up with its coverage, or stock_levels are sent on products. (Retailer)
  • A product shows the right stores, prices and stock in the console. (Retailer)
  • Ad requests for a store send its location_id. (Retailer)