Commerce

Order total from subtotal, discount, tax rate, and shipping — tax excludes shipping by default (toggle with taxShipping).

Order total from subtotal, discount, tax rate, and shipping — tax excludes shipping by default (toggle with taxShipping).

Payment: x402 ($0.02 USDC on eip155:8453). Call unpaid to receive an HTTP 402 with requirements, then retry with the PAYMENT-SIGNATURE header. Method: afterDiscount = subtotal - discount; tax = (afterDiscount + (taxShipping? shipping:0)) * taxRate/100; total = afterDiscount + shipping + tax

post/v1/commerce/order-total

Request

  • Base URL: (relative, and it does not resolve against the document’s source URL)
  • URL: /v1/commerce/order-total
  • Auth: none declared

Request body

subtotalnumber required
discountPctnumber
discountAmountnumber
taxRatePctnumber
shippingnumber
taxShippingboolean

Response

Verified result + provenance (formula, sources, reproducible SHA-256 hash).

Changes

No recorded changes to this operation across all 1 revision of this API.