Tax Routing for Payment Rails: Stripe, Crypto, and Agent Escrow
AgentTax calculates what you owe. But a calculation is just a number until the money actually moves to the right place. The "routing" part of tax compliance — splitting a payment between your operating revenue and your tax reserve — depends on which payment rail you're using.
This guide covers the three main payment rails in agent commerce and how tax routing works on each.
A Critical Principle First
AgentTax never holds, transfers, or escrows money on traditional payment rails.
This is a deliberate architectural decision. Holding or transferring money on behalf of others would make AgentTax a money transmitter, requiring state-by-state licensing — a regulatory burden that would be incompatible with our goal of being a lightweight, API-first tool.
Instead, AgentTax calculates and instructs. Your code routes. The separation is clean:
AgentTax: "You owe $156.25 in TX sales tax. Route to tax reserve."
Your code: stripe.transfers.create({ amount: 15625, destination: taxReserveAccount })
Rail 1: Stripe (Most Common)
Most AI agent commerce today settles through Stripe — either direct charges, Stripe Connect transfers, or subscription billing. Here's how to route tax on each.
Direct Charges with Metadata
The simplest approach: charge the buyer the full amount (base + tax) and use Stripe metadata to track the tax portion. Then sweep tax amounts to a separate bank account on a schedule.
const taxResult = await agenttax.calculate({
role: 'seller', amount: 2500, buyer_state: 'TX',
transaction_type: 'api_access', counterparty_id: buyerAgentId,
});
const paymentIntent = await stripe.paymentIntents.create({
amount: Math.round((2500 + taxResult.total_tax) * 100), // $2,656.25
currency: 'usd',
metadata: {
base_amount: '2500.00',
tax_amount: taxResult.total_tax.toString(),
tax_jurisdiction: taxResult.sales_tax.jurisdiction,
tax_rate: taxResult.sales_tax.rate.toString(),
agenttax_txn: taxResult.transaction_id,
},
});
Pros: Simple. Works with any Stripe integration. Metadata is searchable in the Stripe dashboard.
Cons: Tax isn't physically separated at payment time. You need a separate process to sweep tax reserves.
Stripe Connect with Split Payments
If you're using Stripe Connect (platform model), you can split the payment at settlement time:
const paymentIntent = await stripe.paymentIntents.create({
amount: 265625, // $2,656.25 in cents
currency: 'usd',
transfer_data: {
destination: operatingAccountId, // Your operating account
},
application_fee_amount: Math.round(taxResult.total_tax * 100), // $156.25
});
// The application_fee goes to your platform account
// From there, sweep to your tax reserve
Pros: Physical separation of funds at payment time.
Cons: Requires Stripe Connect setup. The application_fee model may not fit every business structure.
Stripe with Separate Transfers
For maximum control, charge the full amount and create explicit transfers:
// 1. Charge the buyer
const charge = await stripe.paymentIntents.create({
amount: 265625,
currency: 'usd',
});
// 2. Transfer operating revenue to your main account
await stripe.transfers.create({
amount: 250000, // $2,500
currency: 'usd',
destination: operatingAccountId,
});
// 3. Transfer tax reserve to a separate account
await stripe.transfers.create({
amount: 15625, // $156.25
currency: 'usd',
destination: taxReserveAccountId,
metadata: {
type: 'sales_tax_reserve',
jurisdiction: 'TX',
agenttax_txn: taxResult.transaction_id,
},
});
Pros: Clean separation. Each account has a clear purpose.
Cons: Requires multiple Stripe connected accounts. More complex reconciliation.
Rail 2: Crypto / Smart Contracts
Agent-to-agent commerce on crypto rails is growing, especially for compute marketplaces and decentralized AI services. Tax routing on crypto rails has unique properties.
Programmatic Escrow
On crypto rails, a smart contract can enforce tax routing at the protocol level:
// Simplified concept — not production code
function settleTransaction(
address seller,
address taxReserve,
uint256 baseAmount,
uint256 taxAmount
) external {
// Both transfers are atomic
token.transfer(seller, baseAmount);
token.transfer(taxReserve, taxAmount);
emit TransactionSettled(seller, baseAmount, taxReserve, taxAmount);
}
The advantage of crypto escrow: the tax split is enforced by code, not by trust. The seller can't accidentally (or intentionally) pocket the tax portion because the smart contract routes it separately.
AgentTax's Role
AgentTax calculates the split; the smart contract executes it:
1. Buyer agent calls AgentTax → receives tax calculation
2. Buyer agent calls smart contract with: seller address, tax reserve address, base amount, tax amount
3. Smart contract atomically splits the payment
4. AgentTax logs the transaction (via webhook from the buyer agent)
Important caveat: AgentTax never deploys or controls the escrow contract. The contract is your code, audited by your team, deployed to your chain. AgentTax provides the calculation. You provide the execution.
Stablecoin Settlement
Most agent crypto transactions settle in stablecoins (USDC, USDT) because tax obligations are denominated in USD. If settlement is in a volatile token, the tax calculation needs to account for the USD value at the time of settlement, not at the time of agreement.
AgentTax always calculates in USD. If you're settling in ETH, you're responsible for the conversion at settlement time. The tax amount returned by AgentTax ($156.25) needs to be converted to the equivalent ETH amount using the current exchange rate.
Rail 3: Direct Bank / ACH
For larger agent-to-agent transactions or enterprise deals, settlement might happen via ACH transfer or wire. Tax routing on direct bank rails is similar to Stripe with separate transfers:
# After AgentTax calculates: $2,500 base + $156.25 tax
bank.create_transfer(
amount=2500.00,
destination=operating_account,
memo=f"Revenue: {transaction_id}",
)
bank.create_transfer(
amount=156.25,
destination=tax_reserve_account,
memo=f"Tax reserve TX: {transaction_id}",
)
Most banking APIs (Mercury, SVB, Modern Treasury) support programmatic transfers with metadata. The pattern is the same: calculate with AgentTax, route with your banking API.
The Tax Reserve Account
Regardless of payment rail, you need a tax reserve account — a separate account (or sub-account) where collected sales tax sits until you remit it to the state.
Why separate? Because collected sales tax is trust fund money. It doesn't belong to you. It belongs to the state. Commingling it with operating revenue creates legal risk and makes reconciliation harder.
Setting up a tax reserve:
Stripe: Create a separate connected account or use Stripe's balance segregation features.
Bank: Open a separate bank account at the same institution. Most business banks offer sub-accounts with no additional fees.
Crypto: Deploy a separate wallet or use a multi-sig with restricted withdrawal policies.
Accounting: In your books, collected sales tax is a liability (you owe it to the state), not revenue. Your accountant will want to see it in a separate account.
Routing Logic in AgentTax
Every AgentTax response includes a routing array that tells you exactly where to send money:
{
"routing": [
{
"type": "sales_tax",
"amount": 156.25,
"destination": "TX_tax_reserve",
"jurisdiction": "Texas"
}
]
}
If the transaction is exempt (no nexus, digital exempt, buyer certificate), the routing array is empty — meaning the full amount goes to your operating account with no split needed.
For buyer-side transactions, there's no routing (you pay the full amount to the seller). Instead, the use tax obligation is logged to your dashboard for quarterly filing.
Reconciliation
At the end of each filing period, you'll need to reconcile:
- AgentTax dashboard: Shows all transactions, tax calculated, jurisdictions
- Payment rail records: Shows actual payments, splits, reserves
- Tax reserve account: Shows current balance by jurisdiction
- State filing: The amount you owe to each state
AgentTax's export feature generates CSV/JSON files that align with your payment rail records, making reconciliation straightforward. The transaction_id field links an AgentTax calculation to its corresponding payment rail transaction.
This is the complete flow: calculate → route → reserve → reconcile → file.