OfficeGest
Stocks/Articles/Search

Search articles

Unified search for articles covering the legacy search_articles and search/articles endpoints. Supports Base64 encoded text/barcode search, SETORES location enrichment, barcode prefix resolution, article image URL and aggregated barcodes.

GET
/stocks/articles/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
id?stringDeprecated
description?stringDeprecated
barcode?stringDeprecated

Base64 encoded barcode lookup (also searches artigos_barcodes).

article_type?stringDeprecated
active?booleanDeprecated
use_lots?booleanDeprecated
family_id?stringDeprecated
sub_family_id?stringDeprecated
txt?string

Base64 encoded text to search in code/description/barcode.

warehouse_id?integer

Restrict sector lookup to this warehouse. Requires with_location=true.

sector_id?integer

Restrict sector lookup to this sector id. Requires with_location=true.

with_location?boolean

Include sector_id, sector_description, sector_barcode when SETORES module is active.

with_prefix?boolean

Include barcode_prefix and resolved prefix_search/prefix_value/prefix_type when barcode filter is used.

with_image?boolean

Include image_url when the article has a stored photo.

with_extra_barcodes?boolean

Include the barcodes[] aggregated list (includes artigos_barcodes entries).

page?integer

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

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

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[id][eq]=value

filter[description][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[description][eq]=value

filter[barcode][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[barcode][eq]=value

filter[article_type][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[article_type][eq]=value

filter[active][operator]?boolean

Filter by active flag. Operators: eq, neq. Example: filter[active][eq]=value

filter[use_lots][operator]?boolean

Operators: eq, neq. Example: filter[use_lots][eq]=value

filter[family_id][operator]?string

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

filter[sub_family_id][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[sub_family_id][eq]=value

Response Body

curl -X GET "https://og-tenant1.test:8003/api/v2/stocks/articles/search?order=string&sorder=ASC&sort=string&limit=50&id=string&description=string&barcode=string&article_type=string&active=true&use_lots=true&family_id=string&sub_family_id=string&txt=string&warehouse_id=0&sector_id=0&with_location=true&with_prefix=true&with_image=true&with_extra_barcodes=true&page=1&filter%5Bid%5D%5Boperator%5D=string&filter%5Bdescription%5D%5Boperator%5D=string&filter%5Bbarcode%5D%5Boperator%5D=string&filter%5Barticle_type%5D%5Boperator%5D=string&filter%5Bactive%5D%5Boperator%5D=true&filter%5Buse_lots%5D%5Boperator%5D=true&filter%5Bfamily_id%5D%5Boperator%5D=string&filter%5Bsub_family_id%5D%5Boperator%5D=string"
{
  "data": [
    {
      "id": "ART001",
      "barcode": "5601234567890",
      "description": "Produto A",
      "article_type": "N",
      "active": true,
      "use_lots": false,
      "barcodes": [
        "5601234567890"
      ],
      "image_url": "https://host/loadupload/artigos/_ART001.jpg",
      "sector_id": 12,
      "sector_description": "Corredor 3",
      "sector_barcode": "C3",
      "barcode_prefix": "20",
      "prefix_search": "20",
      "prefix_value": "00123",
      "prefix_type": "P"
    }
  ],
  "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"
  }
}