71trust / 100

Invoice Totals Calculate Execute

by tradepilotusa.com in Markets & finance

x402 APIPassing, checked 23 min ago

Calculate subtotal, per-line tax, discount and deposit from supplied invoice line items. Per-line tax percent (not a single flat rate), discount applied to the pre-tax subtotal, deposit as a percent-of-total or fixed amount clamped to the total. Pure arithmetic; does not create, store or send an invoice.

POST https://www.tradepilotusa.com/api/agent-commerce/v1/services/invoice_totals_calculate/execute

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
1.1 s typical, 1.3 s slowest 5%
Last check
23 min ago
Next check
in 7 min

How to call it

# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://www.tradepilotusa.com/api/agent-commerce/v1/services/invoice_totals_calculate/execute' \
  -H 'content-type: application/json' \
  --data-raw '{"deposit_enabled":true,"deposit_type":"percent","deposit_value":25,"discount_percent":10,"line_items":[{"quantity":2,"rate":150,"tax_percent":8.25},{"quantity":1,"rate":75,"tax_percent":0}]}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fwww.tradepilotusa.com%2Fapi%2Fagent-commerce%2Fv1%2Fservices%2Finvoice_totals_calculate%2Fexecute
const res = await pay("https://www.tradepilotusa.com/api/agent-commerce/v1/services/invoice_totals_calculate/execute", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: "{\"deposit_enabled\":true,\"deposit_type\":\"percent\",\"deposit_value\":25,\"discount_percent\":10,\"line_items\":[{\"quantity\":2,\"rate\":150,\"tax_percent\":8.25},{\"quantity\":1,\"rate\":75,\"tax_percent\":0}]}",
});
console.log(await res.json());

Example input

{
  "deposit_enabled": true,
  "deposit_type": "percent",
  "deposit_value": 25,
  "discount_percent": 10,
  "line_items": [
    {
      "quantity": 2,
      "rate": 150,
      "tax_percent": 8.25
    },
    {
      "quantity": 1,
      "rate": 75,
      "tax_percent": 0
    }
  ]
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
23 min agoPassed402990 ms$0.01
4 h agoPassed4021.8 s$0.01
8 h agoPassed4021.2 s$0.01
12 h agoPassed4021.1 s$0.01
16 h agoPassed4021.0 s$0.01
20 h agoPassed402980 ms$0.01
23 h agoPassed4021.0 s$0.01
27 h agoPassed402969 ms$0.01
30 h agoPassed4021.1 s$0.01
34 h agoPassed4021.2 s$0.01
37 h agoPassed4021.0 s$0.01
40 h agoPassed4021.1 s$0.01
44 h agoPassed4021.0 s$0.01
2 days agoPassed4021.1 s$0.01
2 days agoPassed4021.1 s$0.01