DocumentaçãoPrimeiros passos

Início rápido

Entre e crie com o SDK o seu primeiro pedido de compra, para qualquer fornecedor, verificado contra o que você recebe.

Entre e crie o seu primeiro pedido de compra, para qualquer fornecedor. O console e os SDKs chamam a mesma API /v1, que você também pode chamar com uma chave de API com escopo (veja Agentes de IA para gerar uma). Algumas ações sempre exigem uma pessoa conectada à Pleaxy, nunca uma chave de API: aprovar, alterar fluxos de aprovação ou a autonomia, e registrar um pagamento.

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));

Disponível na sua linguagem

Cada SDK é gerado a partir da mesma especificação OpenAPI que alimenta a Referência da API, então eles ficam sempre em sincronia com a API — escolha um dos seis que mantemos diretamente ou gere um cliente para qualquer outra linguagem.

RustOficial
pleaxy
TypeScriptOficial
@pleaxy/sdk
PythonOficial
pleaxy
GoOficial
github.com/pleaxyai/pleaxy-sdk/go
JavaOficial
ai.pleaxy:pleaxy-java
RubyOficial
pleaxy
Ver instruções de instalação e guias de início rápido →
Fale conosco