您如何在Magento SOAP API中找到应用于订单的货件? [英] How do you find the shipments applied to an order in the Magento SOAP API?

查看:64
本文介绍了您如何在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:

  1. 使用sales_order.info API调用获取订单号(increment_id)的订单数据
  2. 从订单数据中获取order_id
  3. order_id用作sales_order_shipment.list
  4. 中的过滤器
  5. 这将为您提供每个带有increment_id的装运清单.此ID是货件的参考.
  6. 使用sales_order_shipment.info中货件的increment_id获取更多详细信息.
  1. Get the order data for your order number (increment_id) using sales_order.info API call
  2. get the order_id from the order data
  3. Use the order_id as a filter in sales_order_shipment.list
  4. This will give you a list of shipments each with an increment_id. This id is the shipment's reference.
  5. Use the shipment's increment_id in sales_order_shipment.info to get more details.

这篇关于您如何在Magento SOAP API中找到应用于订单的货件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆