DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsCheckoutOrder Confirmation
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Create OrderPayment ProcessingOrder ConfirmationFreestyle Bundle Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Order Confirmation

Retrieve order details after successful checkout.

Updated March 29, 2026

On this page
  • Overview
  • Using the Checkout Response
  • Confirmation Page Example
  • Guest Checkout: Auto-Login
  • Retry Failed Payments
  • Next Steps

Overview

After a successful checkout, display an order confirmation page with the order details. The checkout.complete() response contains everything you need.

Using the Checkout Response

typescript
const { order, customer, access_token } = await dash.checkout.complete({
  cartId: dash.cart.cartId,
  shipping: { ... },
  payment_token: { token, descriptor },
})

// Redirect to confirmation page with order ID
router.push(`/order-confirmation?id=${order.id}`)

Confirmation Page Example

typescript
// app/order-confirmation/page.tsx
import dash from "@/lib/dash"

export default async function OrderConfirmation({ searchParams }) {
  // If customer is authenticated, fetch the order
  const { order } = await dash.auth.getOrder(searchParams.id)

  return (
    <div className="max-w-2xl mx-auto py-12">
      <h1>Order Confirmed!</h1>
      <p>Thank you for your purchase.</p>

      <div className="border rounded p-6 mt-6">
        <p><strong>Order Number:</strong> {order.order_number}</p>
        <p><strong>Status:</strong> {order.status}</p>
        <p><strong>Total:</strong> ${order.total}</p>

        <h2 className="mt-4">Items</h2>
        {order.items.map(item => (
          <div key={item.size_id} className="flex justify-between">
            <span>{item.product_name} ({item.size_label}) × {item.quantity}</span>
            <span>${item.subtotal}</span>
          </div>
        ))}

        <div className="border-t mt-4 pt-4">
          <div className="flex justify-between"><span>Subtotal</span><span>${order.subtotal}</span></div>
          <div className="flex justify-between"><span>Shipping</span><span>${order.shipping}</span></div>
          <div className="flex justify-between"><span>Tax</span><span>${order.tax}</span></div>
          {order.discount !== "0.00" &&
            <div className="flex justify-between text-green-500">
              <span>Discount</span><span>-${order.discount}</span>
            </div>
          }
          <div className="flex justify-between font-bold text-lg">
            <span>Total</span><span>${order.total}</span>
          </div>
        </div>
      </div>

      <div className="mt-6">
        <a href="/products">Continue Shopping</a>
        <a href="/account/orders">View Order History</a>
      </div>
    </div>
  )
}

Guest Checkout: Auto-Login

For guest checkouts, the response includes auth tokens. Store them to automatically log the customer in:

typescript
const { order, access_token, refresh_token } = await dash.checkout.complete({ ... })

if (access_token) {
  // Guest was auto-registered — save tokens
  localStorage.setItem("dash_token", access_token)
  localStorage.setItem("dash_refresh", refresh_token)
  dash.auth.setToken(access_token, refresh_token)
}

// Reset the cart after successful order
dash.cart.reset()

Retry Failed Payments

If payment failed but the order was created, use the repayment endpoint:

shell
POST /storefront/checkout/repayment
X-API-Key: pk_live_your_key
Content-Type: application/json

{
  "order_id": "ord_abc123",
  "payment_token": { "token": "tok_new", "descriptor": "..." }
}

Next Steps

  • List Orders — Viewing order history
  • Order Statuses — Understanding the order lifecycle
  • Order Notifications — Email notifications after checkout
  • Storefront Views — Tracking conversions
PreviousPayment ProcessingNextFreestyle Bundle Checkout

On this page

  • Overview
  • Using the Checkout Response
  • Confirmation Page Example
  • Guest Checkout: Auto-Login
  • Retry Failed Payments
  • Next Steps