Vantagio/Integration API
vantagio.app

Integration API

Machine-to-machine API to send us your products and hourly sales, and read back price recommendations and competitor prices. Separate from the admin login — it uses an API key issued to your company.

Base URL
https://vantagio.app/api/v1
Content type
application/json
Timestamps
ISO 8601 · UTC

Operations at a glance

OperationEndpointWhat it does
Get access tokenPOST /integration/tokenExchange your API key for a short-lived token
Push productsPOST /integration/productsSend / refresh your product catalog + prices
Push salesPOST /integration/salesSend hourly sales & engagement stats
Read recommendationsGET /integration/recommendationsGet recommended prices per product
Read competitor pricesGET /integration/competitor-pricesGet the latest matched competitor prices per product — all of them, or only what was refreshed since a date you choose

0Authentication

You are given one long-lived API key (vt_live_…). Keep it secret, server-side only. It is not used to read or write data directly — its only job is to obtain a short-lived access token (vt_at_…).

vt_live_…  ──POST /integration/token──►  vt_at_…  (access token)
                                            │
              every data call uses the access token as a Bearer token
                                            │
        each call returns a NEW access token; the old one is now dead

The access token is single-use and rotating:

  • Every data call consumes the token you send and returns a fresh one in the X-Next-Access-Token response header (and in the JSON body as accessToken).
  • Store that new token and use it on your next call.
  • The token also expires after a TTL (default 1 hour) even if unused.

⚠️ Call sequentially. Each call invalidates the token — do not fire concurrent requests with the same token. On any 401, re-mint with your API key and retry.

Get an access token

POST/integration/token
curl -X POST https://vantagio.app/api/v1/integration/token \
  -H "X-API-Key: vt_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{ "ok": true, "accessToken": "vt_at_3f9a...c1", "tokenType": "Bearer", "expiresIn": 3600 }

Then send the token on every data call:

Authorization: Bearer vt_at_3f9a...c1

After each call, read the next token from the X-Next-Access-Token header (or the JSON accessToken field, present on success and error responses).

1Push products

Send your catalog as a bulk upsert. Products are matched by itemID — your own product id. Re-pushing the same itemID updates the product. Send the full product object each time (catalog sync, not a patch).

POST/integration/products

Required fields

FieldTypeRequiredNotes
itemIDstringrequiredYour product id; the upsert key
namestringrequiredDisplay name
costnumberrequiredCost price (≥ 0)
currentPricenumberrequiredConsumer price — current selling price (≥ 0)

Optional known fields

FieldTypeRequiredNotes
currencystringoptionalISO code; defaults to ILS
shelfPricenumberoptionalList / RRP price
inventorynumberoptionalStock quantity
weeklyConversionRatenumberoptional0–1
activebooleanoptionalDefaults to true
imageUrlstring (URL)optionalProduct image — http(s); shown in the catalog
productUrlstring (URL)optionalLink to the product's page on your storefront — http(s)

Example request

curl -X POST https://vantagio.app/api/v1/integration/products \
  -H "Authorization: Bearer vt_at_…" \
  -H "Content-Type: application/json" \
  -d '{
    "products": [
      {
        "itemID": "DESK-OAK-120",
        "name": "Office Desk - Oak 120cm",
        "cost": 42.00,
        "currentPrice": 89.90,
        "currency": "ILS",
        "imageUrl": "https://shop.example.com/img/desk-oak-120.jpg",
        "productUrl": "https://shop.example.com/p/desk-oak-120",

        "department": "furniture",
        "group": "desks",
        "attributes": { "material": "oak", "width": 120, "color": "natural" }
      }
    ]
  }'

You may also POST a bare JSON array. Max 5000 products per request.

Response

{
  "ok": true,
  "received": 1,
  "accepted": 1,
  "created": 1,
  "updated": 0,
  "matched": 0,
  "priceHistoryRecorded": 1,
  "rejected": [],
  "accessToken": "vt_at_<next>",
  "expiresIn": 3600
}

Invalid items are reported in rejected (each with { index, itemID, reason }) without failing the rest of the batch. We keep a price-history time-series of your currentPrice/cost (appended only when they change). Static details keep only the latest.

2Push sales (hourly)

Send sales and engagement stats per product, per hour. One record = one product in one hour. Re-sending the same hour updates it — fields you send overwrite, fields you omit keep their previous values. So you can send each hour once, or keep updating the current hour as it fills up.

POST/integration/sales

Required

FieldTypeRequiredNotes
itemIDstringrequiredThe product (itemID) this stat belongs to
periodStartstring (ISO)requiredThe hour — any time inside it; floored to the hour, UTC

Every metric is optional — send as little as a single one. You must send at least one of: unitsSold, views, addToCarts, returnedUnits, listedPrice or inStock.

Sales metrics

FieldTypeRequiredNotes
unitsSoldnumberoptionalUnits sold in the hour · alias: quantity
salePricenumberoptionalActual avg sale price per unit · aliases: avgUnitPrice, unitPrice, pricePerUnit
costPricenumberoptionalActual avg cost (cost 1) per unit, e.g. purchase price · aliases: unitCost, costPerUnit, cost1
cost2numberoptionalActual avg cost 2 per unit, e.g. logistics (optional) · aliases: cost2PerUnit, logisticsCost
returnedUnitsnumberoptionalUnits returned/refunded in the hour · alias: returns

Conditional: when unitsSold ≥ 1 you must also send both salePrice and costPrice — that's what lets us compute real margin. (Sending a price with no sale is rejected; for a display price use listedPrice.) Revenue, profit and conversions are derived from your raw inputs (units × price, units ÷ views) — we don't store precomputed values, so send the raw numbers.

Engagement metrics (optional)

FieldTypeRequiredNotes
viewsnumberoptionalProduct views in the hour (a views-only hour with no sale is valid)
addToCartsnumberoptionalAdd-to-cart events — enables true conversion (view → cart → buy)
listedPricenumberoptionalPrice the product was displayed at during the hour
inStockbooleanoptionalWas it available that hour
currencystringoptionalISO code; defaults to the product's currency

Example request

curl -X POST https://vantagio.app/api/v1/integration/sales \
  -H "Authorization: Bearer vt_at_…" \
  -H "Content-Type: application/json" \
  -d '{
    "sales": [
      {
        "itemID": "DESK-OAK-120",
        "periodStart": "2026-06-19T14:00:00Z",
        "unitsSold": 3,
        "salePrice": 89.90,
        "costPrice": 42.00,
        "views": 210,
        "addToCarts": 12,
        "inStock": true
      },
      {
        "itemID": "DESK-OAK-120",
        "periodStart": "2026-06-19T15:00:00Z",
        "views": 50,
        "channel": "web",
        "region": "north"
      }
    ]
  }'

Response

{
  "ok": true,
  "received": 2,
  "accepted": 2,
  "created": 2,
  "updated": 0,
  "matched": 0,
  "linked": 2,
  "rejected": [],
  "accessToken": "vt_at_<next>",
  "expiresIn": 3600
}

linked = records matched to a known product. Records for unknown products are still stored and link automatically once the product is pushed.

3Read price recommendations

GET/integration/recommendations

Returns every product in your channel, each with its latest recommendation from the last 48 hours (?hours= / ?since= to change the window). recommendedPrice is set only when that recommendation is approved (auto_accepted / manual_accepted / overridden); every other product comes back with recommendedPrice: null and status none (no recommendation), pending or rejected. Add ?status=all to also get the engine price on pending and rejected rows.

curl "https://vantagio.app/api/v1/integration/recommendations" \
  -H "Authorization: Bearer vt_at_…"
{
  "ok": true,
  "since": "2026-06-17T03:00:00.000Z",
  "count": 2,
  "recommendedCount": 1,
  "recommendations": [
    {
      "itemID": "SKU-1001",
      "productName": "Office Desk - Oak 120cm",
      "active": true,
      "currentPrice": 89.90,
      "recommendedPrice": 84.90,
      "deltaPrice": -5.00,
      "deltaPct": -5.56,
      "currency": "ILS",
      "status": "auto_accepted",
      "computedAt": "2026-06-19T03:00:11.000Z",
      "decidedAt": "2026-06-19T03:00:11.000Z"
    },
    {
      "itemID": "SKU-1002",
      "productName": "Office Chair - Black",
      "active": true,
      "currentPrice": 249.00,
      "recommendedPrice": null,
      "deltaPrice": null,
      "deltaPct": null,
      "currency": "ILS",
      "status": "none",
      "computedAt": null,
      "decidedAt": null
    }
  ],
  "accessToken": "vt_at_<next>",
  "expiresIn": 3600
}

Map each item back to your product by itemID and apply recommendedPrice only when it is not null.

4Read competitor prices

GET/integration/competitor-prices

Returns, grouped per product, the latest scraped price of every active competitor match in your channel. Each price comes both as scraped (price / currency) and converted into your channel currency (priceConverted / convertedCurrency) — so you don't have to run FX yourself. Company and channel are taken from your access token.

Query parameters (all optional)

FieldTypeRequiredNotes
channelstring (slug)optionalRead a different channel by its slug (must belong to your company). Defaults to the token's channel.
itemIDstringoptionalLimit to a single product
inStockOnlybooleanoptionalDrop competitors currently out of stock
daysnumber (max 36500)optionalMark prices not re-scraped in the last N days as stale
sinceISO date | epoch-msoptionalExplicit window start — overrides days. Epoch must be milliseconds (13 digits).

Reading only the latest updates

By default there is no window: every competitor comes back with its last known price, however old that scrape is, for every product in the channel. There is no cap on the number of products and no maximum lookback — the window is entirely your choice.

# only prices re-scraped in the last 2 days
curl "https://vantagio.app/api/v1/integration/competitor-prices?days=2" \
  -H "Authorization: Bearer vt_at_…"

# everything scraped since a specific moment (e.g. your last successful sync)
curl "https://vantagio.app/api/v1/integration/competitor-prices?since=2026-07-29T06:00:00Z" \
  -H "Authorization: Bearer vt_at_…"

# epoch-MILLIseconds also works (13 digits; epoch-seconds gets a 400)
curl "https://vantagio.app/api/v1/integration/competitor-prices?since=1785283200000" \
  -H "Authorization: Bearer vt_at_…"
  • A window never drops products or competitors, and the response is the same size. It is a freshness marker — not a filter, and not a performance lever.
  • A competitor whose newest scrape predates the window returns price: null plus stale: true, while scrapedAt and inStock keep their true values — so you can tell 3 days old from never scraped (stale: false with scrapedAt: null).
  • The response echoes the window that was applied as since (null when you sent none).
  • Recommended: keep the timestamp of your last successful sync and send it as since — you then act only on competitors that were re-scraped since then. Send no window when you want the full picture.

A re-scrape is not necessarily a price change. A row is stored on every scrape whether the price moved or not, so since answers what did you check recently, not what changed. To detect real movement, compare the returned price against the value you already stored.

# an incremental sync loop
RESP=$(curl -s "$BASE/integration/competitor-prices?since=$LAST_SYNC" \
  -H "Authorization: Bearer $TOKEN")

# 1. carry the rotated token forward — the one you just used is spent
TOKEN=$(echo "$RESP" | jq -r .accessToken)

# 2. act on competitors that came back WITH a price. price:null + stale:true means
#    "not re-scraped inside your window" (scrapedAt tells you how old it is);
#    price:null + stale:false means never scraped at all
echo "$RESP" | jq '.products[] | {itemID, competitors: [.competitors[] | select(.price != null)]}'

# 3. advance the cursor to the NEWEST scrapedAt you actually received — never to
#    your own clock. The request takes seconds and your clock is not ours; either
#    would silently skip rows written in between, permanently.
LAST_SYNC=$(echo "$RESP" | jq -r '[.products[].competitors[].scrapedAt | select(. != null)] | max')

The most common integration failure is token reuse. The access token is single-use: every call consumes it and hands you a successor in the response body (accessToken) and in the X-Next-Access-Token header. A retry loop that re-sends the same token gets a 401 on the second attempt — which looks like an auth problem but is really bookkeeping. On any 401, mint a fresh token with your vt_live_… key and retry once.

Response size & timeouts: every read returns the whole channel in one response — for a ~1,000-product / ~3,400-competitor-row channel that is roughly 1.2MB and 5–10 seconds. Allow a generous client timeout (60s+) and do not run several full reads concurrently: six in parallel already take ~15s each. days / since do not make the call cheaper — pace your polling instead.

curl "https://vantagio.app/api/v1/integration/competitor-prices?inStockOnly=true" \
  -H "Authorization: Bearer vt_at_…"
{
  "ok": true,
  "channel": "default",
  "currency": "ILS",
  "since": null,
  "count": 1,
  "products": [
    {
      "itemID": "DESK-OAK-120",
      "productName": "Office Desk - Oak 120cm",
      "competitors": [
        {
          "competitorName": "KSP",
          "competitorProductName": "Office Desk Oak 120",
          "competitorProductRef": "ksp-998877",
          "price": 84.90,
          "currency": "ILS",
          "priceConverted": 84.90,
          "convertedCurrency": "ILS",
          "inStock": true,
          "scrapedAt": "2026-06-29T03:11:00.000Z",
          "stale": false,
          "confidence": 0.95,
          "matchMethod": "manual"
        }
      ]
    }
  ],
  "accessToken": "vt_at_<next>",
  "expiresIn": 3600
}

Only active matches are returned. price (and its converted twin) is null for a product that is matched but not yet scraped — or whose newest scrape falls outside a days / since window you asked for, in which case stale is true and scrapedAt still shows the real last scrape. inStock is null only when stock is genuinely unknown (no scrape yet). An unknown channel slug returns 404 — never another channel's prices.

Custom fields — send anything

Beyond the known fields, you can attach any data — on products (folded into attributes) and on sales (folded into custom). Put it in that object, or just add extra top-level keys; unknown keys are captured automatically.

  • Every custom field is stored and discovered automatically — it appears in your admin under Custom Fields the first time we see it.
  • A discovered field is stored but inert until you give it a type (string / number / boolean / date / enum). Only typed fields are used by the pricing engine (grouping, rules, matching).
  • Latest value wins; a field persists even on pushes where you omit it.
  • A field you stop sending for 90 days is removed from the registry and from your products' attributes.
  • Field names must be valid keys: no dots (.) and not starting with $.

Errors

FieldTypeRequiredNotes
401UnauthorizedoptionalMissing/invalid/expired/used token (re-mint), or missing API key on /token
403ForbiddenoptionalCompany suspended
400Bad requestoptionalEmpty or invalid request body
413Too largeoptionalToo many items in one request
500Server erroroptionalUnexpected error

Error responses on data endpoints still include a usable accessToken (and the X-Next-Access-Token header), so you can continue without re-minting.

Full example (bash)

BASE="https://vantagio.app/api/v1"
LIVE_KEY="vt_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# 0) Mint an access token
TOKEN=$(curl -s -X POST "$BASE/integration/token" \
  -H "X-API-Key: $LIVE_KEY" | jq -r .accessToken)

# 1) Push products — capture the rotated token from the response
RESP=$(curl -s -X POST "$BASE/integration/products" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"products":[{"itemID":"D1","name":"Office Desk","externalId":"SKU-1001","cost":42,"currentPrice":89.9,"currency":"ILS","department":"furniture"}]}')
TOKEN=$(echo "$RESP" | jq -r .accessToken)

# 2) Push this hour's sales
RESP=$(curl -s -X POST "$BASE/integration/sales" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"sales":[{"itemID":"D1","periodStart":"2026-06-19T14:00:00Z","unitsSold":3,"salePrice":89.9,"costPrice":42,"views":210}]}')
TOKEN=$(echo "$RESP" | jq -r .accessToken)

# 3) Read recommendations — capture the rotated token from the response
RESP=$(curl -s "$BASE/integration/recommendations" \
  -H "Authorization: Bearer $TOKEN")
TOKEN=$(echo "$RESP" | jq -r .accessToken)
echo "$RESP" | jq .recommendations

# 4) Read competitor prices (latest matched price per product).
#    No window = last known price per competitor, all products.
#    Add ?days=2 or ?since=<ISO|epoch-ms> for only recently scraped prices.
curl -s "$BASE/integration/competitor-prices?days=2" \
  -H "Authorization: Bearer $TOKEN" | jq .products

A robust client keeps the latest token and, on HTTP 401, calls /integration/token with the vt_live_… key and retries the request once.