Sales tax
OnCharge can calculate US sales tax on your orders for the states you are registered in, add it at checkout (or take it out of prices that include it), record what you collected, give back its share when you refund, and give you a report to file from.
You decide where you must register, and you file returns and pay the tax yourself: OnCharge does not file or pay sales tax and does not give tax advice. OnCharge charges $0.50 per order taxed in a state you have added, taken with its fee on that order. It is not returned when the order is refunded (the rest of OnCharge's fee is returned in proportion, as for any refund).
Sales tax needs card payments set up for your store. Turn it on in the dashboard: Settings → Sales tax.
Set it up#
- Where you ship from. Your store's origin address.
- States you are registered in. Tax is calculated only for these. An order to any other state is not taxed. A registration can start on a later date and be ended; ended registrations stay listed.
- How your prices are listed.
- Add tax at checkout (the default): your prices are before tax. The shopper sees subtotal, sales tax and total, and pays the total.
- Prices include tax: the total does not change; OnCharge works out how much of it is tax.
- Product categories. A default category for your store (General goods unless you change it), and a category per product id for products taxed differently (clothing, groceries, digital goods, services, not taxable…).
Where tax is calculated#
| Where | When |
|---|---|
| Checkout sessions (API) | Only when the request asks: tax.enabled: true. Store plugins (WooCommerce, Magento, Wix…) usually add their own tax to the order total, so OnCharge does not add it again unless you ask. |
| Payment links | Every link of a store with sales tax on. Links that don't ask for a shipping address ask for the shopper's ZIP code and state. |
| Invoices | When you finalize an invoice whose lines have no tax rate of their own. Tax is added on top of the line prices and shown on the invoice, its page, PDF and emails. Needs the customer's address (or a shipping address). |
| Saved-card charges (API) | When the request asks: tax.enabled: true. |
Tax is calculated for where the order ships. When nothing ships, it uses the billing address you send (tax.billing_address) or, on a payment link, the shopper's ZIP code. It is calculated again whenever the address or the order changes, until the payment is made; then the amount is final.
Create a taxed checkout session#
{
"amount": 5500,
"currency": "USD",
"reference": "cart-8812",
"return_url": "https://shop.example/thanks",
"shipping": { "line1": "1 Congress Ave", "city": "Austin", "state": "TX", "postal_code": "78701", "country": "US" },
"line_items": [
{ "description": "Mug", "quantity": 2, "amount_including_tax": 3000, "product_id": "MUG-1" },
{ "description": "Tea", "quantity": 1, "amount_including_tax": 2000, "tax_category": "groceries" }
],
"tax": { "enabled": true, "shipping_amount": 500 }
}With tax.enabled, amount is the order as you list it, and the line items (each line's total in amount_including_tax) plus tax.shipping_amount must add up to it. The answer carries amount, what the shopper will pay, and a tax object:
{
"session_id": "…",
"amount": 5954,
"tax": {
"status": "calculated",
"inclusive": false,
"currency": "USD",
"subtotal": 5500,
"amount": 454,
"total": 5954,
"shipping": 500,
"jurisdictions": [{ "state": "TX", "rate": "8.25", "amount": 454 }],
"refunded": 0,
"error": null
}
}A cart session created before the order exists gets its tax when you attach the shipping address with POST /api/v1/checkout/sessions/{id}/order; that answer carries the new amount and tax.
When tax can't be calculated#
| Case | What happens |
|---|---|
| No address yet | The payment waits: checkout answers tax_address_required until the address is attached. |
| The address can't be placed (wrong ZIP code or state) | tax_address_invalid: creating the session answers 422, and checkout refuses the payment. Create a new session with a corrected address. |
| The calculation is briefly unavailable, tax added at checkout | tax_unavailable: the shopper is asked to try again. OnCharge never charges a total without its tax. |
| The calculation is briefly unavailable, prices include tax | The listed total is charged (it is right whatever the tax is) and the tax is worked out shortly after (status: "pending"). |
Refunds and disputes#
A refund gives back its share of the tax: a refund of a third of an order gives back a third of its tax (rounded half away from zero to the cent), and the last refund gives back whatever is left, so nothing is left over. A dispute you lose does the same. A dispute you win changes nothing.
Where you see it#
- Webhooks: payment, refund and chargeback events of a taxed payment carry
data.tax(the object above). - API:
GET /api/v1/checkout/sessions/{id}and saved-card charges returntax; each entry ofGET /api/v1/paymentshastax, the tax inside itsamount(negative for a refund's share). - Dashboard: with sales tax on, the activity list and export have a Sales tax column after Net, and so does the itemized activity report. The accounting export moves the tax from Sales to a Sales Tax Payable account, and back with refunds and lost disputes.
- Sales tax report (Settings → Sales tax, with a CSV): per month and state, the taxable sales, tax collected, tax refunded and the net tax to file.
OnCharge's fee is on the amount before tax. Tax collected is paid out with the rest of the order, on the same terms (after carrier-confirmed delivery where that applies).
Categories#
general_goods, nontaxable, services, electronic_services, clothing, software_download, saas, books, ebooks, music_download, dietary_supplements, otc_drugs, cosmetics, candy, groceries, prepared_food, pet_food, gift_cards. Use them in line_items[].tax_category, or set them per product id in Settings → Sales tax.