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

# 含税定价

> 提前显示最终的含税价格。Dodo 根据位置计算税费，并在结账和发票上清晰地列出。

## 什么是含税定价？

含税定价允许您将适用的税费直接嵌入到显示的产品价格中。客户可以看到一个最终金额，从而获得更透明、友好的转化体验。在结账时，Dodo 根据客户位置从显示的价格中计算出不含税部分和税额，并在发票上清晰列出。

<Info>
  最终税额仍根据客户所在位置和税务类别而异。结账和发票会显示从所示价格中计算出的税额部分。
</Info>

## 主要好处

* **客户清晰**：提前显示一个最终价格
* **区域合规**：按位置计算税费并列出
* **准确开票**：发票显示净额和从价格中得出的税费
* **友好的转化**：减少结账时的意外

## 产品设置

在您的仪表板中创建或编辑产品，然后在定价设置中启用含税定价。

#### 定价

* **价格**（必填）：显示给客户的基础价格。
* **含税定价**：切换开启以将显示的价格视为含税价格。Dodo 将根据客户位置和税种在结账时计算净额（税前）和税费部分。

<Warning>
  仅未来购买会应用更新后的含税设置。现有购买和有效订阅不会追溯更改。
</Warning>

<Tip>
  使用一致的产品文案（例如“含税”），以便客户一目了然地了解总额。
</Tip>

## API 管理

<AccordionGroup>
  <Accordion title="Create products (tax inclusive)">
    使用 `POST /products` 来创建产品，并将 `tax_inclusive` 设置为 `true`。

    <Card title="API Reference" icon="code" href="/api-reference/products/post-products">
      通过 API 创建产品
    </Card>
  </Accordion>

  <Accordion title="Update products">
    使用 `PATCH /products/{id}` 在现有产品上切换 `tax_inclusive`。

    <Card title="API Reference" icon="code" href="/api-reference/products/patch-products">
      通过 API 更新产品
    </Card>
  </Accordion>

  <Accordion title="Checkout Sessions">
    Use `POST /checkouts` to sell products marked as tax inclusive. The displayed price remains the same; checkout derives net amount and tax.

    <Card title="API Reference" icon="code" href="/api-reference/checkout-sessions/create">
      创建结账会话
    </Card>
  </Accordion>

  <Accordion title="Refunds (tax handling)">
    使用 `POST /refunds` 发起退款。适用时，可使用 `tax_inclusive` 标志指定退款是否含税。

    <Card title="API Reference" icon="code" href="/api-reference/refunds/post-refunds">
      创建退款
    </Card>
  </Accordion>
</AccordionGroup>

## 集成示例

### 创建含税定价的产品

```typescript theme={null}
const product = await client.products.create({
  name: 'Pro Plan',
  description: 'All features included',
  tax_category: 'saas',
  price: {
    type: 'one_time_price',
    currency: 'USD',
    price: 10000,
    discount: 0,
    purchasing_power_parity: false,
    tax_inclusive: true
  }
});
```

### 更新现有产品以切换含税

```typescript theme={null}
await client.products.update(product.id, {
  price: {
    tax_inclusive: true
  }
});
```

## 最佳实践

* **选择正确的税种** 以确保按区域正确计算。
* **清晰传达总额**，在产品文案中使用“含税”标签。
* **在沙盒中测试** 以验证。

## 相关

<CardGroup cols={2}>
  <Card title="Products" icon="dollar-sign" href="/features/products">
    管理产品的定价选项。
  </Card>

  <Card title="Subscriptions" icon="repeat" href="/features/subscription">
    使用高级设置配置经常性产品。
  </Card>

  <Card title="Discount Codes" icon="percent" href="/features/discount-codes">
    在保持发票清晰的同时提供促销。
  </Card>
</CardGroup>
