Custom search merchants

PUBLIC

Returns merchants using field-boosted search with optional geo-distance filtering.
Either query or all three geo params (lat, lon, distance) must be provided.
When both are provided, results must match the query text AND be within the specified distance.
When limit is provided the response is paginated and meta.pagination is included.
Without limit, all matching results are returned.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
📘

CacheCache-Control: public, max-age=3600 (1 hour)

Part of the catalog — The product catalog explains how merchants, products, calendars and timeslots fit together.

Why this endpoint exists

Two jobs that broad search cannot do:

Field-boosted text matching. A hit on the merchant's name ranks above a hit in its description, so "Zoo" puts Amsterdam Zoo first instead of every merchant whose blurb mentions animals. If broad search returns technically-correct but badly-ordered results, this is the fix.

"Near me". Filter to merchants within a radius of a coordinate and get the distance back on each result, so you can build a map view or a "closest first" list.

Parameter combinations

This endpoint has a required-parameter rule that is easy to get wrong: you must supply either query, or all three of lat, lon and distance. The geo trio is all-or-nothing.

SentBehaviour
query onlyField-boosted text search across the campaign
lat + lon + distanceEvery merchant within the radius, no text filter
query + all three geo paramsAND — must match the text and be inside the radius
Neither / partial geo400

The combined mode is the one to reach for on a "search near me" UI. Note it is a conjunction: a strong text match 50 km outside the radius is excluded entirely, not ranked lower.

How to use it

# Text search, name-boosted
curl "https://api.acc.funtrips.io/v2/merchants/search?query=zoo&limit=20" \
  -H "x-campaign-id: $CAMPAIGN_ID"

# Within 25 km of Amsterdam Centraal
curl "https://api.acc.funtrips.io/v2/merchants/search?lat=52.3791&lon=4.9003&distance=25000&limit=20" \
  -H "x-campaign-id: $CAMPAIGN_ID"

# Both
curl "https://api.acc.funtrips.io/v2/merchants/search?query=zoo&lat=52.3791&lon=4.9003&distance=25000&limit=20" \
  -H "x-campaign-id: $CAMPAIGN_ID"

Query parameters

ParameterTypeRequiredNotes
querystringConditionalRequired unless all geo params are given
latdoubleConditionalLatitude. Required with lon + distance
londoubleConditionalLongitude. Required with lat + distance
distanceintegerConditionalRadius in metres25000, not 25
limitintegerNo1–100. Omitting it returns all matches unpaginated
next_tokenstringNoCursor

distance is in metres

Passing 25 gives you a 25-metre radius and an empty result set that looks like a data problem. This is the single most common mistake on this endpoint.

distance_meters on the response

When you supply coordinates, each merchant carries an extra field:

{
  "id": "8a2f4c61-9d3e-4b57-a0c8-1e5f7b2d9a30",
  "title": "Amsterdam Zoo",
  "distance_meters": 1840,
  "…": "the usual Merchant fields"
}

It is straight-line distance, not travel distance — good for sorting and for "1.8 km away", wrong for "8 minutes by car". The field is absent entirely when no coordinates were sent, so do not depend on its presence.

Everything else matches the Merchant shape from list merchants, including the best_effective_price / best_list_price pair.

Errors

StatustypeCause
400Neither query nor a complete geo trio; or a malformed coordinate
502urn:qup:error:merchant-search-failedSearch backend failed
504urn:qup:error:merchant-search-timed-outSearch backend timed out
500urn:qup:error:merchant-internal-errorUnexpected fault

As with broad search, always send limit — an unbounded search is the usual cause of a 504. No matches is 200 with an empty array.

Query Params
string

Search query string. Required if geo params are not provided.

double

Latitude for geo-distance filtering. Required together with lon and distance.

double

Longitude for geo-distance filtering. Required together with lat and distance.

integer

Radius in meters for geo-distance filtering. Required together with lat and lon.

integer
1 to 100
Defaults to 20

Number of items to return per page.

string

Opaque pagination cursor returned by a previous response.

Headers
uuid
required

Campaign scope for this request. Filters content to the specified campaign.

string

RFC 7231 language preference. The best match against supported locales (nl-NL, en-GB, de-DE) is selected. Defaults to nl-NL when omitted.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json