# Commerce Webstore Checkout Place Order Action API

Use for advanced scenarios requiring better control, extensibility, and resilience through a staged workflow. The Commerce Webstore Checkout Place Order Action API is also referred to as Place Order V2 or Streamlined Place Order.

**Endpoint:** POST [`/commerce/webstores/{webstoreId}/checkouts/{activeOrCheckoutId}/orders/actions`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_checkouts_place_order_v2.htm)

**Prerequisite:** Streamlined Place Order enabled for webstore. See [Streamlined Place Order](https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-d2c-comm-streamlined-place-order.md)

**How it works:**

- The request must include an action in the body: `prepare` or `submit`.
- Two-step process:
  - Prepare – Performs validations and readiness checks.
  - Submit – Finalizes and creates order.
- On success, returns 200 OK (Submit returns ORN).
- On failure, returns 422 Unprocessable object.

**Orchestration:**

- Call Prepare before payments.
- Process payments.
- Call Submit after payments.

#### Prepare Action

Validates whether cart is ready for order placement.

**Supported cart states:**

- Checkout
- PendingClosed (returns early if already in this state).

**Extension support:**

- Custom validations via `Commerce_Domain_Checkout_PlaceOrder`. See [CheckoutPlaceOrder](https://developer.salesforce.com/docs/commerce/salesforce-commerce/references/comm-apex-reference/CheckoutPlaceOrder.md).

#### Submit Action

Finalizes and creates order.

**Supported cart states:**

- Checkout
- PendingClosed (returns existing OrderReferenceNumber (ORN) if already in this state)

**Execution flow:**

- Validations, inventory, coupon processing in Prepare.
- Order placement in Submit.
- Cart-to-order processing runs asynchronously after Submit.

**Extension support:**

- Custom validations via `Commerce_Domain_Checkout_PlaceOrder`. See [CheckoutPlaceOrder](https://developer.salesforce.com/docs/commerce/salesforce-commerce/references/comm-apex-reference/CheckoutPlaceOrder.md).
