2

How we can create shipment of a order using rest api.

3

3 Answers 3

2

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 !!

1
  • so 2448 should be simple or configurable product id if we use configurable products. Jun 26, 2019 at 13:03
2

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.

1

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

1
  • WOW, totally insane! Why it's like that? Of course not blaming you but Magento developers... Jul 20, 2023 at 15:16

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.