Sign in

Search products by name

GET https://{organization}.myguper.com/api/order/product/search

Superseded by GET /api/register/event/search (register). The audience builder now matches the product name directly via the generic event filter (type=buy_product) — no name→SKU step. This endpoint still works, but the boughtSku / person_order_item path is legacy (removed at cutover).

Resolves free-text product-name terms into the set of SKUs (skuRefId) that were sold under matching names. Powers the audience builder: the matched SKUs feed the boughtSku audience filter in the register service.

terms is free text — whitespace-separated terms are ANDed (accepts a space-separated string terms=a b or repeated terms[]=a&terms[]=b). sandalia salto returns only SKUs whose product name contains both words (same name string). Matching is case- and accent-insensitive (collation utf8mb4_general_ci), so tenis matches TÊNIS.

The product name comes from order_item.productName (a per-line snapshot — Guper has no separate product catalog). Results are grouped by skuRefId; each entry returns a representative name and the matched-line count (hits), ordered by hits desc. There is no interface scoping — skuRefId is the organization's canonical SKU reference.

Auth: service-to-service RSA signature (see Internal › Integração › Signature). Organization is taken from the request context.

Worked example

1. Search — find the SKUs named "sandalia salto":

GET /api/order/product/search?terms=sandalia%20salto
{
    "terms": ["sandalia", "salto"],
    "total": 1,
    "products": [
        { "sku": "47142", "name": "Sandalia Salto Alto 38", "hits": 14 }
    ]
}

2. Build the audience — feed the returned sku values into the register audience query as a boughtSku filter (here: bought it in the last 3 months):

[
    ["boughtSku", "in", { "list": ["47142"] }, { "int": 3 }]
]

Combine with other filters via AND — e.g. men who bought it: prepend ["gender","equals",{"string":"male"}], "AND",. See Internal › Services › Register › Audiência por produto for the full boughtSku reference.

Try-it values populated from environment ACME (Demo)


Authentication

Token

Send your user token in the x-guper-authorization header.

Headers

Name Type Description
x-guper-authorization * string User token issued by Guper.
Content-Type * string Always `application/json` for endpoints that accept a JSON body.

Query parameters

Name Type Description
terms * string Free-text terms. Whitespace-separated terms are ANDed against the product name. Also accepts an array (`terms[]=sandalia&terms[]=salto`). Empty `terms` returns an empty result.
limit integer Max number of SKUs returned. Broad terms may hit the cap — refine the terms (a large result also means a large `boughtSku IN (...)`).

Responses

{
    "terms": ["sandalia", "salto"],
    "total": 1,
    "products": [
        { "sku": "47142", "name": "Sandalia Salto Alto 38", "hits": 14 }
    ]
}
Copied to clipboard