---
schema_version: "1"
id: 00049f7647e532f5031d31ffc8a7f0800a3957f135f2ca57d8a8618da3e83cf9
title: Order Confirmation
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/salesforce-commerce/guides/d2c-commerce/b2b-comm-headless-order-confirmation.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-comm-headless-order-confirmation.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 525e974d30e6dfa6565b8b50d9184265e0c40c4985844e581923e7f57839bc97
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
# Order Confirmation

### Overview

The Order Confirmation page is shown immediately after a successful checkout and order placement. The page presents a summary of the completed order, including:

- Order number
- Purchased line items
- Pricing totals
- Shipping address
- Payment summary

The storefront retrieves the order summary using either the order reference number or the order summary ID, both of which are supported by the Order Summary APIs.

This flow demonstrates how a headless storefront can render order confirmation experiences, including order summaries, purchased items, pricing totals, shipping details, and payment information, using B2B Commerce Order Summary APIs.

![Order Confirmation Buyer Journey](https://developer.salesforce.com/media/d2c-commerce/b2b-headless-b2b-commerce-headless-flow-orchestration-order-confirmation-buyer-journey-26-1.png '{"class": "image-lg", "title": "Order Confirmation Buyer Journey"}')

### B2B Commerce APIs Used in the Flow

| Operation         | HTTP Method | Endpoint                                                                                                                                                                                                       |
| ----------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Get order summary | POST        | [`/commerce/webstores/{webstoreId}/order-summaries/actions/lookup`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_summary_lookup.htm) |

Some storefront implementations retrieve order data through multiple API calls, such as:

- GET [`/order-summaries/{orderSummaryId}`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_summary.htm)
- GET [`/order-summaries/{orderSummaryId}/items`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_shipment_items.htm)
- GET [`/order-summaries/{orderSummaryId}/delivery-groups`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_summary_delivery_groups.htm)
- GET [`/order-summaries/{orderSummaryId}/adjustments-aggregates`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_summaries_adjustment_aggregates.htm)

A single call to POST [`/commerce/webstores/{webstoreId}/order-summaries/actions/lookup`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_summary_lookup.htm) returns the complete order summary payload required by the Order Confirmation page in a single round trip. Prefer the lookup API approach to reduce network requests and improve page load performance.

### Buyer Journey

#### Render the Order Confirmation Page

1. Load the order confirmation page.

2. Call the following endpoint to retrieve the order summary:

   POST [`/commerce/webstores/{webstoreId}/order-summaries/actions/lookup`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_summary_lookup.htm)

   Example request body:

   ```json
   {
     "orderSummaryIdOrRefNumber": "<order-id>"
   }
   ```

3. Pass either of the following values in `orderSummaryIdOrRefNumber`:

   - Order summary ID
   - Order reference number

4. Use the POST variant of the lookup endpoint for both authenticated and guest order lookup flows. The endpoint also supports a GET request with the identifier passed as a query parameter, but the POST request provides a consistent implementation path across buyer types.

5. Use the response to retrieve:

   - Order line items from `deliveryGroups[].lineItems`
   - Payment details from `payments[].paymentMethod.fields`
   - Currency information from `currencyIsoCode`
   - Order totals from the `totals` field map

6. Render the order confirmation experience using the response data.

7. Display the following sections on the page:
   - Ordered items
   - Order totals
   - Ship-to address
   - Payment information

### Extend the Flow

This flow allows buyers to recreate a previous order by adding items from the original order to an active cart.

- Add a View Order Details action to retrieve richer order item metadata using:

  GET [`/commerce/webstores/{webstoreId}/order-summaries/{orderSummaryId}/items?fields=...`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_items.htm) This endpoint requires a valid `orderSummaryId` rather than an order reference number. Resolve the summary ID from the initial order lookup response before calling the order items API.

- Add a Reorder action using:

  POST [`/commerce/webstores/{webstoreId}/order-summaries/actions/add-order-to-cart`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_order_summaries_add_order_to_cart_action.htm?q=add-order-to-cart)

  Example request body:

  ```json
  {
    "orderSummaryId": "<orderSummaryId>",
    "cartId": "<optionalCartId>"
  }
  ```

## See Also

- [_B2B Commerce Developer Guide_: B2B Commerce Order Summary APIs](https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-d2c-comm-order-summaries-apis.html)
