Skip to content

M2.1 API salesOrderRepositoryV1 can't create shpping address #5544

Closed
@5zymon

Description

@5zymon

Hello, I am not sure if this is Magento issue or lack of documentation, but I just stuck for a longer while and I just can't find anything wrong on my end.

I am importing orders using salesOrderRepositoryV1 and REST API. I am providing shipping details in extension attributes

public 'extension_attributes' =>
object(stdClass)[590]
public 'shipping_assignments' =>
array (size=1)
0 =>
object(stdClass)[595]
public 'shipping' =>
object(stdClass)[602]
public 'address' =>
object(stdClass)[599]
public 'address_type' => string 'shipping' (length=8)
public 'city' => string 'City' (length=8)
public 'country_id' => string 'US' (length=2)
public 'email' => string '[email protected]' (length=25)
public 'entity_id' => int 3
public 'firstname' => string 'Test' (length=6)
public 'lastname' => string 'Testing' (length=5)
public 'parent_id' => int 2
public 'postcode' => string '40-029' (length=6)
public 'street' =>
array (size=1)
0 => string 'Some Street 18/8' (length=13)
public 'telephone' => string '2134414124' (length=10)
public 'method' => string 'flatrate_flatrate' (length=17)
public 'total' =>
object(stdClass)[596]
public 'base_shipping_amount' => int 5
public 'base_shipping_canceled' => int 5
public 'base_shipping_discount_amount' => int 0
public 'base_shipping_discount_tax_compensation_amnt' => null
public 'base_shipping_incl_tax' => int 5
public 'base_shipping_tax_amount' => int 0
public 'shipping_amount' => int 5
public 'shipping_canceled' => int 5
public 'shipping_discount_amount' => int 0
public 'shipping_discount_tax_compensation_amount' => int 0
public 'shipping_incl_tax' => int 5
public 'shipping_tax_amount' => int 0

The order is created in magento, Billing Details are fine when I try to view the order in backend I get this:

Fatal error: Call to a member function getId() on null in /var/www/magento_2/vendor/magento/module-sales/Block/Adminhtml/Order/View/Info.php on line 227

When I check order in database "sales_order_address" table, there is billing address inserted, but there is no sign of shipping address in there.

Metadata

Metadata

Assignees

Labels

Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions