Documentation Index
Fetch the complete documentation index at: https://docs.arcuserp.com/llms.txt
Use this file to discover all available pages before exploring further.
Installation
npm install @arcuserp/sdk-node
Requires Node.js 18 or later. Works in TypeScript and plain JavaScript.
Quick start
import Arcus from '@arcuserp/sdk-node';
const arcus = new Arcus({
apiKey: process.env.ARCUS_API_KEY!,
entityId: process.env.ARCUS_ENTITY_ID!,
});
// List accounts
const accounts = await arcus.accounts.list({ limit: 10 });
console.log(accounts.data.map((a) => a.name));
// Create a sales order
const order = await arcus.orders.create(
{
document_type: 'sales_order',
account_id: 'acc_01H...',
line_items: [
{ product_id: 'prod_01H...', quantity: 5, unit_price: 29.99 },
],
},
{ idempotencyKey: crypto.randomUUID() },
);
console.log(order.id);
Configuration
const arcus = new Arcus({
apiKey: process.env.ARCUS_API_KEY!,
entityId: process.env.ARCUS_ENTITY_ID!,
// Optional
baseUrl: 'https://api.arcuserp.com/v1', // optional; defaults to https://api.arcuserp.com/v1
arcusVersion: '2026-05-01', // API version to use
maxRetries: 3, // default: 2
timeout: 30_000, // ms; default: 30000
});
// Iterate all orders without manual cursor management
for await (const order of arcus.orders.list({ limit: 100 })) {
await processOrder(order);
}
Error handling
import { ArcusAPIError, ArcusRateLimitError } from '@arcuserp/sdk-node';
try {
const order = await arcus.orders.retrieve('ord_invalid');
} catch (err) {
if (err instanceof ArcusRateLimitError) {
// SDK auto-retries 429s; you only see this after maxRetries exhausted
console.error('Rate limit exhausted after retries');
} else if (err instanceof ArcusAPIError) {
console.error(err.code); // machine-readable code
console.error(err.hint); // human-readable hint
console.error(err.requestId); // for Arcus support
console.error(err.status); // HTTP status
}
}
Webhooks
import Arcus from '@arcuserp/sdk-node';
import express from 'express';
const app = express();
const arcus = new Arcus({ apiKey: process.env.ARCUS_API_KEY!, entityId: process.env.ARCUS_ENTITY_ID! });
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
let event;
try {
event = arcus.webhooks.constructEvent(
req.body,
req.headers['arcus-signature'] as string,
process.env.ARCUS_WEBHOOK_SECRET!,
);
} catch (err) {
return res.status(400).send('Webhook signature verification failed');
}
switch (event.type) {
case 'order.confirmed':
console.log('Order confirmed:', event.data.object.id);
break;
case 'payment.received':
console.log('Payment received:', event.data.object.id);
break;
}
res.status(200).json({ received: true });
});
TypeScript types
The SDK ships full TypeScript types for every resource, request, and response:
import type { Order, Account, Product, ArcusListResponse } from '@arcuserp/sdk-node/types';
const handleOrder = (order: Order): void => {
console.log(order.document_type); // typed as DocumentType enum
console.log(order.status); // typed as OrderStatus enum
};
Source
The SDK is generated from arcus-api-core/openapi/arcus-api-v1.yaml using Speakeasy. Source: arcus-erp-aws/sdks/typescript.