> ## Documentation Index
> Fetch the complete documentation index at: https://docs.waffo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Endpoints

> Create checkout sessions and manage orders

The order flow follows a session-based checkout pattern:

1. **Create a checkout session** -- locks the product version, pricing, and currency
2. **Preview tax** -- calculates tax based on the customer's billing details
3. **Create an order** -- initiates payment and returns a PSP-hosted checkout URL
4. **Cancel an order** -- cancels a pending (unpaid) order before payment completes

## One-Time Order Status Values

| Status      | Description                                                  |
| ----------- | ------------------------------------------------------------ |
| `pending`   | Order created, awaiting payment. Can be canceled.            |
| `completed` | Payment succeeded, order fulfilled.                          |
| `canceled`  | Order canceled before payment was completed. Terminal state. |

## Endpoints

<CardGroup cols={2}>
  <Card title="Create Checkout Session" icon="cart-plus" href="/api-reference/endpoints/orders/create-checkout-session">
    Lock product version and pricing for checkout
  </Card>

  <Card title="Preview Tax" icon="calculator" href="/api-reference/endpoints/orders/preview-tax">
    Calculate tax before creating an order
  </Card>

  <Card title="Cancel One-Time Order" icon="ban" href="/api-reference/endpoints/orders/cancel-onetime-order">
    Cancel a pending order before payment
  </Card>
</CardGroup>
