Docs
Dashboard
On this page

    Inventory

    3 endpoints. Each needs an API key or OAuth token with the scope shown; the key already names its store, so paths start at /v1/store. Generated from the live contract; also in openapi.json.

    Stock for every product and option, with key pool health

    GET/v1/store/inventory

    Or name the store: GET /v1/stores/{storeId}/inventory

    catalog:readlistInventory

    Parameters

    • filter"all" | "low" | "out" | "pools" | "counted"query
    • qstring | nullquery
    • limitinteger | string | nullquery
    • cursorstring | nullquery
    • sort"health" | "product" | "type" | "available" | "sold" | "cover" | "alert"query
    • dir"asc" | "desc"query

    Response ListInventoryResponse

    • rowsInventoryRow[]required
    • nextCursorstringrequired
    • totalintegerrequired
    • countedUnitsintegerrequired
    • countsobjectrequired
      • allintegerrequired
      • lowintegerrequired
      • outintegerrequired
      • poolsintegerrequired
      • countedintegerrequired
    • poolsobjectrequired
      • keysAvailableintegerrequired
      • keysAssigned30dintegerrequired
      • productsLowintegerrequired

    Example

    curl "https://api.shopfa.st/v1/store/inventory" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/inventory', {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
      },
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "GET",
        "https://api.shopfa.st/v1/store/inventory",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/inventory", nil)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
    res, err := http.DefaultClient.Do(req)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Change a counted stock and record why

    POST/v1/store/inventory/adjust

    Or name the store: POST /v1/stores/{storeId}/inventory/adjust

    catalog:writeadjustStock

    Body

    • productIdprd_…required
    • variantIdvar_… | nullrequired
    • mode"add" | "set"required
    • amountintegerrequired
    • reason"restock" | "correction" | "damaged" | "returned"required
    • notestringrequired

    Response AdjustStockResponse

    • rowInventoryRowrequired
    • adjustmentStockAdjustmentrequired

    Example

    curl -X POST "https://api.shopfa.st/v1/store/inventory/adjust" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "productId": "prd_0123456789abcdefghjk",
      "variantId": "var_0123456789abcdefghjk",
      "mode": "add",
      "amount": 0,
      "reason": "restock",
      "note": "string"
    }'
    const res = await fetch('https://api.shopfa.st/v1/store/inventory/adjust', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "productId": "prd_0123456789abcdefghjk",
        "variantId": "var_0123456789abcdefghjk",
        "mode": "add",
        "amount": 0,
        "reason": "restock",
        "note": "string"
      }),
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "POST",
        "https://api.shopfa.st/v1/store/inventory/adjust",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
        json={
          "productId": "prd_0123456789abcdefghjk",
          "variantId": "var_0123456789abcdefghjk",
          "mode": "add",
          "amount": 0,
          "reason": "restock",
          "note": "string"
        },
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/inventory/adjust", strings.NewReader(`{
      "productId": "prd_0123456789abcdefghjk",
      "variantId": "var_0123456789abcdefghjk",
      "mode": "add",
      "amount": 0,
      "reason": "restock",
      "note": "string"
    }`))
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
    req.Header.Set("Content-Type", "application/json")
    res, err := http.DefaultClient.Do(req)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Every stock change, newest first

    GET/v1/store/inventory/history

    Or name the store: GET /v1/stores/{storeId}/inventory/history

    catalog:readlistStockHistory

    Parameters

    • productIdprd_… | nullquery
    • cursorstring | nullquery
    • limitinteger | stringquery

    Response ListStockHistoryResponse

    • itemsStockAdjustment[]required
    • nextCursorCursor | nullrequired

    Example

    curl "https://api.shopfa.st/v1/store/inventory/history" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/inventory/history', {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
      },
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "GET",
        "https://api.shopfa.st/v1/store/inventory/history",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/inventory/history", nil)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
    res, err := http.DefaultClient.Do(req)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Was this page helpful?