Lark Bitable Integration Guide
Wire Tariffin AI classification + 13-country tariffs + landed cost into your Lark Bitable in 10 minutes — no code, no backend. This guide uses Lark’s native Automation feature, all configuration happens inside Lark.
1. How it works
Tariffin exposes a webhook at https://tariffin.com/api/lark/classify. It takes a product description + destination country and returns HS code, tariff rate, and landed cost. Lark Bitable’s Automation feature can watch a column, POST to the webhook, and write the response back into other columns.
01
Add input columns (product name, destination) to your Bitable
02
Add output columns (HS code, MFN rate, landed cost, ...)
03
Configure an Automation: on product-name fill → POST to Tariffin webhook
04
Map JSON response back to the output columns. Done.
2. Prerequisites (5 min)
Sign up on Tariffin and issue an API key
Open Dashboard → API keys, click “Issue new key”, name it (e.g. “Lark Bitable”), and copy the full key — format tfk_xxxxxxxx.... It is shown only once.
Create or open a Lark Bitable
Lark workspace → Bitable → New table, or open an existing one. We recommend wiring up a test sheet first before moving to production.
3. Set up your fields
Add 8 fields. The first 4 are inputs you fill, the last 4 will be auto-populated (leave them empty for now).
| Field | Type | Required | Purpose |
|---|---|---|---|
| Product ↓ 输入 in | Multi-line text | ✓ | Any language |
| Destination ↓ 输入 in | Single-select (US/CN/EU/...) | ✓ | ISO-2 code |
| Declared Value (USD) ↓ 输入 in | Number | Default 1000 | |
| Origin ↓ 输入 in | Single-select | For FTA logic, optional | |
| HS Code ↑ 输出 out | Text | Auto-filled, 6-10 digits | |
| MFN Rate ↑ 输出 out | Number (%) | Auto-filled | |
| Landed (USD) ↑ 输出 out | Number | Auto-filled | |
| AI Reasoning ↑ 输出 out | Multi-line text | Auto-filled |
4. Configure the Automation
In your Bitable, click the ⚙️ Automation icon top-right → New flow → Start from blank.
Trigger: when Product field is filled
- Type: When record is modified
- Watched fields: tick Product
- Condition: changes from empty to non-empty
Action: Send HTTP request
Add Action → Send HTTP request. Configure as below:
POSThttps://tariffin.com/api/lark/classifyBearer tfk_xxxxxxxxxxxxxxxxxxxxapplication/jsonJSONRequest body — replace {{Field}}with Lark’s field reference (right panel lets you click to insert):
{
"product_name": "{{Product}}",
"destination": "{{Destination}}",
"declared_value_usd": {{Declared Value (USD)}},
"origin": "{{Origin}}"
}Authorization header must read Bearer (with the trailing space) followed by your full tfk_... key. Missing or malformed → HTTP 401.Map the JSON response back to fields
| Lark field | JSON path | Note |
|---|---|---|
| HS Code | $.hs_code | 6-10 chars |
| MFN Rate | $.mfn_rate | 0.024 = 2.4% |
| Landed (USD) | $.landed_cost_usd | Number |
| AI Reasoning | $.reasoning | Localized text |
description_en/zh, confidence (0-1), source_url (official tariff source). See section 6 for the full schema.Enable and test
Toggle the flow to “Enabled”. Back in the table, add a new row, fill Product (e.g. “Portable bluetooth speaker”) and Destination (US), save. 5-10 seconds later the 4 output columns will populate.
5. Request format
POST https://tariffin.com/api/lark/classify
Headers
Authorization: Bearer tfk_xxxxxxxxxxxxxxxxxxxxxxxx content-type: application/json
Body fields
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| product_name | string | ✓ | — | Product description, 2-2000 chars, any language |
| destination | string | ✓ | — | ISO-2 country code: US/CN/EU/UK/JP/KR/IN/AU/CA/MX/BR/VN/TH |
| declared_value_usd | number | 100 | Declared value (USD), used for landed cost | |
| origin | string | — | Country-of-origin ISO code, affects FTA rates, optional |
Full example
curl -X POST https://tariffin.com/api/lark/classify \
-H "Authorization: Bearer tfk_xxxxxxxxxxxxxxxxxxxx" \
-H "content-type: application/json" \
-d '{
"product_name": "Portable bluetooth speaker, plastic, USB-C, 5W",
"destination": "US",
"declared_value_usd": 1000,
"origin": "CN"
}'6. Response format
| Field | Type | Description |
|---|---|---|
| hs_code | string | HS code, 6-10 digits |
| description_en | string | HS code English description |
| description_zh | string | HS code Chinese description |
| confidence | number | AI classification confidence, 0-1 |
| reasoning | string | AI reasoning trace, localized |
| mfn_rate | number / null | MFN rate, 0.024 = 2.4% (null = data not yet available) |
| full_code | string / null | Country-specific full tariff code (e.g. US HTS 10-digit) |
| source | string / null | Source authority: USITC, CBIC, EU-TARIC, etc. |
| source_url | string / null | Official source URL — click to verify |
| landed_cost_usd | number / null | Landed cost (USD) |
| landed_cost_local | number / null | Landed cost in destination local currency |
| currency | string / null | Local currency code, e.g. CNY/EUR/JPY |
| effective_rate_percent | number / null | Effective total tax burden percent |
| detected_language | string | Detected input language, e.g. zh / en |
| provider | string | Underlying AI provider (deepseek) |
| latency_ms | number | Call latency, milliseconds |
Sample response
{
"hs_code": "851829",
"description_en": "Other loudspeakers, single",
"description_zh": "其他扬声器,单声道",
"confidence": 0.92,
"reasoning": "Portable bluetooth speaker with plastic housing, USB-C, 5W → HS 8518.29.",
"mfn_rate": 0.024,
"full_code": "8518.29.80",
"source": "USITC HTS",
"source_url": "https://hts.usitc.gov/?query=8518.29",
"landed_cost_usd": 1117.6,
"landed_cost_local": 1117.6,
"currency": "USD",
"effective_rate_percent": 2.4,
"detected_language": "en",
"provider": "deepseek",
"latency_ms": 1843
}7. Error codes & troubleshooting
| HTTP | error | Cause & fix |
|---|---|---|
| 400 | invalid_request | Body malformed. Check JSON validity, field names, numeric types |
| 400 | unsupported_destination | Destination not in the 13 supported countries. See supported array in response |
| 401 | unauthorized | Authorization header missing or key wrong. Verify Bearer prefix + full tfk_... key |
| 429 | rate_limited | Over 60/min. Honor retry-after header, then retry |
| 500 | — | Server error, usually LLM upstream blip. Retry typically resolves |
8. Common patterns
8.1 Compare across multiple destinations
Want to compare the same product across all 13 countries? Use Lark’s linked-table feature: main table = products, child table = product × destination (13 rows per product). The Automation fires per child row, so each call hits exactly one country — faster and easier to debug.
8.2 Backfilling a large existing table
Already have 1,000 rows to classify? Temporarily switch the Automation trigger to “Scheduled — every day at 8 AM, fill empty HS Code fields”. Note the 60/min limit — 1,000 rows takes ~17 minutes.
8.3 Multiple teammates / use cases
Issue a separate API key per teammate or use case (name them descriptively in the dashboard, e.g. “alice-prod”, “bob-test”). Benefits:
- Per-key usage stats and last-used timestamps
- Revoke a single key when someone leaves — others unaffected
- Rate limits bucketed per key, so they don’t compete
8.4 Use the webhook outside Lark
The endpoint is a plain REST API. Any HTTP-capable tool works: Python requests, n8n, Zapier, shell scripts — just include the Bearer token.
8.5 In-app test
Before wiring up Automation, fire one sample request from Dashboard → Lark integration → Webhook test to confirm your account’s key works end-to-end.
9. FAQ
Does Lark Automation have call limits?
Lark itself caps automation runs (free plan: 100/month; paid plans: more). That's Lark-side, not Tariffin. For higher volume, upgrade Lark or call the webhook from a Lark Script (scripts don't count against automation runs).
Can I batch multiple products in one call?
The webhook is single-product per call today. For batch, configure Lark to fire per-row, or loop in your own script (mind the 60/min limit).
mfn_rate is null — what now?
Tariffin doesn't yet have a tariff record for that HS × country (often happens with rare HS codes or smaller countries). Verify against the official source URL in the response, if present.
How accurate is the AI classification?
92%+ top-3 accuracy on a benchmark of 5,000 real customs declarations. Mark records with confidence < 0.7 for human review — Lark Automation can branch on this directly.
How fresh is the tariff data?
USITC/CBP, GACC, EU TARIC, India CBIC, Japan customs — crawled daily. Smaller sources weekly. Every record has a verified_at timestamp and source_url for verification.
Ready to wire it up?
Issue a key, run the in-app test, and you’ll have a working pipeline in 5 minutes.