How we can create shipment of a order using rest api.
-
Check this devdocs.magento.com/guides/v2.3/rest/tutorials/orders/…nishu– nishu2019年06月26日 11:44:08 +00:00Commented Jun 26, 2019 at 11:44
-
can you tell me the parameters for json that need to be send?Magento Dev– Magento Dev2019年06月26日 11:46:09 +00:00Commented Jun 26, 2019 at 11:46
-
Please check below link to create the shipment using rest API : rakeshjesadiya.com/…Oscprofessionals– Oscprofessionals2019年06月26日 11:46:53 +00:00Commented Jun 26, 2019 at 11:46
3 Answers 3
Api Link : {base_url}/index.php/rest/default/V1/order/291/ship Order ID and increment ID is not same
Here 291 is order_id not a Increment Id
Sample Body:
{
"items": [
{
"order_item_id": 2448,
"qty": 1
},
{
"order_item_id": 2449,
"qty": 1
}
]
}
You can get "order_item_id" from fetching order info through API. Hope it helps !!
-
so 2448 should be simple or configurable product id if we use configurable products.Magento Dev– Magento Dev2019年06月26日 13:03:52 +00:00Commented Jun 26, 2019 at 13:03
I have researched on this and found an answer.
URL : http://domain/rest/V1/order/237/ship -:- where 237 is the order id
Method: post
Input Parameters :
{
"items": [
{
"order_item_id": 623,
"qty": 1
}
],
"notify": true,
"appendComment": true,
"comment": {
"extension_attributes": {},
"comment": "comment on shipment",
"is_visible_on_front": 1
},
"tracks": [
{
"track_number": "123456",
"title": "fedex Shipment",
"carrier_code": "fedex"
}
]
}
This will create shipment and notify the customer also.
If you have configurable products, please use simple item’s parent_item_id field. It is unique id even the simple product is under same configurable product.
item_id": 1518, "name": "IVORY LONGLINE TEE S", "no_discount": 0, "order_id": 534, "original_price": 0, "parent_item_id": 1515,
Thanks
-
WOW, totally insane! Why it's like that? Of course not blaming you but Magento developers...Marco Ottolini– Marco Ottolini2023年07月20日 15:16:10 +00:00Commented Jul 20, 2023 at 15:16