OfficeGest
Stocks/Quantities/Search

Search stock quantities aggregated per article

Returns stock aggregated by article with warehouses[] array. Supports Base64 text/barcode search and optional article data (price, description, barcodes[]). Differs from /quantities (per article+warehouse).

GET
/stocks/quantities/search
AuthorizationBearer <token>

In: header

Query Parameters

order?string
sorder?string
Value in"ASC" | "DESC"
sort?string
limit?integer

Items per page. Default 50, maximum 250; a larger value is truncated to 250.

Default50
Range1 <= value <= 250
article_id?stringDeprecated
warehouse_id?numberDeprecated
txt?string

Base64 encoded text search in article code/description.

barcode?string

Base64 encoded barcode lookup (resolves prefix when applicable).

with_article_data?boolean

Include price, description, use_lots and barcodes[] per article.

include_zero_stock?boolean

Include articles with zero or negative stock.

page?integer

Page number. Default 1; a value below 1 counts as 1.

Default1
Range1 <= value
filter[article_id][operator]?string

Filter by article code. Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[article_id][eq]=value

filter[warehouse_id][operator]?number

Filter to a specific warehouse. Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[warehouse_id][eq]=value

Response Body

curl -X GET "https://og-tenant1.test:8003/api/v2/stocks/quantities/search?order=string&sorder=ASC&sort=string&limit=50&article_id=string&warehouse_id=0&txt=string&barcode=string&with_article_data=true&include_zero_stock=true&page=1&filter%5Barticle_id%5D%5Boperator%5D=string&filter%5Bwarehouse_id%5D%5Boperator%5D=0"
{
  "data": [
    {
      "article_id": "ART001",
      "description": "Produto A",
      "price": 9.99,
      "use_lots": false,
      "barcodes": [
        "5601234567890"
      ],
      "total_quantity": 25,
      "warehouses": [
        {
          "warehouse_id": 1,
          "quantity": 20,
          "quantity_order_customer": 2,
          "quantity_order_supplier": 5
        }
      ]
    }
  ],
  "meta": {
    "per_page": 50,
    "current_page": 1,
    "has_more": true
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}