W3builders
AOP API

AOP API/Documents & Invoices

Calculate Document Totals

POST/finance/documents/calculate
JWT bearer

Stateless calculator — no DB write. Runs the same GST/discount logic as create() and returns totals, useful for a live preview before submitting.

Endpoint

POSThttps://api.w3builders.com/v1/finance/documents/calculate

Request body

  • line_items[], place_of_supply, discount_type, discount_value — same shape as create

Response parameters

FieldType
line_itemsvalue
subtotalvalue
discount_amountvalue
taxable_amountvalue
cgst_amountvalue
sgst_amountvalue
igst_amountvalue
other_tax_amountvalue
total_taxvalue
round_offvalue
totalvalue
Calculate Document Totals
curl -X POST https://api.w3builders.com/v1/finance/documents/calculate \
-H "Authorization: Bearer $TOKEN"
{
"shape": "{ line_items, subtotal, discount_amount, taxable_amount, cgst_amount, sgst_amount, igst_amount, other_tax_amount, total_tax, round_off, total }"
}
Was this page helpful?