我想从Shopware V6 Admin API中填充所有子对象
我想从订单对象(例如交货,地址,付款方式等)中填充子对象 - 但是如何呢? 查询发布{{shop_url}}/api/search/order的帖子主体
"ids": ["xxx"],
"includes": {
"order": ["id", "orderNumber", "createdAt", "lineItems", "orderCustomer", "currency", "language", "salesChannel", "addresses", "billingAddress", "meta", "shippingCosts", "deliveries" ],
"order_line_item": ["label", "position", "quantity", "unitPrice", "productId", "product", "price"],
"product": ["ean"]
},
"associations": {
"lineItems": {
"associations": {
"product": []
}
}
}
}
我得到以下响应:
"deliveries": {
"data": [],
"links": {
"related": "https://xxx/api/order/<id>/deliveries"
}
},
有没有办法在我的第一个响应中从提供的链接中获取数据?如何?
I want to populate sub objects from order object like deliveries, addresses, paymentMethod, etc. - but how?
Query Body of POST against {{shop_url}}/api/search/order
"ids": ["xxx"],
"includes": {
"order": ["id", "orderNumber", "createdAt", "lineItems", "orderCustomer", "currency", "language", "salesChannel", "addresses", "billingAddress", "meta", "shippingCosts", "deliveries" ],
"order_line_item": ["label", "position", "quantity", "unitPrice", "productId", "product", "price"],
"product": ["ean"]
},
"associations": {
"lineItems": {
"associations": {
"product": []
}
}
}
}
I get following response:
"deliveries": {
"data": [],
"links": {
"related": "https://xxx/api/order/<id>/deliveries"
}
},
Is there a way to get data from provided link in my first response? How?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将要填充的对象添加到
sepociations
和incold
就像使用lineItems
一样。例如,使用此请求以获取交货,地址和付款方式:然后,您将在
中的响应中找到这些对象,包括
:You have to add the objects you want to populate to the
associations
andincludes
just like you did with thelineItems
. Use for example this request to get deliveries, addresses and payment method:Then you will find those objects in the response in
included
: