Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
Rillet: import customers and vendors
Add a Import customers & vendors action to the Rillet integration that pulls
Rillet Customers and Vendors into Carbon and records the
externalIntegrationMapping rows, so a later Carbon sales order / invoice pushes
onto the EXISTING Rillet customer instead of creating a duplicate.
Why the mapping retention is (mostly) free
RilletCustomerSyncer.upsertRemote already calls getRemoteId(localId) first and
does a PUT /customers/{id} when a mapping exists — only a mapping-less local id
reaches createCustomer. Same for vendors. So linking on import is the whole job:
BaseEntitySyncer.pullFromAccounting/pullBatchFromAccounting call linkEntities
after upsertLocal, which writes the mapping row.
Tasks
providers/rillet/entities/shared.ts— splitRilletEntitySyncer(Rillet plumbing + structured-error push override) from a newRilletPushOnlyEntitySyncerthat owns the four pull rejections.RilletTransactionSyncerextends the push-only one.entities/item.ts— extendRilletPushOnlyEntitySyncer(unchanged behavior).entities/customer.ts/entities/vendor.ts— extendRilletEntitySyncerand implement the pull half: puremapRilletCustomerToLocal/mapRilletVendorToLocal, plusupsertLocalwith the match ladder mapping →carbonexternal_reference → unique name, and afetchRemoteBatchthat indexes ONE cursor-drained list instead of N single GETs.providers/rillet/provider.ts— document that customer/vendor staypush-to-accounting/owner: "carbon": the import is an explicitpull-from-accountingledger operation, andowner: "carbon"is what stops a re-import from clobbering a linked Carbon record.packages/jobs/.../integrations/rillet-import-contacts.ts— new Inngest function: list customers + vendors, enqueuepull-from-accountingledger operations in chunks, drain each chunk throughdrainSyncOperations.packages/lib/src/events.ts+trigger.ts+inngest/index.ts— register the event and the function.apps/erp/app/routes/api+/integrations.rillet.import-contacts.ts— POST endpoint (update: "settings"), verifies the integration is installed/active.packages/ee/src/rillet/config.tsx— theactionsentry (the button).- Tests: the pure mappers + the match ladder + the batch list indexing.
Deliberately NOT done
- Addresses are not imported. Both the Xero and QBO pulls skip them, Carbon's
address.countryCodeis an FK tocountry.alpha2(a Rillet free-text country would fail the whole row), and a location needs a name Rillet does not carry. directionstays push-only, so no cron starts pulling contacts on its own.