Catalog/acct-sales-tax-invoice

Finance

Multi-line invoice sales tax API

Foots a multi-line invoice with per-line discounts, mixed taxable/exempt lines, per-line tax rates, and optional taxable shipping into a sales-tax grand total. Answers 'What is the invoice total with sales tax?', 'How much tax on a mixed taxable/exempt invoice?'.

Price$0.04per request
MethodPOST
Route/v1/finance/sales-tax-invoice
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
sales-taxinvoiceline-itemstaxvatgstbillingaccounting
API URLhttps://x402.hexl.dev/v1/finance/sales-tax-invoice
Integration docs
Example request
{
  "lines": [
    {
      "description": "Widget",
      "quantity": 10,
      "unitPrice": 25,
      "taxRatePercent": 8
    },
    {
      "description": "Service",
      "quantity": 1,
      "unitPrice": 100,
      "taxable": false
    },
    {
      "description": "Gadget",
      "quantity": 2,
      "unitPrice": 50,
      "discountPercent": 10,
      "taxRatePercent": 8
    }
  ],
  "shipping": 15,
  "shippingTaxable": false,
  "defaultTaxRatePercent": 8
}
Example response
{
  "lines": [
    {
      "description": "Widget",
      "quantity": 10,
      "unitPrice": 25,
      "grossAmount": 250,
      "discountPercent": 0,
      "discountAmount": 0,
      "netAmount": 250,
      "taxable": true,
      "taxRatePercent": 8,
      "taxAmount": 20
    },
    {
      "description": "Service",
      "quantity": 1,
      "unitPrice": 100,
      "grossAmount": 100,
      "discountPercent": 0,
      "discountAmount": 0,
      "netAmount": 100,
      "taxable": false,
      "taxRatePercent": 0,
      "taxAmount": 0
    },
    {
      "description": "Gadget",
      "quantity": 2,
      "unitPrice": 50,
      "grossAmount": 100,
      "discountPercent": 10,
      "discountAmount": 10,
      "netAmount": 90,
      "taxable": true,
      "taxRatePercent": 8,
      "taxAmount": 7.2
    }
  ],
  "subtotal": 440,
  "totalDiscount": 10,
  "shipping": 15,
  "shippingTax": 0,
  "taxableBase": 340,
  "totalTax": 27.2,
  "grandTotal": 482.2,
  "effectiveTaxRatePercent": 6.1818,
  "interpretation": "Subtotal $440 + tax $27.2 + shipping $15 = invoice total $482.2."
}
Input schema
{
  "type": "object",
  "required": [
    "lines"
  ],
  "properties": {
    "lines": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "examples": [
        [
          {
            "description": "Widget",
            "quantity": 10,
            "unitPrice": 25,
            "taxRatePercent": 8
          },
          {
            "description": "Service",
            "quantity": 1,
            "unitPrice": 100,
            "taxable": false
          },
          {
            "description": "Gadget",
            "quantity": 2,
            "unitPrice": 50,
            "discountPercent": 10,
            "taxRatePercent": 8
          }
        ]
      ]
    },
    "defaultTaxRatePercent": {
      "type": "number",
      "examples": [
        8
      ]
    },
    "shipping": {
      "type": "number",
      "examples": [
        15
      ]
    },
    "shippingTaxable": {
      "type": "boolean",
      "examples": [
        false
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}