This is a beta release of documentation for Magento 2.4, published for previewing soon-to-be-released functionality. Content in this version is subject to change. Links to the v2.4 code base may not properly resolve until the code is officially released.

Step 9. Create an order

Order processing with Inventory Management

The shopping cart contains 71 items totaling $2462. The shipping charges are $350, making the grand total $2812. We’re now ready to convert the quote to an order.

When you create an order, Magento enters reservations for the total amount of products. These reservations place a hold on that amount of inventory per stock, temporarily deducting the amount from the salable quantity. On the Products page of Admin, the Salable Quantity column accounts for reservations. When an order is shipped, Magento updates the quantities in the Quantity per Source column.

Send payment information

When you submit payment information, Magento creates an order and sends an order confirmation to the customer. Since we are using an offline payment method in this tutorial, we do not need to provide detailed payment information. The endpoint used in this example requires only the payment method and billing address information.

Endpoint:

POST <host>/rest/us/V1/carts/mine/payment-information

Scope:

us store view

Headers:

Content-Type: application/json

Authorization: Bearer <customer token>

Payload:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "paymentMethod": {
    "method": "banktransfer"
  },
  "billing_address": {
    "email": "jdoe@example.com",
    "region": "New York",
    "region_id": 43,
    "region_code": "NY",
    "country_id": "US",
    "street": ["123 Oak Ave"],
    "postcode": "10577",
    "city": "Purchase",
    "telephone": "512-555-1111",
    "firstname": "Jane",
    "lastname": "Doe"
  }
}

Response:

An orderID, such as 3

Verify this step

  1. Log in to the US store as the customer. The dashboard shows the order.
  2. Log in to Admin. Click Sales > Orders. The order is displayed in the grid. Its status is Pending.
  3. Click Catalog > Products. The Salable Quantity column shows that fewer items of the ordered products are available. The values in the Quantity per Source are not affected until shipment.