如何通过Restful API的方式读取SAP Commerce Cloud的Product Reference

从SAP官网上找到api的说明:

https://api.sap.com/api/commerce_services/resource

api endpoint: /rest/v2/electronics/products/I042416/references

其中referenceType参数的值从枚举类ProductReferenceTypeEnum里获得:

下图是Hybris commerce On-Premises里对应的代码,当然也可以查询SAP帮助文档找到这些枚举值:

这种reference关系类似于CRM里的relationship,可以到表ProductReference里查询获得:


要调用这个API,必须创建一个grant_type为client_credentials的oauth client:

并且authorities要维护成ROLE_TRUSTED_CLIENT:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

原文地址:https://www.cnblogs.com/sap-jerry/p/11797006.html