2

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

0

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

| improve this answer | |
  • so 2448 should be simple or configurable product id if we use configurable products. – Charul Tyagi Jun 26 '19 at 13:03
0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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