1

I am trying to create an order using magento 2 rest api.But the shipping address is not adding with order details.Because of no shipping address the order is in incomplete format

http://127.0.0.1/netmeds_mage/rest/V1/orders/create

Method : PUT

This is the json request :

{"entity":{"base_currency_code":"INR","base_discount_amount":0,"base_grand_total":38,"base_shipping_amount":5,"base_shipping_incl_tax":5,"base_shipping_tax_amount":0,"base_shipping_discount_amount":0,"base_subtotal":33,"base_subtotal_incl_tax":33,"base_total_due":38,"base_to_global_rate":1,"base_to_order_rate":1,"discount_tax_compensation_amount":0,"base_discount_tax_compensation_amount":0,"shipping_discount_tax_compensation_amount":0,"customer_is_guest":0,"customer_dob":"Jan 18, 1987","customer_email":"[email protected]","customer_firstname":"Sharvesh","customer_gender":1,"customer_group_id":1,"customer_id":4,"customer_lastname":"CP","customer_note_notify":1,"discount_amount":0,"email_sent":1,"global_currency_code":"INR","grand_total":38,"order_currency_code":"INR","remote_ip":"127.0.0.1","shipping_amount":5,"shipping_tax_amount":0,"shipping_description":"Flat Rate - Fixed","shipping_discount_amount":0,"shipping_incl_tax":5,"state":"pending","status":"pending","store_currency_code":"INR","store_to_base_rate":0,"store_to_order_rate":0,"store_id":1,"subtotal":33,"subtotal_incl_tax":33,"total_due":38,"total_item_count":1,"total_qty_ordered":1,"tax_amount":0,"weight":1,"items":[{"base_original_price":33,"base_price":33,"base_price_incl_tax":33,"base_row_total":33,"base_row_total_incl_tax":33,"name":"Endeavor Daytrip Backpack","original_price":33,"price":33,"price_incl_tax":33,"product_id":11,"product_type":"simple","qty_ordered":1,"row_total":33,"row_total_incl_tax":33,"sku":"24-WB06","store_id":1,"weight":1}],"billing_address":{"address_type":"billing","city":"Chennai","company":"Netmeds","country_id":"IN","customer_address_id":4,"email":"[email protected]","firstname":"Sharvesh","lastname":"C","postcode":"600117","region":"Tamilnadu","street":["6A,4th street,Keelkattalai"],"telephone":"9840626148"},"payment":{"amount_ordered":38,"base_amount_ordered":38,"base_shipping_amount":5,"method":"checkmo","shipping_amount":5},"status_histories":[],"extension_attributes":{"shipping_assignments":[{"shipping":{"address":{"address_type":"shipping","city":"Chennai","company":"Netmeds","country_id":"IN","customer_address_id":4,"email":"[email protected]","firstname":"Sharvesh","lastname":"C","postcode":"600117","region":"Tamilnadu","street":["6A,4th street,Keelkattalai"],"telephone":"9840626148"},"method":"flatrate_flatrate","total":{"base_shipping_amount":5,"base_shipping_incl_tax":5,"shipping_amount":5,"shipping_incl_tax":5},"extension_attributes":[]},"items":[{"base_original_price":33,"base_price":33,"base_price_incl_tax":33,"base_row_total":33,"name":"Endeavor Daytrip Backpack","original_price":33,"price":33,"price_incl_tax":33,"product_id":11,"product_type":"simple","qty_ordered":1,"row_total":33,"row_total_incl_tax":33,"sku":"24-WB06","store_id":1,"weight":1}],"extension_attributes":[]}],"applied_taxes":[],"item_applied_taxes":[],"converting_from_quote":true}}}

whether am missing anything or i need to add anything.

2 Answers 2

1

have found the solution and worked for me

pls refer this link https://github.com/magento/magento2/issues/5544

0

I have gone through the same issue. Later on, I found that we have to send a valid address according to the country configured in your store configuration.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.