Attribute scenarios
Contents
- 1 Contents
- 2 Information
- 3 Sample data
- 4 Scenario 1: attributes in product request (type = list)
- 4.1 URL
- 4.2 Request sample
- 4.3 Visibility at PLP
- 5 Scenario 2: attributes in product request (type = dec/ int)
- 5.1 URL
- 5.2 Request sample
- 5.3 Visibility at PLP
- 6 Scenario 3: attributes in product request (type = text)
- 6.1 URL
- 6.2 Request sample
- 7 Scenario 4: Adding separate attributes to a product
- 7.1 URL
- 7.2 Request sample
- 7.3 Fields
Information
How to link product to attributes
Sample data
Option | Example attribute | Input valdiation | Input validation in Cloudsuite client | Visible at PLP | Visible at PDP |
---|---|---|---|---|---|
1 | Colour | list | Lijst met waardes / List with values | Yes with tickboxes | YES |
2 | Vezellengte | dec | Decimaal getal / Decimal number | YES as a slider | YES |
3 | Name product in ERP | none | Geen validatie, vrije tekst / No validation, free text | NO | YES |
Scenario 1: attributes in product request (type = list)
key: import key of the attribute property
value: import key of the attributelist value
URL
PUT /api/origin/{origin_code}/product/{key}/
PATCH /api/origin/{origin_code}/product/{key}/
Request sample
{
...
"attributes": [
{
"key": "Kleur",
"value": "Kleur_bordeaux"
}
...
]
Visibility at PLP
Only when the attribute property has the setting layered navigation
checked
Scenario 2: attributes in product request (type = dec/ int)
key: import key of the attribute property
value: numeric value. Numbers behind the comma is possible separated by a .
URL
PUT /api/origin/{origin_code}/product/{key}/
PATCH /api/origin/{origin_code}/product/{key}/
Request sample
"attributes": [
{
"key": "vezellengte",
"value": "44.5"
}
]
Visibility at PLP
Scenario 3: attributes in product request (type = text)
key: import key of the attribute property
value: free text
This text CANNOT be translated!
URL
PUT /api/origin/{origin_code}/product/{key}/
PATCH /api/origin/{origin_code}/product/{key}/
Request sample
"attributes": [
{
"key": "name_erp",
"value": "Ronde Patentkwast Blue Point 46-14"
}
]
Scenario 4: Adding separate attributes to a product
As mentioned when the field “attributes” is sent in the product call, always all connected attributes should be added in this field for that product. When you only want to add a new attribute to a product this can be done via the following call.
This method can be used with all the described scenario above
The existing attributes will NOT be deleted, so you need to have a different method (like sending in every attribute for the product) to handle deletes
URL
POST /api/origin/{origin_code}/product/{key}/attribute/{attribute_key}/
attribute_key is the import key of the attribute property
Request sample
[
{
"value":"kleur-rood",
"sequence":"1"
}
]
Fields
Field | Mandatory | Descriptions | Remarks |
---|---|---|---|
value | yes | Import key of the list value |
|
sequence | no | determines the order in which the attributes for this product will be displayed |
|
Related content
© 2024 CloudSuite BV, All rights reserved