How to create Invoice using Rest API Magento 2?

Magento 2 is robust,scalable and multi feature enable eCommerce platform. You can create Invoice of an Order Using an third party platform to Magento 2 by API request.

For Create order, Create order using Rest API Magento 2

For Create Shipment Using API, Create Shipment using Rest API Magento 2
Using below payload you can create Shipment of an order using any third party platform to Magento 2. you Just need to pass below payload in your request with POST data.

Request:
{YOUR_URL}/rest/V1/order/{order_id}/invoice

Type: POST

Body:

{
  "capture": true,
  "items": [
    {
      "extension_attributes": {},
      "order_item_id": 82,
      "qty": 1
    }
  ],
  "notify": true,
  "appendComment": true,
  "comment": {
    "extension_attributes": {},
    "comment": "Order Invoice generate",
    "is_visible_on_front": 0
  },
  "arguments": {
    "extension_attributes": {}
  }
}

Pass order_item_id is your order item’s id don’t pass order id in order_item_id field. Pass order_id in reqeuest Url. You can create multiple request using pass multi array in items array.

Response:
10 (new Invoice id)