Veritura veritura Docs
veritura.co Open workspace

Guide

Send batch records automatically

Your compounding system already prints a batch record for every batch: the preparation, the batch number, the day it was made, the beyond-use date and each ingredient with its lot. Veritura reads that record on Release and checks each ingredient lot against what the workspace holds for it, as of the compounding date. Instead of someone dropping the day's export on Release, it can arrive on its own, in either of two ways: a folder watcher on the computer that receives the exports, or the workspace's email address. Nothing here needs a connector to your compounding system.


The boundary: Veritura reads the paperwork and checks it against what is on file. It does not test the preparation, and the result waits for a person on Release.

What happens to each file#

Each file is read by what it says, by the same rule on both ways in:

The fileWhat happens
A batch-record export: a CSV whose columns name each ingredient and its lot, or a PDF print that calls itself a batch or compounding record, names who compounded or checked it or a beyond-use date, and lists each ingredient with its lotRead on Release, one read per batch, waiting for a person. A batch already waiting is not read twice.
A supplier document, such as a certificate of analysisRead by the certificate reader and filed to its lot, as an upload is.
A file that does not clearly say which it is (certificate wording beside batch-record wording, or a record that is only partly a batch record)Filed nowhere. The answer says why and asks: drop it on Release if it is a batch record, or on Receive if it is a supplier document.
A batch record that carries patient details (a patient name, date of birth, record or prescription number)Refused whole. Veritura keeps no patient data, so nothing of it is kept. Export the batch columns only, or print the batch-level record.
An order or shipment exportNot taken here. It belongs to the Passports drop.

A CSV column that names a patient (name, date of birth, prescription number, address, phone, email, prescriber) is never read at all.

Make an intake key#

In the workspace, open Settings, then Batch records in, and choose Make an intake key. An owner or an admin makes it. The one-line command for the watcher comes with it.

Mac and Linux#

The watcher needs Node 18 or later (nodejs.org) and nothing else. Open Terminal on the computer your compounding system exports to and paste the command from Settings. It looks like this, with your key and your folder:

curl -fsSL https://www.veritura.co/api/auto-intake/watcher.mjs -o veritura-drop-watcher.mjs && INTAKE_KEY=vk_intake_… node veritura-drop-watcher.mjs --url https://www.veritura.co --folder "$HOME/Veritura batch exports" --save

--save keeps the key in the watched folder's .veritura/config.json, readable by your user only, so later runs need only the folder:

node veritura-drop-watcher.mjs --folder "$HOME/Veritura batch exports"

To have it running whenever the computer is on, run it once a few minutes with --once from cron (crontab -e):

*/5 * * * * cd "$HOME" && /usr/local/bin/node veritura-drop-watcher.mjs --folder "$HOME/Veritura batch exports" --once

Run node veritura-drop-watcher.mjs --help for every option.

Windows#

The Windows watcher runs in PowerShell, which Windows already has. Open PowerShell on the computer your compounding system exports to and paste the command from Settings:

iwr https://www.veritura.co/api/auto-intake/watcher.ps1 -OutFile veritura-drop-watcher.ps1; powershell -ExecutionPolicy Bypass -File .\veritura-drop-watcher.ps1 -Url https://www.veritura.co -Key vk_intake_… -Folder "$env:USERPROFILE\Veritura batch exports" -Save

To start it when you sign in, add a task in Task Scheduler (one line in PowerShell; change the paths to yours):

schtasks /Create /SC ONLOGON /TN "Veritura drop watcher" /TR "powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File C:\Veritura\veritura-drop-watcher.ps1 -Folder C:\Veritura\Exports"

What the watcher does with your files#

By email#

Each workspace has its own intake address, shown in Settings, Batch records in. Have your compounding system email the export to it on a schedule, or forward it yourself. Each attachment is read by the rule above, and a reply lists what happened to each one.

The subject may say what an attachment is: "batch record" or "certificate". The subject never overrides what the file says. It settles a print that lists ingredients with their lots but does not call itself a batch record, and a subject that names the other kind turns the file into a question rather than a filing.

The endpoint#

The watchers call one endpoint, which any system can call with an intake key:

POST /v1/intake
Authorization: Bearer vk_intake_…
Content-Type: application/json

{ "fileName": "batch-records-2026-10-20.csv", "fileType": "text/csv", "base64": "…" }

An optional "kind": "batch" or "kind": "certificate" is the same hint as an email's subject.

StatusBodyMeaning
200{ "kind": "batch_records", "reads": 15, "repeated": 0 }Read as batch records; repeated counts batches already waiting on Release.
200 or 202{ "kind": "document", … }Filed as a supplier document; 202 when it is kept and waits to be read.
422{ "kind": "unclear", "code": "unclear_kind", "question": "…" }Filed nowhere; the question says why.
422{ "kind": "refused", "code": "patient_data" } (or order_export, no_ingredients)Not read; error says why.
401, 403{ "code": "key_revoked" } and similarThe key is missing, revoked, expired, or not an intake key.
413, 415Over 8 MB, or a file type the workspace does not take.
429More than 60 files in a minute; try again shortly.