DocumentationPremiers pas
Démarrage rapide
Connectez-vous et créez avec le SDK votre premier bon de commande, pour tout fournisseur, contrôlé par rapport à ce que vous recevez.
Connectez-vous et créez votre premier bon de commande, auprès de n’importe quel fournisseur. La console et les SDK appellent la même API /v1, que vous pouvez aussi appeler avec une clé API à portée limitée (voir Agents IA pour en générer une). Certaines actions nécessitent toujours une personne connectée à Pleaxy, jamais une clé API : valider, modifier les circuits de validation ou l’autonomie, et enregistrer un paiement.
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));Disponible dans votre langage
Chaque SDK est généré à partir de la même spécification OpenAPI que la référence de l’API, pour rester parfaitement synchronisé avec l’API – choisissez l’un des six que nous maintenons directement, ou générez un client pour tout autre langage.