on 2020 Feb 26 12:18 PM
With SAP Commerce 1808 the integration api with the according cockpit was introduced which enables creating a ODATA webservice for a certain type dynamically.
I tried to create a product and its classification attributes via this api as we get them from an external system.
Unfortunately I didn't find out how to create product feature values correctly.
When I send a product and its features as a POST request to my IntegrationObject, the item is created but the feature cannot be rendered correctly in Backoffice. The feature is displayed (Filtergrösse - de - 5.0) but is not editable and the unit is not shown.
How can we update classification attributes correctly?
The code is tested with a default 1905 version.
Impex for the integration object
INSERT_UPDATE IntegrationObject; code[unique = true]; integrationType(code)
; ProductsUpImport; INBOUND
INSERT_UPDATE IntegrationObjectItem; integrationObject(code)[unique = true]; code[unique = true]; type(code); root[default = false]
; ProductsUpImport ; ClassificationAttribute ; ClassificationAttribute ; ;
; ProductsUpImport ; MediaContainer ; MediaContainer ; ;
; ProductsUpImport ; ClassAttributeAssignment ; ClassAttributeAssignment ; ;
; ProductsUpImport ; Product ; Product ; true ;
; ProductsUpImport ; Category ; Category ; ;
; ProductsUpImport ; Language ; Language ; ;
; ProductsUpImport ; ProductFeature ; ProductFeature ; ;
; ProductsUpImport ; CatalogVersion ; CatalogVersion ; ;
; ProductsUpImport ; ClassificationClass ; ClassificationClass ; ;
; ProductsUpImport ; Catalog ; Catalog ; ;
; ProductsUpImport ; ClassificationSystemVersion ; ClassificationSystemVersion ; ;
; ProductsUpImport ; ClassificationAttributeUnit ; ClassificationAttributeUnit ; ;
; ProductsUpImport ; ClassificationSystem ; ClassificationSystem ; ;
INSERT_UPDATE IntegrationObjectItemAttribute; integrationObjectItem(integrationObject(code), code)[unique = true]; attributeName[unique = true]; attributeDescriptor(enclosingType(code), qualifier); returnIntegrationObjectItem(integrationObject(code), code); unique[default = false]; autoCreate[default = false]
; ProductsUpImport:ClassificationAttribute ; systemVersion ; ClassificationAttribute:systemVersion ; ProductsUpImport:ClassificationSystemVersion ; true ;
; ProductsUpImport:ClassificationAttribute ; code ; ClassificationAttribute:code ; ; true ;
; ProductsUpImport:MediaContainer ; catalogVersion ; MediaContainer:catalogVersion ; ProductsUpImport:CatalogVersion ; true ;
; ProductsUpImport:MediaContainer ; qualifier ; MediaContainer:qualifier ; ; true ;
; ProductsUpImport:ClassAttributeAssignment ; classificationClass ; ClassAttributeAssignment:classificationClass ; ProductsUpImport:ClassificationClass ; true ;
; ProductsUpImport:ClassAttributeAssignment ; classificationAttribute ; ClassAttributeAssignment:classificationAttribute ; ProductsUpImport:ClassificationAttribute ; true ;
; ProductsUpImport:Product ; supercategories ; Product:supercategories ; ProductsUpImport:Category ; ;
; ProductsUpImport:Product ; features ; Product:features ; ProductsUpImport:ProductFeature ; ;
; ProductsUpImport:Product ; code ; Product:code ; ; true ;
; ProductsUpImport:Product ; galleryImages ; Product:galleryImages ; ProductsUpImport:MediaContainer ; ;
; ProductsUpImport:Product ; catalogVersion ; Product:catalogVersion ; ProductsUpImport:CatalogVersion ; true ;
; ProductsUpImport:Product ; name ; Product:name ; ; ;
; ProductsUpImport:Category ; catalogVersion ; Category:catalogVersion ; ProductsUpImport:CatalogVersion ; true ;
; ProductsUpImport:Category ; code ; Category:code ; ; true ;
; ProductsUpImport:Language ; isocode ; Language:isocode ; ; true ;
; ProductsUpImport:ProductFeature ; product ; ProductFeature:product ; ProductsUpImport:Product ; true ;
; ProductsUpImport:ProductFeature ; qualifier ; ProductFeature:qualifier ; ; true ;
; ProductsUpImport:ProductFeature ; unit ; ProductFeature:unit ; ProductsUpImport:ClassificationAttributeUnit ; true ;
; ProductsUpImport:ProductFeature ; classificationAttributeAssignment ; ProductFeature:classificationAttributeAssignment ; ProductsUpImport:ClassAttributeAssignment ; ;
; ProductsUpImport:ProductFeature ; value ; ProductFeature:value ; ; ;
; ProductsUpImport:ProductFeature ; language ; ProductFeature:language ; ProductsUpImport:Language ; true ;
; ProductsUpImport:CatalogVersion ; catalog ; CatalogVersion:catalog ; ProductsUpImport:Catalog ; true ;
; ProductsUpImport:CatalogVersion ; version ; CatalogVersion:version ; ; true ;
; ProductsUpImport:ClassificationClass ; code ; ClassificationClass:code ; ; true ;
; ProductsUpImport:ClassificationClass ; catalogVersion ; ClassificationClass:catalogVersion ; ProductsUpImport:ClassificationSystemVersion ; true ;
; ProductsUpImport:Catalog ; id ; Catalog:id ; ; true ;
; ProductsUpImport:ClassificationSystemVersion ; catalog ; ClassificationSystemVersion:catalog ; ProductsUpImport:ClassificationSystem ; true ;
; ProductsUpImport:ClassificationSystemVersion ; version ; ClassificationSystemVersion:version ; ; true ;
; ProductsUpImport:ClassificationAttributeUnit ; code ; ClassificationAttributeUnit:code ; ; true ;
; ProductsUpImport:ClassificationAttributeUnit ; systemVersion ; ClassificationAttributeUnit:systemVersion ; ProductsUpImport:ClassificationSystemVersion ; true ;
; ProductsUpImport:ClassificationSystem ; id ; ClassificationSystem:id ; ; true ;
Testwebservice
POST https://localhost:9002/odata2webservices/ProductsUpImport/Products
JSON Payload
{
"@odata.context": "$metadata#Product/$entity",
"code": "test_article_features",
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
},
"supercategories" : [
{
"code": "1093",
"catalogVersion": {
"catalog": {
"id" : "ElectronicsClassification"
},
"version": "1.0"
}
}
],
"features": [
{
"qualifier": "ElectronicsClassification/1.0/1093.filter size, 1615",
"product" : {
"code": "test_article_features",
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
}
},
"classificationAttributeAssignment" : {
"classificationClass": {
"code": "1093",
"catalogVersion": {
"catalog": {
"id" : "ElectronicsClassification"
},
"version": "1.0"
}
},
"classificationAttribute": {
"code": "Filter size, 1615",
"systemVersion": {
"catalog": {
"id" : "ElectronicsClassification"
},
"version": "1.0"
}
}
},
"value": 5.0,
"language": {
"isocode": "de"
},
"unit": {
"code": "24",
"systemVersion": {
"catalog": {
"id" : "ElectronicsClassification"
},
"version": "1.0"
}
}
}
]
}
Request clarification before answering.
I have the same question I see that for impex you can make use of a translator i.e.
de.hybris.platform.catalog.jalo.classification.impex.ProductFeatureValueTranslator
But how would you achieve this with the integration API?
Best Regards,
Björn van den Broek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi fabian.saccilotto ,
How did you resolve the issue? What was wrong in the request?
Regards
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
16 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.