DocumentationGet started

Quickstart

Sign in and create your first purchase order with the SDK, for any supplier, checked against what you receive.

Sign in and create your first purchase order, to any supplier. The console and the SDKs call the same /v1 API, which you can also call with a scoped API key (see AI agents for minting one). Some actions always need a person signed in to Pleaxy, never an API key: approving, changing approval flows or autonomy, and recording a payment.

quickstart.ts
import { Pleaxy } from "@pleaxy/sdk";

// The base URL is the origin only: the SDK adds /v1/workspaces/<Workspace ID>.
const pleaxy = new Pleaxy({
  baseUrl: "https://api.pleaxy.ai",
  apiKey: process.env.PLEAXY_API_KEY, // "<keyId>.<secret>"
  workspaceId: process.env.PLEAXY_WORKSPACE_ID, // Company profile → Workspace ID
});

// A purchase order to any supplier. A supplier not on Pleaxy yet is emailed the
// order and invited at supplierContactEmail when it is sent. With three_way, its
// invoices are checked against this order, what you receive against it and any
// contract you hold with them.
const po = await pleaxy.purchaseOrders.createPurchaseOrder({
  supplier: "Northgate Steel",
  supplierContactEmail: "orders@northgate-steel.example",
  matching: "three_way",
  lineItems: [
    {
      scopeType: "custom",
      name: "Hot-rolled steel plate, 10 mm",
      ruleType: "quantity",
      lineType: "goods",
      unit: "t",
      unitPrice: 920,
      qty: 20,
      nteAmount: 0,
      paymentTerms: "Net 30",
      validFrom: "2026-01-01",
      validUntil: "2026-12-31",
    },
  ],
});

// po.status is "pending_approval" while your approval flow runs, then
// "awaiting_fulfillment". Autonomy, if on, can approve it straight away.

// Each invoice against the order is checked against it, what was received and
// the contract (and, for a cloud or AI provider you connect, the usage it
// metered). Why one matched or is held:
const [invoice] = await pleaxy.invoices.listInvoices();
if (invoice) console.log(await pleaxy.invoices.getInvoiceReconciliation(invoice.id));

Available in your language

Every SDK is generated from the same OpenAPI spec that powers the API Reference, so they stay in lockstep with the API - pick the six we maintain directly, or generate a client for anything else.

RustOfficial
pleaxy
TypeScriptOfficial
@pleaxy/sdk
PythonOfficial
pleaxy
GoOfficial
github.com/pleaxyai/pleaxy-sdk/go
JavaOfficial
ai.pleaxy:pleaxy-java
RubyOfficial
pleaxy
View install instructions & quickstarts →
Talk to us