cancel
Showing results for 
Search instead for 
Did you mean: 

API improvement: OrderInterface should have a getShippingAddress method

0 Kudos

API improvement: OrderInterface should have a getShippingAddress method

Feature request from phoenix-bjoern, posted on GitHub Oct 06, 2016

As a developer who writes an order export for Magento2 you would expect that besides the getBillingAddress there would be also a getShippingAddress method. While all the [g/s]etShipping... methods exists in the Magento\Sales\Model\Order model (which is the actual implementation of the OrderInterface) those elementary shipping-address methods are not part of the API interface.

Example: $order is declared as type Magento\Sales\Api\Data\OrderInterface. Practically the code "$order->getShippingAddress()" works but from a declarative view the method does not exist in the API and the implementation therefore is technically wrong.

While it is understood that not all orders have a shipping address (virtual orders/goods) the majority of orders processed in ecommerce actually have a shipping address. So the shipping-address methods should become part of the OrderInterface like it is already the case for the billing-address methods.

4 Comments
New Member

Comment from pboisvert, posted on GitHub Oct 07, 2016

Thanks Bjorn for the feedback. Will make sure the product owner for APIs sees this

New Member

Comment from phoenix-bjoern, posted on GitHub Oct 07, 2016

Thanks @pboisvert! already in touch with @choukalos :-)

New Member

Comment from pboisvert, posted on GitHub Oct 07, 2016

yes--Chuck knows about this area but owned currently by @mbrinton01

New Member

Comment from piotrekkaminski, posted on GitHub Oct 24, 2016

@PHOENIX-bjoern would you be willing to contribute this as a PR?