+49 69 83008980 service@xqueue.com
Benötigen Sie Hilfe?

Im Maileon Help-Center finden Sie umfassende Dokumentationen zu unserem System.

Beliebte Suchanfragen: Importe | Rest-API | Integrationen | SMS

Shopware 6 – Article Documentation

Sie sind hier:

This document describes which product data is retrieved from the Shopware 6 Admin API and which fields are available on the Shopware6Article object. The client authenticates via OAuth2 Client Credentials and queries the /api/search/product endpoint.

1. Lookup Methods (Input)

Products can be retrieved using one of two methods. The following parameters are used as input to query Shopware 6:

Method Input Field Type Description
getArticleById(id) Product UUID String (UUID) Internal Shopware product UUID, e.g. f1d2c3b4-…
getArticleByNumber(number) productNumber String The product’s article number / SKU, e.g. SW10001

 

2. Available Article Fields (Output)

Once a product is retrieved, the following fields are accessible on the Shopware6Article object. Fields marked „Article“ are part of the generic Article interface; fields marked „SW6 only“ are Shopware 6 specific and not available in other integrations.

 

Method API Source Field Return Type Interface Notes
getId() id String SW6 only Internal product UUID
getName() translated.name / name String Article Product name, translated if available
getShortDescription() translated.description / description String Article Uses description field; no separate short description in SW6
getDescription() translated.description / description String Article Full HTML or plain-text product description
getSku() productNumber String Article Article number / SKU used for lookup
getUrl() id String Article Constructed as: baseUri + /detail/ + id
getTaxRate() tax.taxRate double Article Tax rate in percent, e.g. 19.0; returns 0.0 if not present
getPrice() price[0].net double Article Net price from first price entry; -1 if not available
getPriceWithTax() price[0].net + tax.taxRate double Article Calculated: net × (1 + taxRate / 100); -1 if not available
isActive() active boolean SW6 only Whether the product is active in Shopware
isAvailable() available boolean SW6 only Whether the product is available for purchase
getStock() stock int SW6 only Total stock quantity; -1 if not present
getAvailableStock() availableStock int SW6 only Currently purchasable stock quantity; -1 if not present
getChildCount() childCount int SW6 only Number of variant children; 0 if none
hasVariants() childCount boolean SW6 only True if childCount > 0
getCustomFields() customFields JSONObject SW6 only Full custom fields object; null if not present
getCustomAttribute(name) customFields.<name> Object SW6 only Value of a specific custom field by key
getCoverImageUrl() cover.media.url String Article Absolute URL of cover image; prepends baseUri if relative
getSupplierName() manufacturer.translated.name / manufacturer.name String Article Manufacturer name, translated if available
getSupplierUrl() manufacturer.link String Article Manufacturer website link
getSupplierImageUrl() manufacturer.media.url String Article Absolute URL of manufacturer logo; prepends baseUri if relative
getKeywords() tagIds String[] Article Array of tag IDs assigned to the product

3. Associations Loaded from API

The Shopware 6 Admin API does not expand related entities automatically. The client explicitly requests the following associations with every product query, which is why the above fields for images, manufacturer, and variants are populated:

 

Association Nested Data Loaded Purpose
cover cover.media Cover image with full media object (URL, filename, etc.)
manufacturer manufacturer.media Manufacturer details including logo media
categories categories[ ] Assigned product categories
properties properties[ ] Product properties (e.g. colour, material)
options options[ ] Variant options (used for configurable products)

4. Notes

  1. Translated fields: Name and description are read from the translated sub-object first. If not present there, the raw root field is used as a fallback.
  2. Price: Only the first price entry (index 0) is evaluated. The net value is returned by getPrice(); getPriceWithTax() calculates gross from net and taxRate.
  3. Image URLs: If the URL returned by the API is relative (does not start with „http“), the configured baseUri is prepended automatically.
  4. Custom fields: Any Shopware custom field can be retrieved by name using getCustomAttribute(„field_name“). The full object is available via getCustomFields().
  5. sw-inheritance header: All API requests include the sw-inheritance: 1 header so that inherited variant data is resolved automatically.

 

 

 

 

 

Inhaltsverzeichnis