Skip to main content
The /transaction endpoint is the core of the Centsless API. You send a transaction, and the engine resolves the jurisdiction, applies the correct rounding rule for that location, and returns the legally correct cash total — complete with compliance certification and a fraud score. Every transaction is committed to an immutable audit hash chain, giving you a tamper-evident record for regulators and auditors.

Endpoint

POST https://api.centsless.org/api/v1/transaction

Authentication

All requests require an x-api-key header. Use your merchant key or partner key.
x-api-key
string
required
Your merchant or partner API key.

Request body

merchant_id
string
required
Unique merchant identifier issued by Centsless or your POS vendor.
subtotal_cents
integer
required
Pre-tax subtotal in cents. Tax is always calculated on this pre-rounded amount.
tax_total_cents
integer
required
Sales tax in cents. Always pass the tax calculated on the pre-rounded subtotal — never recalculate tax after rounding.
payment_method
string
required
Payment tender type. One of: cash, card, ebt, mobile. Only cash transactions are subject to rounding. EBT transactions are never rounded per 7 CFR 278.2.
zip_code
string
ZIP code for automatic jurisdiction resolution. Recommended — the engine resolves state, county, city, and the applicable rounding rule from a single field.
state
string
Two-letter state code (e.g., AZ, IN). Use when you don’t have a ZIP code.
county
string
County name for sub-state jurisdiction resolution. Combined with state for county-level rules.
city
string
City name for municipal-level jurisdiction resolution. Combined with state and county.
cash_rounding_mode
string
Explicit rounding mode override. One of: swedish_rounding, mandatory_round_down, mandatory_round_up, symmetrical_rounding, nearest_nickel, none. Use for testing only — omit this field in production to let the engine resolve the correct rule for the jurisdiction.
store_id
string
Store location identifier for multi-location merchants.
terminal_id
string
POS terminal identifier. Included in the audit record.
cashier_id
string
Cashier or employee identifier. Included in the audit record.
is_split_tender
boolean
Set to true when the customer is splitting payment across multiple tender types.
tenders
array
Array of tender components for split tender transactions. Each item has a type (one of cash, card, ebt, mobile) and an amount_cents integer.

Examples

curl -X POST https://api.centsless.org/api/v1/transaction \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "merchant_id": "YOUR-MERCHANT-ID",
    "subtotal_cents": 523,
    "tax_total_cents": 200,
    "payment_method": "cash",
    "zip_code": "85001"
  }'

Response fields

transaction
object
The processed transaction record.

Response example

{
  "success": true,
  "transaction": {
    "id": "TXN-2026-04-14-A82C2EAA",
    "calculation": {
      "subtotal_cents": 523,
      "tax_total_cents": 200,
      "ledger_total_cents": 723,
      "cash_total_cents": 725,
      "rounding_delta_cents": 2,
      "payment_method": "cash",
      "cash_rounding_mode": "swedish_rounding",
      "jurisdiction": "US-AZ",
      "rounding_applied": true
    },
    "compliance": {
      "compliance_status": "PASS"
    },
    "fraud_score": 0,
    "risk_level": "NONE"
  }
}
The customer pays **7.25insteadof7.25** instead of 7.23. The 2-cent rounding delta is applied per Arizona HB 2938 (mandatory Swedish rounding).