In this part of the documentation you can learn more about the API's manufacturers resource. With this resource, it is possible to retrieve, update and delete any manufacturer data of your shop. We will also have a look at the associated data structures.
This resource supports the following operations:
Access URL | GET | GET (List) | PUT | PUT (Batch) | POST | DELETE | DELETE (Batch) |
---|---|---|---|---|---|---|---|
/api/manufacturers |
If you want to access this resource, simply query the following URL:
Single manufacturer details can be retrieved via the manufacturer ID:
Model | Table |
---|---|
Shopware\Models\Article\Supplier | s_articles_supplier |
Field | Type | Original Object |
---|---|---|
id | integer (primary key) | |
name | string | |
image | string (foreign key, path) | Media |
link | string | |
description | string | |
metaTitle | string | |
metaKeywords | string | |
metaDescription | string | |
attribute | array |
For this operation, no parameters are required. To get a list of all manufacturers, simply query:
Model | Table |
---|---|
Shopware\Models\Article\Supplier | s_articles_supplier |
This API call returns an array of elements, one for each manufacturer. Each of these elements has the following structure:
Field | Type | Original Object |
---|---|---|
id | integer (primary key) | |
name | string | |
image | string | |
link | string | |
description | string | |
metaTitle | string | |
metaKeywords | string | |
metaDescription | string |
Appended to the above-mentioned list, you will also find the following data:
Field | Type | Comment |
---|---|---|
total | integer | The total number of manufacturer resources |
success | boolean | Indicates if the call was successful or not. |
POST
and PUT
operations support the following data structure:
Model | Table |
---|---|
Shopware\Models\Article\Supplier | s_articles_supplier |
Field | Type | Comment | Original Object / Database Column |
---|---|---|---|
name (required) | string | ||
id | integer (primary key) | If null, a new entity will be created | s_articles_supplier.id |
image | array | Array with either mediaId or link property; can be null or an empty object to delete an image assignment from an existing manufacturer |
|
link | string | ||
description | string | ||
metaTitle | string | ||
metaKeywords | string | ||
metaDescription | string | ||
changed | date/time | ||
attribute | array | Array with optional indexes from 1-6 and its values |
{
"name": "My manufacturer with image",
"image":
{
"link": "http://my-image-url/path/to/image.png"
}
}
{
"name": "My manufacturer without image",
"image": null
}
To delete a cache, simply call the specified resource with the DELETE
operation as the following example shows:
Replace the id
with the specific manufacturer id.