taxcloud

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TaxCloud Integration Skill

TaxCloud集成技能

TaxCloud is a Certified Streamlined Sales Tax (SST) provider for US sales tax — real-time calculation, compliance reporting, and automated filing across 11,000+ jurisdictions.
OpenAPI spec:
https://docs.taxcloud.com/openapi.json
/
https://docs.taxcloud.com/openapi.yaml

Base URL:
https://api.v3.taxcloud.com/tax/connections/{connectionId}

Full docs:
https://docs.taxcloud.com

Support email: service@taxcloud.net

TaxCloud是美国销售税领域的认证简化销售税(SST)提供商——支持在11000+辖区内进行实时计算、合规报告和自动化申报。
OpenAPI规范
https://docs.taxcloud.com/openapi.json
/
https://docs.taxcloud.com/openapi.yaml

基础URL
https://api.v3.taxcloud.com/tax/connections/{connectionId}

完整文档
https://docs.taxcloud.com

支持邮箱service@taxcloud.net

Which Reference to Read First

首先阅读哪个参考文档

TaskReference file
First-time setup, credentials, test vs prod
references/01-authentication-and-setup.md
Understand nexus, sourcing, how tax is calculated
references/02-core-concepts.md
Real-time tax quote during checkout, discounts, exemptions
references/03-real-time-cart-workflow.md
Importing orders from Square, POS, ERPs, marketplaces
references/04-order-upload-workflow.md
Customer returns, partial refunds, standalone credits
references/05-refunds-and-credits.md
Product classification, TIC search API
references/06-tic-codes-and-search.md
Tax-exempt customers, exemption certificates
references/07-exemption-certificates.md
Address verification, address field formats
references/08-address-and-utilities.md
Error handling, retry patterns, rate limits
references/09-error-handling.md
Generating a TypeScript/Node.js typed client
references/10-typescript-client.md
Migrating an existing v1 integration to v3
references/11-migration-from-v1.md
Growing nexus over time, economic thresholds, adding states
references/12-nexus-management.md
Vue.js integration patterns, testing, mocking, data storage
references/13-integration-patterns.md

任务参考文档
首次设置、凭证、测试环境与生产环境
references/01-authentication-and-setup.md
理解纳税关联(nexus)、税源、计税方式
references/02-core-concepts.md
结账时实时税报价、折扣、免税处理
references/03-real-time-cart-workflow.md
从Square、POS、ERP、电商平台导入订单
references/04-order-upload-workflow.md
客户退货、部分退款、独立税收抵免
references/05-refunds-and-credits.md
产品分类、TIC搜索API
references/06-tic-codes-and-search.md
免税客户、免税证明
references/07-exemption-certificates.md
地址验证、地址字段格式
references/08-address-and-utilities.md
错误处理、重试模式、速率限制
references/09-error-handling.md
生成TypeScript/Node.js类型化客户端
references/10-typescript-client.md
将现有v1集成迁移至v3
references/11-migration-from-v1.md
纳税关联扩展、经济阈值、添加州
references/12-nexus-management.md
Vue.js集成模式、测试、模拟、数据存储
references/13-integration-patterns.md

Two Core Workflows at a Glance

两大核心工作流概览

Real-Time API Flow (online checkout)

实时API流程(在线结账)

POST /carts          → calculate tax, get cartId
  ↓ (customer checks out)
POST /carts/orders   → convert cart → order (completed: true or false)
  ↓ (if deferred)
PATCH /orders/{id}   → set completedDate to lock in filing period
POST /carts          → 计算税费,获取cartId
  ↓(客户完成结账)
POST /carts/orders   → 将购物车转换为订单(completed: true或false)
  ↓(若延迟处理)
PATCH /orders/{id}   → 设置completedDate以锁定申报周期

Order Upload Flow (external/imported orders)

订单上传流程(外部/导入订单)

POST /orders         → create order directly (with tax amounts you calculated)
  or
POST /orders (kind: "credit") → standalone tax credit not tied to any order

POST /orders         → 直接创建订单(包含你计算的税费金额)
POST /orders (kind: "credit") → 独立税收抵免,不关联任何订单

Key Rules to Always Follow

必须遵循的关键规则

  1. completedDate
    drives tax filing period
    , not
    transactionDate
    . Set it to the date of actual delivery/ownership transfer.
  2. Only completed orders create tax liability and appear in filings.
  3. One cart/order per unique destination address — TaxCloud does not support multi-destination within a single request.
  4. Sending the same
    cartId
    overwrites
    the existing cart entirely (UPSERT semantics).
  5. Never convert a cart before payment is confirmed — it creates irrevocable tax records.
  6. Send all transactions to TaxCloud even when tax is zero — no-nexus states still contribute to economic nexus threshold tracking.
  7. excludeFromFiling: true
    on imported orders that were already filed elsewhere to prevent double-filing.
  8. Direct
    exemptionId
    attach is preferred
    over
    isExempt: true
    auto-match — auto-match leaves orders "Exempt—No certificate" if no cert is found.

  1. completedDate
    决定税务申报周期
    ,而非
    transactionDate
    。将其设置为实际交付/所有权转移的日期。
  2. 仅已完成订单会产生纳税义务并出现在申报记录中。
  3. 每个唯一目标地址对应一个购物车/订单——TaxCloud不支持单个请求中包含多个目标地址。
  4. 发送相同的
    cartId
    会完全覆盖现有购物车
    (UPSERT语义)。
  5. 确认付款前切勿将购物车转换为订单——这会创建不可撤销的税务记录。
  6. 即使税费为零,也要将所有交易发送至TaxCloud——无纳税关联的州仍会影响经济纳税关联阈值的追踪。
  7. 对已在其他地方完成申报的导入订单设置
    excludeFromFiling: true
    ,以避免重复申报。
  8. 优先直接附加
    exemptionId
    ,而非使用
    isExempt: true
    自动匹配——若未找到证明,自动匹配会将订单标记为“免税——无证明”。

Endpoint Quick Reference

端点速查

OperationMethodPath
Health checkGET
/ping
Calculate tax / create cartPOST
/carts
Convert cart to orderPOST
/carts/orders
Create order (upload)POST
/orders
Get orderGET
/orders/{orderId}
Update order (complete)PATCH
/orders/{orderId}
Refund orderPOST
/orders/refunds/{orderId}
Create exemption certificatePOST
/exemption-certificates
Get exemption certificatesGET
/exemption-certificates
Get certificate by IDGET
/exemption-certificates/{id}
Disable certificateDELETE
/exemption-certificates/{id}
TIC searchPOST
https://api.v3.taxcloud.com/tax/tic/search
Verify addressPOST
/verify-address

操作请求方法路径
健康检查GET
/ping
计算税费/创建购物车POST
/carts
将购物车转换为订单POST
/carts/orders
创建订单(上传)POST
/orders
获取订单GET
/orders/{orderId}
更新订单(标记完成)PATCH
/orders/{orderId}
退款订单POST
/orders/refunds/{orderId}
创建免税证明POST
/exemption-certificates
获取免税证明GET
/exemption-certificates
通过ID获取证明GET
/exemption-certificates/{id}
禁用证明DELETE
/exemption-certificates/{id}
TIC搜索POST
https://api.v3.taxcloud.com/tax/tic/search
地址验证POST
/verify-address

Two API Base URLs

两个API基础URL

The Sales Tax API and the Management API have different base URLs:
APIBase URLAuthUsed for
Sales Tax API
https://api.v3.taxcloud.com/tax/connections/{connectionId}
X-API-KEY
header
All cart/order/refund/exemption operations
Management API
https://api.v3.taxcloud.com/mgmt
Special scoped key (contact support)Product catalog, access key management
Health check
https://api.v3.taxcloud.com/tax/health
NoneService status (no auth needed)
⚠️ Management API requires special API keys — standard dashboard-generated keys do not have the necessary scopes. Contact TaxCloud support (service@taxcloud.net) to have them provisioned.
销售税API和管理API拥有不同的基础URL
API基础URL认证方式用途
销售税API
https://api.v3.taxcloud.com/tax/connections/{connectionId}
X-API-KEY
请求头
所有购物车/订单/退款/免税操作
管理API
https://api.v3.taxcloud.com/mgmt
特殊范围密钥(联系支持)产品目录、访问密钥管理
健康检查
https://api.v3.taxcloud.com/tax/health
服务状态(无需认证)
⚠️ 管理API需要特殊API密钥——标准控制台生成的密钥不具备必要的权限范围。请联系TaxCloud支持(service@taxcloud.net)获取。

Security: Server-Side Only

安全:仅在服务端调用

Never call TaxCloud from browser JavaScript. Your
X-API-KEY
must never be exposed to the client. In a Vue.js app, all TaxCloud calls go through your Node.js backend. Your Vue components call your own API endpoints (e.g.,
POST /api/cart/tax
,
POST /api/orders
), which then call TaxCloud server-side.
切勿从浏览器JavaScript中调用TaxCloud。你的
X-API-KEY
绝不能暴露给客户端。在Vue.js应用中,所有TaxCloud调用都需通过你的Node.js后端进行。Vue组件调用你自己的API端点(如
POST /api/cart/tax
POST /api/orders
),再由后端服务端调用TaxCloud。

Common Patterns (TypeScript)

常见模式(TypeScript)

typescript
// server-side only — never in Vue components
const BASE_URL = `https://api.v3.taxcloud.com/tax/connections/${process.env.TAXCLOUD_CONNECTION_ID}`;
const HEADERS = {
  'X-API-KEY': process.env.TAXCLOUD_API_KEY!,
  'Content-Type': 'application/json',
};

async function taxcloud<T>(path: string, method = 'GET', body?: unknown): Promise<T> {
  const res = await fetch(`${BASE_URL}${path}`, {
    method,
    headers: HEADERS,
    body: body ? JSON.stringify(body) : undefined,
  });
  if (!res.ok) {
    const err = await res.json().catch(() => ({}));
    throw Object.assign(new Error(`TaxCloud ${res.status}: ${err.detail ?? res.statusText}`), { status: res.status, body: err });
  }
  return res.json();
}
For a fully typed client generated from the OpenAPI spec, see
references/10-typescript-client.md
.
typescript
// server-side only — never in Vue components
const BASE_URL = `https://api.v3.taxcloud.com/tax/connections/${process.env.TAXCLOUD_CONNECTION_ID}`;
const HEADERS = {
  'X-API-KEY': process.env.TAXCLOUD_API_KEY!,
  'Content-Type': 'application/json',
};

async function taxcloud<T>(path: string, method = 'GET', body?: unknown): Promise<T> {
  const res = await fetch(`${BASE_URL}${path}`, {
    method,
    headers: HEADERS,
    body: body ? JSON.stringify(body) : undefined,
  });
  if (!res.ok) {
    const err = await res.json().catch(() => ({}));
    throw Object.assign(new Error(`TaxCloud ${res.status}: ${err.detail ?? res.statusText}`), { status: res.status, body: err });
  }
  return res.json();
}
如需从OpenAPI规范生成完整的类型化客户端,请查看
references/10-typescript-client.md