Skip to main content

API reference

This long page shows how a reference is structured. The table of contents is on the right, and every endpoint has a fixed anchor that can be shared as a link (e.g. api-referenz#store-get-notice).

Base URLs

APIBase URLAuthentication
Store API/store-apisw-access-key header
Admin API/apiOAuth 2 bearer token

Store API​

Load the notice of a product​

GET /store-api/gb-notice/{productId}

Returns the currently valid notice of a product. If no notice is valid, the route responds with 204 No Content.

Path parameters

NameTypeRequiredDescription
productIdUUID✓Product ID

Response 200 OK

{
"apiAlias": "gb_notice",
"id": "0190a1b2c3d4e5f6a7b8c9d0e1f2a3b4",
"text": "Shipping within Germany only.",
"position": "below_price",
"validFrom": null,
"validUntil": "2026-12-24T23:59:59+00:00"
}

Errors

StatusCodeMeaning
400GB_NOTICE__INVALID_IDproductId is not a valid UUID
404CONTENT__PRODUCT_NOT_FOUNDProduct does not exist or is not visible

Load notices of several products​

POST /store-api/gb-notice/list

Request body

FieldTypeRequiredDescription
productIdsUUID[]✓At most 100 IDs
includeExpiredboolAlso return expired notices (default false)
Example request
{
"productIds": ["0190a1b2c3d4e5f6a7b8c9d0e1f2a3b4", "0190b2c3d4e5f6a7b8c9d0e1f2a3b4c5"]
}
Example response
{
"elements": {
"0190a1b2c3d4e5f6a7b8c9d0e1f2a3b4": { "text": "Shipping within Germany only." }
}
}
note

Products without a valid notice are missing from elements rather than appearing as null.

Admin API​

The gb_notice entity is available through the generic Admin API. The usual Shopware routes apply.

POST /api/search/gb-notice
Active notices only, newest first
{
"filter": [{ "type": "equals", "field": "active", "value": true }],
"sort": [{ "field": "createdAt", "order": "DESC" }],
"limit": 25
}

Create a notice​

POST /api/gb-notice
FieldTypeRequiredDescription
textstring (translatable)✓At most 255 characters
positionenumbelow_price, below_buy_button, description
validFromdatetimeStart of validity
validUntildatetimeEnd of validity

Update a notice​

PATCH /api/gb-notice/{id}

Only send changed fields. Translations via translations:

{
"translations": {
"en-GB": { "text": "Shipping within Germany only." }
}
}

Delete a notice​

DELETE /api/gb-notice/{id}
danger

Deleting also removes all assignments to products and categories. There is no recycle bin.

Events​

EventWhenUse
GbNoticeLoadedEventAfter a notice is loadedAdjust text or position
GbNoticeCriteriaEventBefore the database queryAdd custom filters
gb_notice.writtenAfter saving (DAL)Invalidate caches

GbNoticeLoadedEvent​

public function onNoticeLoaded(GbNoticeLoadedEvent $event): void
{
$notice = $event->getNotice();
$notice->setText(mb_strtoupper($notice->getText()));
}

GbNoticeCriteriaEvent​

public function onNoticeCriteria(GbNoticeCriteriaEvent $event): void
{
$event->getCriteria()->addFilter(new EqualsFilter('salesChannelId', $event->getSalesChannelId()));
}

Error codes​

CodeHTTPDescription
GB_NOTICE__INVALID_ID400Invalid UUID
GB_NOTICE__TOO_MANY_IDS400More than 100 IDs requested
GB_NOTICE__TEXT_TOO_LONG400Text longer than 255 characters
GB_NOTICE__NOT_FOUND404Notice does not exist

Compatibility​

PluginShopwarePHP
1.06.6.x8.2 – 8.3

See also Data model and Links.