ForHosting KIT · Documents & PDF

Generate a purchase order document with calculated totals

Turn approved purchasing details into a consistent, structured purchase order document without rebuilding calculation rules in every application.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Supply the purchase order number, buyer, vendor, and at least one line item containing a description, quantity, and unit cost. The generator validates the required data, calculates every line total, adds the order total, and returns a predictable object ready for internal review, durable storage, document rendering, formal approval, or another procurement workflow step.

Prepare complete purchase order data

Start with a purchase order number that has already been assigned by your purchasing system. The generator preserves that value exactly after trimming surrounding whitespace; it does not invent identifiers, inspect a sequence, or reserve a number for you. Next, identify the buyer and vendor. These fields can contain a concise business name or a longer block with address and registration details, depending on what the system that renders the document expects. Add at least one line item and give every row a specific description, a numeric quantity greater than zero, and a nonnegative numeric unit cost. Fractional quantities are accepted for goods or services purchased by weight, length, time, or another divisible unit. A zero unit cost is accepted for a genuinely free item, but a zero or negative quantity is rejected because it does not express an order. Keep all unit costs in one currency and one pricing basis. The capability does not infer currencies, units of measure, payment terms, delivery dates, taxes, discounts, or shipping charges, so those business decisions should be handled before or after this calculation as appropriate.

Understand how purchase order totals are calculated

For each row, the generator multiplies quantity by unit cost and rounds the resulting line total to two decimal places. It then adds those rounded line totals and rounds the sum to produce the purchase order subtotal. Because this capability does not accept tax, freight, discounts, or other adjustments, the returned total equals the subtotal. This explicit sequence matters when fractional quantities or unit costs contain several decimal places: another system that sums unrounded intermediate values could differ by a cent. The response retains the normalized description, original numeric quantity, rounded unit cost, and calculated line total for every item. At document level it returns the document type, supplied PO number, buyer, vendor, line item array, subtotal, and total. All numbers must be finite; strings that merely look numeric are not silently converted. Negative unit costs are also rejected. These rules make malformed purchasing data visible early and give downstream templates, approval screens, databases, and integrations one stable calculation contract instead of allowing presentation code to decide financial amounts.

Use the structured document in a procurement workflow

Place this capability after requisition approval and PO-number assignment, when editable purchasing data is ready to become a controlled order record. Send normalized party names and item rows, then store the returned object as the calculation result used by later steps. A template can turn it into HTML or PDF, an approval service can compare its total with authorization limits, and an integration can transfer the rows into an ERP or supplier portal. Those actions remain separate: this generator does not transmit the order, contact a vendor, create a file, reserve budget, or update inventory. It uses no network, clock, random values, storage, or hidden state, so an identical request always produces an identical response. That makes retries and audit comparisons straightforward. Handle validation errors before presenting an order for signature, especially a missing or empty line-item list, blank party details, an absent PO number, nonnumeric amounts, or excessive row counts. The API request price is $0.002, while the same pure calculation can support the browser experience. Keeping generation deterministic and delivery separate prevents a rendering or messaging failure from silently changing the purchasing record.

Create approved purchase orders

Convert approved requisition rows into a structured purchase order with consistent calculated totals.

Power a procurement form

Calculate line and order totals as purchasing staff prepare data for review and rendering.

Standardize purchasing integrations

Give internal applications and supplier workflows one deterministic purchase order calculation contract.

What does one API request cost?

Each API request costs $0.002.

What happens if there are no line items?

The request returns an invalid input error because every purchase order must contain at least one line item.

How are monetary values rounded?

Each quantity is multiplied by its unit cost and rounded to two decimals; the rounded line totals are then summed and rounded.

Does the generator assign a PO number?

No. You must provide the PO number, and the result preserves it as part of the structured document.

Does the result include tax, currency, or a PDF?

No. It returns structured purchase order data and calculated item totals. Tax rules, currency labels, rendering, and delivery are separate steps.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/doc/purchase-order-generate

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/doc/purchase-order-generate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"po_number":"PO-2026-0142","buyer":"Contoso Retail","vendor":"Northwind Supplies","line_items":[{"description":"Ergonomic keyboard","quantity":12,"unit_cost":79.95},{"description":"USB-C dock","quantity":5,"unit_cost":149.5}]}'
{
  "po_number": "PO-2026-0142",
  "buyer": "Contoso Retail",
  "vendor": "Northwind Supplies",
  "line_items": [
    {
      "description": "Ergonomic keyboard",
      "quantity": 12,
      "unit_cost": 79.95
    },
    {
      "description": "USB-C dock",
      "quantity": 5,
      "unit_cost": 149.5
    }
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "doc.purchase_order_generate",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →