> ## 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.

# 订单端点

> 创建收银台会话和管理订单

订单流程遵循基于会话的收银台模式：

1. **创建收银台会话** -- 锁定产品版本、定价和货币
2. **预览税额** -- 根据 customer 的账单信息计算税额
3. **创建订单** -- 发起支付并返回 PSP 托管的收银台 URL
4. **取消订单** -- 在支付完成前取消待处理（未支付）的订单

## 一次性订单状态值

| 状态          | 说明              |
| ----------- | --------------- |
| `pending`   | 订单已创建，等待支付。可取消。 |
| `completed` | 支付成功，订单已履约。     |
| `canceled`  | 支付完成前订单已取消。终态。  |

## 端点

<CardGroup cols={2}>
  <Card title="创建收银台会话" icon="cart-plus" href="/zh/api-reference/endpoints/orders/create-checkout-session">
    锁定产品版本和定价用于收银台
  </Card>

  <Card title="预览税额" icon="calculator" href="/zh/api-reference/endpoints/orders/preview-tax">
    在创建订单前计算税额
  </Card>

  <Card title="取消一次性订单" icon="ban" href="/zh/api-reference/endpoints/orders/cancel-onetime-order">
    在支付前取消待处理订单
  </Card>
</CardGroup>
