I am developing application using React-native an Magento as backend
How can i get invoice of order placed with rest api i tried like this can any one help me
Solved! Go to Solution.
Hello @pratap_penmetsa,
Please below REST endpoint URL to generate invoice
Endpoint URL: http://magento.com/index.php/rest/V1/order/{order_id}/invoice Request: POST Header: Authorization bearer {access-token}}
I have also tried above Rest API, You can check result here https://www.screencast.com/t/xOCyjalmT
After get invoice id, you can get invoice data by http://magento.com/index.php/rest/V1/invoices/{id} rest api, You can check more detail in my previous comment.
--
If my answer is useful, please Accept as Solution & give Kudos
Hello @pratap_penmetsa
Have you tried with
rest/V1/order/{order_id}/invoice
Order_id param is required in this
If you want invoice data you can follow below API url:
Here id you will get from previous API.
If this is not working at your end then there is something different issue.
Hello @pratap_penmetsa
are you using bundle products or parent products if yes this issue fixed in Magento 2.3 develop branch.
https://github.com/magento/magento2/issues/6988
@Manish Mittal can u help to get invoice for orders
which rest api should i use can u specify.
Please use below API
rest/V1/order/order_id/invoice
@Manish Mittal
I am using https://www.test.com/rest/V1/order/51/invoice. POST method.
51 is my order_id
I am sending body as below
{ "items": [ {"order_item_id": 51,"qty": 1} ] }
i am getting error response.
"message": "Invoice Document Validation Error(s):\nYou can't create an invoice without products.", what should i pass in body to generate invoice please help me.
For your reference:
https://github.com/magento/magento2/issues/6988
Basically Magento has two different types of bundle products: dynamic and fixed. That's why I need to add clarification for Expected Result:
I) Bundle dynamic product:
II) Bundle fixed product:
Hello @pratap_penmetsa,
Please below REST endpoints URL to get invoice data
Endpoint URL: http://magento.com/index.php/rest/V1/invoices/{id} Request: GET Header: Authorization bearer {access-token}}
I have also tried above Rest API, You can check result here https://www.screencast.com/t/8m6HdB5wl
Let me know if you have any trouble in it.
--
If my answer is useful, please Accept as Solution & give Kudos
Hello @pratap_penmetsa,
I have used invoice ID not order ID. Does it make sense? - Let me know if you get issue after using invoice id.
--
If my answer is useful, please Accept as Solution & give Kudos
Thanks for your reply, actually i am new to magento i don't know any thing about it, i am react native developer i am using magento as backend, After order is placed i am getting order_id only in response i am not getting any kind of invoice_id in response, how can i get invoice_id