Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Precoro

Precoro

Procurement in Precoro: purchase orders, requisitions, invoices, suppliers and approvals.

8 actions API key 7 read1 write Calls api.precoro.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "precoro" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Approve documentwriteprecoro.approve_documentApprove a purchase requisition, purchase order, invoice, expense or warehouse request as the user who owns the API key. Approval moves money, so only do this when asked.
InputTypeDescription
document_aliasstringRequiredType of document
idnstringRequiredDocument IDN
TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.approve_document",
  input: {
    "document_alias": "<document_alias>",
    "idn": "<idn>"
  },
});
Get purchase orderreadprecoro.get_purchase_orderGet one purchase order by its IDN (the number shown in Precoro), including its line items and approval steps.
InputTypeDescription
idnstringRequiredPurchase order IDN, for example 2
TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.get_purchase_order",
  input: {
    "idn": "<idn>"
  },
});
Get supplierreadprecoro.get_supplierGet one supplier by ID: contact details, currencies, payment terms and status.
InputTypeDescription
idintegerRequiredSupplier ID
TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.get_supplier",
  input: {
    "id": 1
  },
});
List invoicesreadprecoro.list_invoicesList supplier invoices, optionally only those changed since a date.
InputTypeDescription
modified_sincestringOptionalOnly records created or updated since this date-time, like 2025-01-01T00:00:00
per_pageintegerOptionalPage size: 10, 20, 50, 100 or 200
pageintegerOptionalPage number, starting at 1
TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.list_invoices",
  input: {},
});
List purchase ordersreadprecoro.list_purchase_ordersList purchase orders (without line items), newest changes first when filtered by modified date. Status 2 means approved.
InputTypeDescription
modified_sincestringOptionalOnly records created or updated since this date-time, like 2025-01-01T00:00:00
per_pageintegerOptionalPage size: 10, 20, 50, 100 or 200
pageintegerOptionalPage number, starting at 1
TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.list_purchase_orders",
  input: {},
});
List purchase requisitionsreadprecoro.list_purchase_requisitionsList purchase requisitions (requests to buy), optionally only those changed since a date.
InputTypeDescription
modified_sincestringOptionalOnly records created or updated since this date-time, like 2025-01-01T00:00:00
per_pageintegerOptionalPage size: 10, 20, 50, 100 or 200
pageintegerOptionalPage number, starting at 1
TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.list_purchase_requisitions",
  input: {},
});
List suppliersreadprecoro.list_suppliersList suppliers with currency and status, optionally only those changed since a date.
InputTypeDescription
modified_sincestringOptionalOnly records created or updated since this date-time, like 2025-01-01T00:00:00
per_pageintegerOptionalPage size: 10, 20, 50, 100 or 200
pageintegerOptionalPage number, starting at 1
TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.list_suppliers",
  input: {},
});
List usersreadprecoro.list_usersList Precoro users with their email, name and position.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "precoro.list_users",
  input: {},
});