---
title: "Every branch"
url: https://services.dev/docs/examples/tax/branches
captured: [tax-branches.txt]
---
# Every branch

URL: https://services.dev/docs/examples/tax/branches

> Each human and outside branch the tax brand's files can take, run in the sandbox with no person and no outside system, each picked by the magic value that produces it, and the test EINs your own code answers.

*tax's words: return is a job, taxpayer is a subject, review is a task, preparer is a member (examples/tax/brand.ts).*

Every branch these files can take runs in the sandbox, with no person and no outside system. A magic value on the order picks each one: the officer's email, a value under `metadata.sandbox`, or a member's id. The e-file branches are different: the e-file system is your code in `lib/tax.ts`, and its test EINs pick them, the way a transmitter's test environment would.

| Value | The branch | Walked on |
|---|---|---|
| the officer's email `signs@example.test` | Ada signs the §7216 consent and answers every organizer item at once, and the return waits on its signer | [Annual return](https://services.dev/docs/examples/tax/annual-return.md) |
| `declines@example.test` | She declines consent, and the return ends at $0, declined | below |
| `silent@example.test` | She never answers: consent reminds, expires, opens once more, and the second expiry lapses the return at $0 | below |
| `metadata.sandbox.asks = { approve: … }` | The estimate's officer pays it, pays a different amount herself, or skips it in writing | below, and [the year](https://services.dev/docs/examples/tax/years.md) |
| `metadata.sandbox.outside = never` | The Treasury never answers the payment, and past its wait the estimate cancels at $0 | below |
| `metadata.sandbox.brand = stale` or `verified` | The brand's e-file number is stale, and filing is refused; or it's verified, and filing runs as on a live key. Stale past a date, it costs the brand: [When a date is missed](https://services.dev/docs/examples/tax/missed.md) | below |
| member `mbr_lapsed_credential` | Can't claim the sign review: ineligible on a PTIN lapsed on 31 December | below, and [the Pool](https://services.dev/docs/examples/tax/pool.md) |
| member `mbr_eligible` | Holds every credential, claims the review and signs | below |
| EIN `98-7654321` | New York rejects once with `ein_mismatch`, and the organizer asks for its account number | [Federal first, then the states](https://services.dev/docs/examples/tax/efile.md) |
| EIN `98-7654322` | `math`: back to the draft, then a new signature | [Every code](https://services.dev/docs/examples/tax/efile.md#every-code-by-test-ein) |
| EIN `98-7654323` | `schedule_missing`: back to the organizer | [Every code](https://services.dev/docs/examples/tax/efile.md#every-code-by-test-ein) |
| EIN `98-7654325` | `business_rule`, a code no route names: a preparer repairs it, and another member signs | [Every code](https://services.dev/docs/examples/tax/efile.md#every-code-by-test-ein) |
| EIN `98-7654326` | California's `business_rule`: the repair needs a CTEC, CPA, EA or bar card on that leg | [Who may claim](https://services.dev/docs/examples/tax/pool.md#who-may-claim) |
| EIN `98-7654324` | New York and New Jersey each reject once, each with its own code and its own item | [Every code](https://services.dev/docs/examples/tax/efile.md#every-code-by-test-ein) |

## The officer's asks

```txt
→ POST /returns {"service":"annual-return","business":{"name":"Acme Robotics","email":"books@acme.example"},"owner":{"name":"Ada","email":"signs@example.test"},"ein":"12-3456789","tax_year":"2026","entity":"C corp","jurisdictions":["US","US-CA","US-NY","US-NJ"],"books":"https://books.example/acme","max_usd":1800,"key":"signs@example.test"}   # owner.email = signs@example.test
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · waiting · on claim · $1,800.00 held
  record  consent · owner · §7216 | organizer.books · answered | organizer.bank · answered | organizer.payroll · answered | organizer.assets · answered | organizer.ca_account · answered | organizer.ny_account · answered | organizer.nj_account · answered | organizer · owner · upload | compute · code | draft · ai | check · ai · adversarial · 3 lenses · pass
```

```txt
→ POST /returns {"service":"annual-return","business":{"name":"Acme Robotics","email":"books@acme.example"},"owner":{"name":"Ada","email":"declines@example.test"},"ein":"12-3456789","tax_year":"2026","entity":"C corp","jurisdictions":["US","US-CA","US-NY","US-NJ"],"books":"https://books.example/acme","max_usd":1800,"key":"declines@example.test"}   # owner.email = declines@example.test
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · ended · declined · $0
  record  declined · ended · Ada declined consent.
```

```txt
→ POST /returns {"service":"annual-return","business":{"name":"Acme Robotics","email":"books@acme.example"},"owner":{"name":"Ada","email":"silent@example.test"},"ein":"12-3456789","tax_year":"2026","entity":"C corp","jurisdictions":["US","US-CA","US-NY","US-NJ"],"books":"https://books.example/acme","max_usd":1800,"key":"silent@example.test"}   # owner.email = silent@example.test, and 15 days on the clock
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · ended · lapsed · $0
  record  consent · reminded 1d before expiry | consent · expired | consent · reminded 1d before expiry | consent · expired | lapsed · ended · clock · consent expired twice.
```

## The estimate's decision

Whatever the officer decides, the estimate is earned once it's figured and decided, so it's charged on delivery. Only "pay it" pays, in each jurisdiction with an installment:

```txt
→ POST /returns {"service":"estimate","owner":{"name":"Ada","email":"signs@example.test"},"ein":"12-3456789","quarter":"2027-Q1","jurisdictions":["US","US-CA"],"max_usd":79,"key":"pay it","metadata":{"sandbox":{"asks":{"approve":"pay it"}}}}   # metadata.sandbox.asks = { approve: pay it }
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · delivered · voucher.txt · $79.00 charged
  record  compute · code | approve · owner · decide · decided pay it | review · ai · pass | pay · Treasury and states · 2 accepted · rcp_7Hq2 | record · code
```

```txt
→ POST /returns {"service":"estimate","owner":{"name":"Ada","email":"signs@example.test"},"ein":"12-3456789","quarter":"2027-Q1","jurisdictions":["US","US-CA"],"max_usd":79,"key":"pay a different amount","metadata":{"sandbox":{"asks":{"approve":"pay a different amount"}}}}   # metadata.sandbox.asks = { approve: pay a different amount }
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · delivered · voucher.txt · $79.00 charged
  record  compute · code | approve · owner · decide · decided pay a different amount | review · ai · pass | pay · skipped | record · skipped
```

```txt
→ POST /returns {"service":"estimate","owner":{"name":"Ada","email":"signs@example.test"},"ein":"12-3456789","quarter":"2027-Q1","jurisdictions":["US","US-CA"],"max_usd":79,"key":"skip, in writing","metadata":{"sandbox":{"asks":{"approve":"skip, in writing"}}}}   # metadata.sandbox.asks = { approve: skip, in writing }
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · delivered · voucher.txt · $79.00 charged
  record  compute · code | approve · owner · decide · decided skip, in writing | review · ai · pass | pay · skipped | record · skipped
```

```txt
→ POST /returns {"service":"estimate","owner":{"name":"Ada","email":"signs@example.test"},"ein":"12-3456789","quarter":"2027-Q1","jurisdictions":["US","US-CA"],"max_usd":79,"key":"never","metadata":{"sandbox":{"outside":"never","asks":{"approve":"pay it"}}}}   # metadata.sandbox.outside = never, and 3 days on the clock, past the 2-day wait
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · canceled · step_failed · $0
  record  compute · code | approve · owner · decide · decided pay it | review · ai · pass | pay · Treasury and states · silent past wait
```

## The brand's e-file number

```txt
→ POST /returns {"service":"annual-return","business":{"name":"Acme Robotics","email":"books@acme.example"},"owner":{"name":"Ada","email":"signs@example.test"},"ein":"12-3456789","tax_year":"2026","entity":"C corp","jurisdictions":["US","US-CA","US-NY","US-NJ"],"books":"https://books.example/acme","max_usd":1800,"key":"stale","metadata":{"sandbox":{"brand":"stale"}}}   # metadata.sandbox.brand = stale
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← 403 brand_unverified: file is performed under the brand's efin, which isn't verified and fresh.
```

```txt
→ POST /returns {"service":"annual-return","business":{"name":"Acme Robotics","email":"books@acme.example"},"owner":{"name":"Ada","email":"signs@example.test"},"ein":"12-3456789","tax_year":"2026","entity":"C corp","jurisdictions":["US","US-CA","US-NY","US-NJ"],"books":"https://books.example/acme","max_usd":1800,"key":"verified","metadata":{"sandbox":{"brand":"verified"}}}   # metadata.sandbox.brand = verified
```

```txt title="captured/tax-branches.txt · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← job_4Tx2 · delivered · workpapers-2026.txt · return.txt · $1,800.00 charged
  record  … sign · person · ptin and enrolled agent · * · mbr_8Ea1 | authorize · owner · Form 8879-CORP · id-verified | file · IRS and states · efin verified · 4 accepted
```

## Who may sign

```txt
→ POST /reviews/tsk_7Hq2/claim   # as mbr_lapsed_credential
```

```txt title="magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← 403 ineligible · credential: signer needs ptin, and cpa or enrolled agent, and the verifier holds no current one for mbr_lapsed_credential: the PTIN lapsed on 31 December, unrenewed.
```

```txt
→ POST /practitioners/returns/job_4Tx2/approve {"checklist":["every line traces to a source","due diligence answered","the officer's e-file authorization shows this return's figures"]}
```

```txt title="200 · magic values: owner.email = signs@example.test, owner.email = declines@example.test, owner.email = silent@example.test, metadata.sandbox.asks = { approve: pay it }, metadata.sandbox.asks = { approve: pay a different amount }, metadata.sandbox.asks = { approve: skip, in writing }, metadata.sandbox.outside = never, metadata.sandbox.brand = stale, metadata.sandbox.brand = verified, member = mbr_eligible, member = mbr_lapsed_credential"
← 200
```

## The test EINs

The e-file branches are your own code's: [Every code, by test EIN](https://services.dev/docs/examples/tax/efile.md#every-code-by-test-ein) runs each one.

The plan's year is scripted the same way, with values under `asks`, `outside` and `events`: [A year, and the next](https://services.dev/docs/examples/tax/years.md). [Magic values](https://services.dev/docs/reference/magic-values.md) lists every value the sandbox reads.

---

- Up: [The tax example](https://services.dev/docs/examples/tax.md)
- Previous: [The agent's order](https://services.dev/docs/examples/tax/agent.md)
- Next: [The customer portal](https://services.dev/docs/examples/tax/customer-portal.md)
