magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

Sales Order Shipping Address #2628

Closed jhildreth closed 8 years ago

jhildreth commented 8 years ago

I anticipated that the response to a GET request against the /V1/orders API endpoint would include the shipping address for each sales order, but it does not appear to. It does include the billing address for each order.

I'm not seeing a good alternative endpoint for retrieving the shipping address - what am I missing? How do I get the shipping address for a sales order via the API?

Thanks!

thomasnordkvist commented 8 years ago

I'm also intressted in how to get the shipping address and i don't see any solution in the api documentation. But reading this #2382 i understand that it has been removed and some other solution will be there in the future? But when in the future?

jhildreth commented 8 years ago

Thanks a lot @thomasnordkvist for referencing that issue, I hadn't come across it in my searches. Is there anyone that can shed some light about an existing or soon-to-be-released method for retrieving the shipping address via the API, or is customization the only way? That question was raised in #2382 , but it doesn't look like it was addressed. I understand the decision to have shipping information on the individual sales order items, but it doesn't seem to be there yet. The sales order API isn't helpful to me from an integration standpoint if I can't get the shipping address.

thomasnordkvist commented 8 years ago

@jhildreth The answer is here: http://magento.stackexchange.com/questions/93143/magento2-how-to-get-shipping-address-for-order-in-rest-api

I think the magento people want this issue to be closed as soon as possible, because it might be more of a http://magento.stackexchange.com/questions/tagged/magento2 thing than a github issue.

/Thomas

jhildreth commented 8 years ago

Fair enough, thanks a lot for the help @thomasnordkvist!

choukalos commented 8 years ago

This is a bug; it should have been exposed and linked per @paliarush comment on stack exchange. Creating Bug MAGETWO-46720

thomasnordkvist commented 8 years ago

Ok so it is a bug!

Good to know that this functionality will not change much from how i use it now, other than the function path.

/Thomas

jhildreth commented 8 years ago

Glad to hear it's a bug. Thanks for the update!

jhildreth commented 8 years ago

The release notes for 2.0.1 say: "Shipping address in the Orders API now exposes the shipping address value.", which I believe should address this issue. However, after upgrading to 2.0.1, I'm still not seeing the shipping address on the data returned from /orders. Am I misunderstanding what this addresses? Thanks!

mujtaba2012 commented 8 years ago

Any info on when this fix is coming out?

karanbhomiagit commented 8 years ago

Hi @NadiyaS Any ETA on this bug fix to be released?

choukalos commented 8 years ago

This should be addressed by the commits pushed on Feb 26th; closing.

davidalger commented 8 years ago

Delivered in version 2.0.3

karanbhomiagit commented 8 years ago

@davidalger , @choukalos : I see that the shipping address is coming as part of response json to /rest/V1/orders GET call. Any particular reason the shipping address is coming under the "extension_attributes" section? Given that the "billing_address" comes as a separate section itself, would "shipping_address" be moved to a separate section, or would it always be under "extension_attributes" section?

"extension_attributes": { "shipping_assignments": [ { "shipping": { "address": { "address_type": "shipping", "city": "redwood city", "company": "a", "country_id": "US", "customer_address_id": 1, "email": "a@b.com", "entity_id": 1, "firstname": "Test Customer", "lastname": "Last", "parent_id": 1, "postcode": "94034", "region": "California", "region_code": "California", "region_id": 12, "street": [ "test street" ], "telephone": "3345678885" }, "method": "flatrate_flatrate", "total": { "base_shipping_amount": 20, "base_shipping_discount_amount": 0, "base_shipping_discount_tax_compensation_amnt": null, "base_shipping_incl_tax": 20, "base_shipping_tax_amount": 0, "shipping_amount": 20, "shipping_discount_amount": 0, "shipping_discount_tax_compensation_amount": 0, "shipping_incl_tax": 20, "shipping_tax_amount": 0 }

timtt-zz commented 8 years ago

When getting multiple orders in one call in 2.0.4, the shipping address is unfortunately incorrect. For a single order it works fine, but for multiple orders, the shipping address in extension attributes is the same for every order. If I have orders 1, 2, and 3, the shipping address for each of them will the one in order 3 - the last one in the call. Should this be filed as a separate bug?

karanbhomiagit commented 8 years ago

@timtt : Same thing happened for me too. @davidalger , @choukalos : Can you please confirm and reopen this bug/tell us to create a new bug.

choukalos commented 8 years ago

Yes this should be filed as a separate bug - I see the linked github issue and will make sure there's a corresponding internal ticket filed under #4019.

RUjmiak commented 8 years ago

Is it possible to add shipping address to cart without setting shipping method? As it is possible with billing address (POST /V1/carts/mine/billing-address)