Step 10. Create an invoice

Order processing with Inventory Management

You create an invoice after you receive payment for an order. In this example, the order was paid offline via a bank transfer. Therefore, you must tell Magento that payment for the order has been captured.

After you submit the invoice, Magento adjusts the Quantity per Source value for non-physical products.

Capture payment

This example creates a full invoice.

Endpoint:

POST <host>/rest/us/V1/order/3/invoice

where 3 is the orderid

Scope:

us store view

Headers:

Content-Type: application/json

Authorization: Bearer <admin token>

Payload:

1
2
3
4
{
  "capture": true,
  "notify": true
}

Response:

An invoice id, such as 3.

Verify this step

  1. Click Sales > Invoices. The invoice displays in the grid with a status of Paid. Then click Sales > Orders. The status is Processing.

  2. Click Catalog > Products. For vp1, Magento adjusted the value of Quantity per Source and Salable Quantity to 9998 for all sources and stocks.