๐Ÿš€ GS API

Global Stocks โ€“ JSON API Documentation

๐Ÿ” Authentication Required

All endpoints except /api/docs require HTTP Basic Authentication against site_users.

Only active accounts with scope api-user can sign in. Admin and super-admin accounts are denied.

Example usage: curl -u "username:password" "https://api.globalstocks.eu/api/product-catalog"

Example JSON responses (auth required): https://api.globalstocks.eu/api/docs/examples

MethodPathDescription
GET/api/docsAPI documentation (this page).Try it โ†’
GET/api/pages-contentPagesContent โ€“ site_pages_content (id, parent_id, lang, title, content).Try it โ†’
GET/api/category-listCategoryList โ€“ stock_category_list, active rows only (id, parent_id, title, route, language, level).Try it โ†’
GET/api/site-pagesSitePages โ€“ site_pages (id, route, title, type, lang).Try it โ†’
GET/api/domain-configurationDomainConfiguration โ€“ site_configuration (languages, analytics, recaptchaPublic, recaptchaPrivate, adsenseClient, adsenseSlot).Try it โ†’
GET/api/product-catalogProduct list (default limit 30, totalCount in meta) or single item by id. Filters: region, category.Try it โ†’
GET/api/product-catalog-searchSearch by query and/or dateCreated (on or after). Filters: region, category. All matches by default; optional pagination.Try it โ†’
GET/api/product-special-offerSpecial offers only (is_special = 1). Same list pattern as product-catalog: limit, offset, region, category, or id.Try it โ†’
GET/api/product-daily-offerOffers created on a given day (default today). If none, walks backward up to 30 days. Same row shape as product-catalog.Try it โ†’
GET/api/product-countTotal count. Optional by=category or by=region for grouped breakdown.Try it โ†’
GET/api/product-filesDocuments and pictures for one product. Returns files[] and images[]. Query: id (required).Try it โ†’
GET/api/banner-configBannerConfig โ€“ bannerconfig (id, bannerPicture, bannerLink, position). Optional filter: position.Try it โ†’
GET/api/seasonal-offerSeasonal offer from site_seasonal_offers. active matches the database flag (1 = true).Try it โ†’
GET/api/site-reviewsSiteReviews โ€“ site_reviews (id, reviewerName, reviewerInitial, reviewerSubtitle, rating, reviewText).Try it โ†’
POST/api/subscribersCreate a newsletter subscriber (site_subscribers). JSON body; HTML in any field is rejected.
POST/api/messagesSubmit a site contact message (site_messages). type must be mainContactForm or stockContactForm; HTML rejected.

Pages

Page metadata lives in site_pages. Translation bodies live in site_pages_content and are returned as a flat list from /api/pages-content. Join them with parent_id = site_pages.id.

GET /api/pages-content

Returns all translation rows from site_pages_content. This is the previous flat payload (the items that were nested under content[]).

FieldDescription
idTranslation row id.
parent_idRelated site_pages.id.
langTranslation language.
titleTranslated title.
contentTranslated body HTML.

Example: curl -u "username:password" "https://api.globalstocks.eu/api/pages-content"

GET /api/site-pages

Returns all site_pages rows (including homepage and catalog). No nested translations.

FieldDescription
idSite page id.
routePage route slug.
titlePage title.
typePage type (page, pages, contacts, code, homepage, catalog).
langDefault page language.

Domain configuration

Per-domain portal settings from site_configuration, including public and secret reCAPTCHA keys.

GET /api/domain-configuration

Returns all domain rows. No query parameters.

FieldDescription
idConfiguration row id.
domainHostname this row applies to.
defaultUILangDefault UI language code.
defaultCatalogLangDefault catalog language code.
langListAvailable languages for the domain.
googleAnalyticsGoogle Analytics measurement / tracking id.
recaptchaPublicreCAPTCHA site key (public).
recaptchaPrivatereCAPTCHA secret key.
adsenseClientGoogle AdSense client id (for example ca-pub-โ€ฆ).
adsenseSlotGoogle AdSense slot id.

Example: curl -u "username:password" "https://api.globalstocks.eu/api/domain-configuration"

Banner configuration

Site banners from bannerconfig. Each row has a picture, optional link, and a placement position. The old domainID column is not returned.

GET /api/banner-config

Returns banner rows. Omit position for all banners; pass it to load one placement.

FieldDescription
idBanner row id.
bannerPictureImage path or filename for the banner.
bannerLinkClick-through URL. May be empty.
positionPlacement: homepage, catalog-1, catalog-2, or partners-adv.
ParameterRequiredDescription
positionNoFilter by placement. Allowed: homepage, catalog-1, catalog-2, partners-adv. Invalid value returns 400.

Example: curl -u "username:password" "https://api.globalstocks.eu/api/banner-config?position=homepage"

Product endpoints

Catalog rows come from stock_catalog. Filter values region and category use route slugs (regionRoute, categoryRoute), not display titles. Paginated list/search responses put meta before data. price_full and price_short are served as stored in the database.

EndpointPurpose
/api/product-catalogList or fetch one product (includes embedded files / images).
/api/product-catalog-searchText search with optional region, category, and dateCreated filters.
/api/product-special-offerSame as product-catalog, limited to is_special = 1.
/api/product-daily-offerProducts created on one calendar day; walks backward up to 30 days if that day is empty.
/api/product-countAggregate counts (total, by category, or by region).
/api/product-filesDocuments and pictures for one product id (files[] + images[]).

Asset paths (config.ini [paths]): stockDataRoot = portal root containing public/data/โ€ฆ; stockDataDirectRoot = flat layout with {id}/files and {id}/pictures. JSON paths always use public/data/{id}/โ€ฆ. Reload PHP after config changes.

GET /api/product-catalog

Returns products ordered by id DESC. Each row includes stored price display fields plus files and images path arrays. availability and viewCount are not returned.

FieldDescription
idProduct id.
regionRegion display name (from regionName).
regionRouteRegion slug used in filters.
categoryCategory display name.
categoryRouteCategory slug used in filters.
titleProduct title.
descriptionProduct description.
priceNumeric price when the currency uses a number; empty when sold or price is not numeric.
currencyCurrency or price mode (EUR, GBP, USD, % from Retail, % from Wholesale, price in attachment, price upon request, bid price).
price_fullDisplay price as stored in the database.
price_shortShort display price as stored in the database.
sold1 if sold, otherwise 0.
dateCreatedCreated timestamp.
is_specialSpecial-offer flag.
filesDocument paths under public/data/{id}/files/.
imagesPicture paths, or stub images when the product has none.
ParameterRequiredDescription
idNoReturn a single product by id. When set, pagination, filters, and meta are omitted.
limitNoPage size. Default 30.
offsetNoPagination offset. Default 0.
regionNoFilter by regionRoute (exact match).
categoryNoFilter by categoryRoute (exact match).

List meta: limit, offset, region, category, count, totalCount. To load only asset paths without product fields, use /api/product-files?id=.

GET /api/product-special-offer

Same response shape as /api/product-catalog (including files / images), but only products with is_special = 1. Ordered by id DESC.

ParameterRequiredDescription
idNoReturn a single special offer by id. Empty list if the product is not special. When set, pagination, filters, and meta are omitted.
limitNoPage size. Default 30.
offsetNoPagination offset. Default 0.
regionNoFilter by regionRoute (exact match).
categoryNoFilter by categoryRoute (exact match).

Example: curl -u "username:password" "https://api.globalstocks.eu/api/product-special-offer"

GET /api/product-daily-offer

Returns all catalog rows created on one calendar day, same fields as /api/product-catalog (including files / images), ordered by id DESC. Default date is today. If that day has no products, the API walks backward one day at a time for up to 30 days until a day with offers is found.

ParameterRequiredDescription
dateNoStart date. Accepts YYYY-MM-DD or DD-MM-YYYY. Default: today.

Meta: date (requested start day), offerDate (day that had offers, or null), title (for example STOCK OFFERS FOR 01-08-2026), daysChecked, count, totalCount.

Example: curl -u "username:password" "https://api.globalstocks.eu/api/product-daily-offer?date=2026-08-01"

GET /api/product-catalog-search

Substring search in title and description (LIKE %query%), and/or filter by dateCreated. Provide at least query or dateCreated. By default returns all matching products. Pass limit and/or offset to paginate.

ParameterRequiredDescription
queryNo*Search term matched against title and description. Required if dateCreated is omitted.
regionNoFilter by regionRoute (exact match).
categoryNoFilter by categoryRoute (exact match).
dateCreatedNo*Return items created on this date or later (YYYY-MM-DD). Required if query is omitted.
limitNoPage size. Only used when paginating; default is all matches.
offsetNoPagination offset. Only used when paginating.

Meta fields: query, region, category, dateCreated, limit, offset, count (items in current response), totalCount (all matches for the current filters).

GET /api/product-count

Returns aggregate product counts. Use the optional by parameter to choose grouping.

ParameterRequiredDescription
byNocategory โ€“ group by category with by_region nested in each category. region โ€“ group by region with by_category nested in each region. Omit for total count only.

Default response: data.count only (no category or region breakdown).

by=category: data.count, data.by_category[] with category, categoryRoute, count, by_region[].

by=region: data.count, data.by_region[] with region, regionRoute, count, by_category[].

GET /api/product-files

Returns documents and pictures for one product in a single response. This is the only dedicated assets endpoint (no separate pictures route).

ParameterRequiredDescription
idYesProduct id.

Response: data.id, data.files[] (documents from public/data/{id}/files/), data.images[] (pictures from public/data/{id}/pictures/, or stub images when empty).

Example: curl -u "username:password" "https://api.globalstocks.eu/api/product-files?id=12345"

Seasonal offer

Promotion content from site_seasonal_offers. active is the stored flag from the database. Use showFrom / showTo on the client if you also need the display window.

GET /api/seasonal-offer

Returns the current seasonal offer. Prefers an enabled row whose date window includes today; otherwise the latest enabled row; otherwise the latest row. No query parameters.

FieldDescription
data.seasonal_offernull when the table has no rows.
data.seasonal_offer.idOffer row id.
data.seasonal_offer.headerModal title (plain text).
data.seasonal_offer.contentModal body as HTML.
data.seasonal_offer.showFromFirst date the offer may be shown (YYYY-MM-DD).
data.seasonal_offer.showToLast date the offer may be shown (YYYY-MM-DD).
data.seasonal_offer.activetrue when the database column active is 1.

Display logic: active mirrors the database. Combine it with showFrom / showTo on the client if the modal should also respect the date window.

Example: curl -u "username:password" "https://api.globalstocks.eu/api/seasonal-offer"

Site reviews

Customer reviews from site_reviews. Rating is an integer from 1 to 5.

GET /api/site-reviews

Returns all review rows, newest first (id DESC). No query parameters.

FieldDescription
idReview row id.
reviewerNameDisplay name of the reviewer.
reviewerInitialOptional short initial or avatar letters. null when empty.
reviewerSubtitleOptional subtitle (company, role, location). null when empty.
ratingStar rating, integer 1โ€“5.
reviewTextReview body (plain text).

Example: curl -u "username:password" "https://api.globalstocks.eu/api/site-reviews"

Subscribers & messages

POST endpoints for newsletter sign-ups and contact-form submissions. Send Content-Type: application/json. All string fields are checked for HTML โ€” if tags or encoded markup are detected, the API returns 400 with an error (nothing is stored).

POST /api/subscribers

Inserts a row into site_subscribers. dateCreated is set automatically.

JSON fieldRequiredDescription
subscriberFormTypeYesForm identifier (plain text, no HTML).
subscribersEmailYesSubscriber email address.
subscribersDomainYesOriginating site domain (plain text, no HTML).

Success (201): { "success": true, "data": { "subscriber": { "id": 123 } } }

Example: curl -u "username:password" -H "Content-Type: application/json" -d '{"subscriberFormType":"footer","subscribersEmail":"user@example.com","subscribersDomain":"globalstocks.eu"}' "https://api.globalstocks.eu/api/subscribers"

POST /api/messages

Inserts a row into site_messages. created_at is set automatically.

JSON fieldRequiredDescription
nameYesSender name (plain text, no HTML).
typeYesContact form type. Must be exactly mainContactForm or stockContactForm โ€” use mainContactForm for the main site contact form and stockContactForm for the stock portal contact form.
subjectYesMessage subject (plain text, no HTML).
emailYesSender email address.
commentsYesMessage body (plain text, no HTML).

type values: mainContactForm ยท stockContactForm โ€” any other value returns 400.

HTML rejected: { "success": false, "error": "HTML is not allowed in comments" }

Success (201): { "success": true, "data": { "message": { "id": 456 } } }

Example: curl -u "username:password" -H "Content-Type: application/json" -d '{"name":"Jane Doe","type":"mainContactForm","subject":"Inquiry","email":"jane@example.com","comments":"Hello"}' "https://api.globalstocks.eu/api/messages"