Skip to content

docs(agent-launch): add tax setup step (ENG-2405) - #176

Merged
kalmigs merged 4 commits into
mainfrom
kal/eng-2405-tax-setup-by-api
Oct 21, 2026
Merged

kalmigs merged 4 commits into
mainfrom
kal/eng-2405-tax-setup-by-api

Conversation

@kalmigs

@kalmigs kalmigs commented Oct 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a Tax section to Step 4 of the agent launch guide. A new store calculates tax from the start: every country opened under the default mode uses Fluid's tax calculation, so an agent has no tax step to do.
  • For a merchant who uses their own Avalara account, list the three API calls in the order the API accepts them: save and test the credentials, switch the company to Avalara, then set each country's Avalara options and the Avalara settings. Link each call's reference page.
  • Add Avalara credentials to "What to have ready", and a row to the merchant's table: the merchant gives the credentials and sets up in Avalara where they collect tax.

Part of ENG-2405

Where each claim comes from

Guide says Source (fluid main)
A new store calculates tax with no step Company#tax_class defaults to fluid (company.rb:236). A new country's strategy defaults to the first option, which is Fluid's own calculation (company_country.rb:133, 387-400). Signup doesn't change either. The onboarding checklist counts tax as set up (onboarding_service.rb:137)
The first environment saved is the active one PUT /api/settings/avalara_account description in settings-v0.yaml
Avalara mode is refused until an environment is active company.rb:1070
Switching the mode clears each country's tax strategy Help page §Choose your tax mode; set_tax_class_action.rb:19
Commits are US and Canada only company_country.rb:473-507; help page §Country tax settings

Checks

eval/check-guide-claims.mjs and eval/check-advertised-docs-links.mjs pass locally. eval/check-broken-links.mjs resolves every new link. It still fails on one link in setup/sales-channel-tiktok.mdx, which this PR doesn't touch, and that failure is already on main at 0115979. mint validate was not run locally. agent-launch.mdx isn't in the claims registry, so there is no registry change.

@linear-code

linear-code Bot commented Oct 20, 2026

Copy link
Copy Markdown

ENG-2405

@otto-detective

otto-detective Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Otto Summary

Verdict: ✅ Approved

This is a docs-only change that adds a Tax subsection to Step 4, plus matching rows in "What to have ready" and in the merchant table. All five API reference links match operations in the specs: taxes PUT avalara_account, taxes test_connection, companies set_tax_class, countries PUT company_countries/{id}, and taxes Avalara settings. The field names (username, password, environment sandbox/production, company_code) and the claim that the first saved slot becomes active both match settings-v0.yaml. The earlier finding about mapping credential names to API fields is fixed, and I found no new issues.

Findings

No new findings.

Tip

Merge confidence: 5/5 — Docs-only change whose links and API field names match the specs in the repo.


Confidence trend (oldest → newest): 5/5 → 5/5 → 5/5 → 5/5

Review history (4 runs)
Reviewed Commit Verdict Score New findings
2026-10-21 05:08 UTC (latest) 99bf5df Approved 5/5 0
2026-10-21 04:57 UTC 91755c9 Approved 5/5 0
2026-10-20 15:55 UTC fe42485 Approved 5/5 0
2026-10-20 14:34 UTC 98cfb4b Approved 5/5 1

@otto-detective otto-detective Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otto reviewed 98cfb4b. 1 new inline finding.

Tip

Merge confidence: 5/5 — Docs-only change: the links resolve to existing spec operations and the claims match the specs and the help page.

The full summary and review history are in Otto's pinned summary comment, updated on every review.

Comment thread api/agent-launch.mdx Outdated

- **Back-office credentials**, if the merchant has a back office to connect in Step 2. Each [Connect guide](/setup/overview) lists exactly which values its platform needs.
- **Payments documents** for Step 3: business registration, bank statements, ID for each owner, and financial statements. [Payments onboarding](/setup/payments-onboarding) has the full list.
- **Avalara credentials**, only if the merchant calculates tax on their own Avalara (AvaTax) account: the account ID, license key, and company code. Without them, Fluid calculates tax for the store ([Step 4](#tax)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Map credential names to API fields

This uses the admin UI's labels (account ID, license key), but the PUT /api/settings/avalara_account body calls these fields username and password, next to company_code. Since this guide is for agents calling the API, a short parenthetical such as "(sent as username and password)" here or in step 1 of the Tax section would save a lookup.

Prompt To Fix With AI
This is a comment left during a code review.
Path: api/agent-launch.mdx
Line: 54
Severity: P3

Comment:
**Map credential names to API fields**

This uses the admin UI's labels (account ID, license key), but the `PUT /api/settings/avalara_account` body calls these fields `username` and `password`, next to `company_code`. Since this guide is for agents calling the API, a short parenthetical such as "(sent as `username` and `password`)" here or in step 1 of the Tax section would save a lookup.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this feedback doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Step 1 of the Tax section now maps account ID → username and license key → password.

@kalmigs

kalmigs commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

The red validate check comes from main, not this PR. Main's API reference sync (0115979) renamed a TikTok operation. That broke a link in setup/sales-channel-tiktok.mdx and the admin-v2025-06 page map in check-hosted-docs.test.mjs. #175 fixes both. I'll rebase this PR once it merges.

@otto-detective otto-detective Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otto reviewed fe42485. No new inline findings.

Tip

Merge confidence: 5/5 — Docs-only change: the claims have sources, the links resolve, and the earlier finding is fixed.

The full summary and review history are in Otto's pinned summary comment, updated on every review.

@cwcarlson10 cwcarlson10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. I checked each claim in the new Tax section against the app, and they hold: a new store defaults to Fluid's tax calculation, the first Avalara environment saved becomes the active one, the Avalara mode is refused until an environment is active, switching the mode clears each country's tax strategy, and commits are US and Canada only. The call order is right too.

One suggestion on step 2. Its reason is a little off. The mode switch clears the tax strategy, but it doesn't touch the fields step 3 sets. The real reason to switch first is that Fluid refuses to turn on commits until the country's tax mode is Avalara. Saying that tells an agent why a step 3 call fails if it runs out of order. I also left a small nit about the company code. Neither one blocks the merge.

The red validate check is the TikTok link and the admin page map from main. #175 fixes both, as you said.

Comment thread api/agent-launch.mdx Outdated
If the merchant calculates tax on their own Avalara (AvaTax) account, connect it over the API in this order:

1. Save the credentials with [Create or update a merchant Avalara account slot](/api-reference/taxes/create-or-update-a-merchant-avalara-account-slot): the account ID as `username`, the license key as `password`, the `company_code`, and the `environment` (`sandbox` or `production`). Then check them with [Test a merchant Avalara connection](/api-reference/taxes/test-a-merchant-avalara-connection). The first environment you save becomes the active one, and Fluid refuses the Avalara tax mode until one is active.
2. Switch the company to Avalara with [Set the tax class for a company](/api-reference/companies/set-the-tax-class-for-a-company). This clears each country's tax strategy, so do it before step 3.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mode switch clears each country's tax strategy, but it leaves the commit and company code settings alone, so that isn't why step 3 has to wait. The reason is that Fluid refuses to turn on Commit transactions to Avalara until the country's tax mode is Avalara. Suggested wording: "Switch the company to Avalara with Set the tax class for a company. Fluid turns on commits only for a country that uses Avalara, so do this before step 3. The switch also clears each country's tax strategy."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 91755c9, with your wording.

Comment thread api/agent-launch.mdx Outdated

- **Back-office credentials**, if the merchant has a back office to connect in Step 2. Each [Connect guide](/setup/overview) lists exactly which values its platform needs.
- **Payments documents** for Step 3: business registration, bank statements, ID for each owner, and financial statements. [Payments onboarding](/setup/payments-onboarding) has the full list.
- **Avalara credentials**, only if the merchant calculates tax on their own Avalara (AvaTax) account: the account ID, license key, and company code. Without them, Fluid calculates tax for the store ([Step 4](#tax)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this reads as if all three values are required. The API saves the slot without a company code, and the help page says the code is needed only to commit transactions. Maybe: "the account ID and license key, plus the company code if they commit transactions to Avalara."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 91755c9. Step 1 said the same thing, so I fixed it there too.

@otto-detective otto-detective Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otto reviewed 91755c9. No new inline findings.

Tip

Merge confidence: 5/5 — The change is docs-only, its claims are sourced, the links are checked and the earlier finding is fixed.

The full summary and review history are in Otto's pinned summary comment, updated on every review.

@otto-detective otto-detective Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otto reviewed 99bf5df. No new inline findings.

Tip

Merge confidence: 5/5 — Docs-only change whose links and API field names match the specs in the repo.

The full summary and review history are in Otto's pinned summary comment, updated on every review.

@kalmigs
kalmigs merged commit 11abe87 into main Oct 21, 2026
3 checks passed
@kalmigs
kalmigs deleted the kal/eng-2405-tax-setup-by-api branch October 21, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants