1

I am trying to use the Rest API to create partial shipments for Magneto 2 orders. In two different scenarios.

First is one item with multiple pieces, say a customer ordered 4 pieces of sku 3 but I only ship 1 piece. I send the message to

https://test.m2.test.com/index.php/rest/V1/order/61845/ship

with body

{"entity":{"order_id":"61845","items":[{"order_item_id":"3","qty":"1"}]}}

I get a valid response "44360" but when I check the order in the admin I see

Ordered 4

Shipped 4.

I have tried the message with just the items

{"entity":{"items":[{"order_item_id":"3","qty":"1"}]}}

and with actual item id

{"entity":{"order_id":"61845","items":[{"order_item_id":"77130","qty":"1"}]}}

{"entity":{"items":[{"order_item_id":"77130","qty":"1"}]}}

every one of them yields the same result

Ordered 4

Shipped 4.

The second scenario is with multiple items in the order; if I ship one item but not the other both are shown as fully shipped.

It basically appears that the application is just seeing the order_id in the POST path and marks everything in that order as shipped in full.

Any help is greatly appreciated.

1 Answer 1

1

For partial shipments you can use the following webservice:

https://devdocs.magento.com/swagger/#/salesShipmentRepositoryV1/salesShipmentRepositoryV1SavePost

/rest/V1/shipment enter image description here

The only set back is that you will have to update the qty_shipped of your order_item manually. For that you can use the order repository.

https://devdocs.magento.com/swagger/#/salesOrderRepositoryV1/salesOrderRepositoryV1SavePost

let me know if you need any further assistance !

2
  • That was very helpful and helped resolve my issue. I have run into a similar thing with invoices as well; are partial invoices possible with authorize.net?
    – calalli
    Aug 13, 2020 at 15:40
  • I don't use authorize.net . I use this webservice, devdocs.magento.com/swagger/#/salesInvoiceRepositoryV1 You can invoice a partial amount but you have to pass a lot of information into the webservice in order to it correctly.
    – Joao71
    Aug 13, 2020 at 15:51

Your Answer

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

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