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
| Way | What you send | Best when |
|---|---|---|
| On the product | price and stock on each product | One price and one stock per product |
| Per store, inside the product | stock_levels on each product: [{location_id, price, stock}] | Store data changes with the product, in one push |
| Dedicated inventory | Inventory rows of their own, by feed or push | Stock moves faster than the catalog, or comes from another system |
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.
| Field | Type | Required | Description |
|---|---|---|---|
external_id | string | Yes | Your 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. |
status | string | No | Whether 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. |
name | string | No | Store name shown in the console and to advertisers. |
kind | string | No | What 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_ref | string | No | The 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. |
city | string | No | City. |
country_code | string | No | Country, e.g. AE. |
latitude | number | No | Latitude of the store. |
longitude | number | No | Longitude of the store. |
service_area_radius_m | number | No | Delivery radius around the store, in metres. A feed in kilometres is converted in the source mapping. |
destination_url | url | No | The store page on your site, where a click on a store ad goes. |
Send stores by feed or by push:
- cURL
- Node.js
- Python
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
}
]
}'
const res = await fetch('https://xxx.edge-stage.gowit.app/api/v1/ingest/locations', {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"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
}
]
}),
})
if (res.status === 204) {
console.log('No content')
} else {
console.log(res.status, await res.text())
}
import requests
url = "https://xxx.edge-stage.gowit.app/api/v1/ingest/locations"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"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,
},
],
}
response = requests.request("POST", url, headers=headers, json=payload, timeout=10)
print(response.status_code, response.text)
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.
| Field | Type | Required | Description |
|---|---|---|---|
product_external_id | string | Yes | The product id from your catalog. A row whose product has not arrived yet is kept and attaches as soon as the product lands. |
location_ref | string | No | Your 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_ref | string | No | A 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. |
price | number | No | Price at this store. Absent means the catalog price applies. |
sale_price | number | No | Promotional price. Absent means price is what the shopper pays. |
currency | string | No | Currency of both prices. Absent means the currency the source declares. |
stock | integer | No | Units available. Absent is not zero: a row without stock still says the product is sold here, count unknown. 0 means out of stock. |
availability | string | No | Whether 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
- Node.js
- Python
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
}
]
}'
const res = await fetch('https://xxx.edge-stage.gowit.app/api/v1/ingest/inventory', {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"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
}
]
}),
})
if (res.status === 204) {
console.log('No content')
} else {
console.log(res.status, await res.text())
}
import requests
url = "https://xxx.edge-stage.gowit.app/api/v1/ingest/inventory"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"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,
},
],
}
response = requests.request("POST", url, headers=headers, json=payload, timeout=10)
print(response.status_code, response.text)
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.
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:
- A product is sold at every store it is named at, by an inventory row or a
stock_levelselement. - A product named at no store follows its source's coverage: with
exhaustiveit is sold nowhere; withexceptionsit is sold everywhere at its general price. - If no product names any store at all, everything is sold everywhere.
- 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.
| Coverage | A missing product-store pair means | Use it when |
|---|---|---|
exhaustive (default) | not sold there | your file lists every pair that sells |
exceptions | sold there at the general price | your 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 scope | Result |
|---|---|
shared (default) | One product, plus one price and stock row per store it was listed at |
per_location | Each row is a product of its own, sold at that store only |
Store codes everywhere
The same store code travels through the whole integration:
| Where | Field |
|---|---|
| Store | external_id |
| Inventory row | location_ref |
| Product, per store | stock_levels[].location_id |
| Ad request | location_id: ads use that store's price and stock |
| Offline sale | location_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)