Skip to content
Fourohtwo

agents.writerslogic.com/api/v1/quote-normalize

Converts up to 200 quoted prices to a net price per base unit in one currency, for an agent comparing supplier quotes. Each line: price for `per` units of a unit of measure, optional tax-inclusive flag and rate, optional percentage discount, any currency. Uses only the caller's exchange rates and unit factors (1 uom = factor base units); a currency without a rate, a unit without a factor, or a tax

BaseUnchecked
POSThttps://agents.writerslogic.com/api/v1/quote-normalize

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://agents.writerslogic.com/api/v1/quote-normalize", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"lines":[{"id":"A","uom":"case","price":"24.00","currency":"USD"},{"id":"B","uom":"each","price":"2.40","taxRate":"20","currency":"EUR","taxIncluded":true},{"id":"C","price":"2.00","currency":"GBP"}],"baseUom":"each","fxRates":[{"from":"EUR","rate":"1.10"}],"uomFactors":[{"uom":"case","factor":"12"}],"targetCurrency":"USD"}),
});
console.log(await res.json());

Example input

{
  "lines": [
    {
      "id": "A",
      "uom": "case",
      "price": "24.00",
      "currency": "USD"
    },
    {
      "id": "B",
      "uom": "each",
      "price": "2.40",
      "taxRate": "20",
      "currency": "EUR",
      "taxIncluded": true
    },
    {
      "id": "C",
      "price": "2.00",
      "currency": "GBP"
    }
  ],
  "baseUom": "each",
  "fxRates": [
    {
      "from": "EUR",
      "rate": "1.10"
    }
  ],
  "uomFactors": [
    {
      "uom": "case",
      "factor": "12"
    }
  ],
  "targetCurrency": "USD"
}