您如何在Magento SOAP API中找到应用于订单的货件? [英] How do you find the shipments applied to an order in the Magento SOAP API?
问题描述
以下是销售订单的API文档: http://www.magentocommerce.com/api/soap/sales /salesOrder/sales_order.info.html
Here is the API Documentation for a Sales Order: http://www.magentocommerce.com/api/soap/sales/salesOrder/sales_order.info.html
以下是货件的API文档: http://www.magentocommerce.com/api/soap/sales/salesOrderShipment /salesOrderShipment.html
Here is the API documentation for a Shipment: http://www.magentocommerce.com/api/soap/sales/salesOrderShipment/salesOrderShipment.html
我无法为自己的一生弄清楚如何在他们之间建立关系.订单/信息端点似乎未返回任何种类的shipping_id,并且订单/装运端点似乎不可被order_id过滤.
I cannot for the life of me figure out how to establish a relationship between them. The order/info endpoint doesn't seem to return a shipment_id of any kind and the order/shipment endpoint doesn't seem to be filterable by order_id.
推荐答案
这可以通过在订单的order_id
值上使用过滤器来实现.
This is possible by using a filter on the order's order_id
value.
请注意,order_id
与订单的increment_id
不同,后者是通常的面向客户的参考号.因此,需要一个额外的步骤才能将订单的引用转换为order_id
.
Note that order_id
is different to the order's increment_id
which is the usual customer facing reference number. Therefore an extra step is required to convert the order's reference into the order_id
.
我不能给您工作的PHP代码,我正在使用Java,但是我可以描述该方法:
I can't give you working PHP code, I'm working in Java, but I can describe the method:
- 使用
sales_order.info
API调用获取订单号(increment_id
)的订单数据 - 从订单数据中获取
order_id
- 将
order_id
用作sales_order_shipment.list
中的过滤器
- 这将为您提供每个带有
increment_id
的装运清单.此ID是货件的参考. - 使用
sales_order_shipment.info
中货件的increment_id
获取更多详细信息.
- Get the order data for your order number (
increment_id
) usingsales_order.info
API call - get the
order_id
from the order data - Use the
order_id
as a filter insales_order_shipment.list
- This will give you a list of shipments each with an
increment_id
. This id is the shipment's reference. - Use the shipment's
increment_id
insales_order_shipment.info
to get more details.
这篇关于您如何在Magento SOAP API中找到应用于订单的货件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!