Actions32
- Analytics Actions
- Batch Actions
- Customer Actions
- Order Actions
- Product Actions
- Purchase Actions
- Raw Request Actions
- System Actions
- Vendor Actions
- WhatsApp Actions
Batch → Upsert Batch
AI-generatedSummary
Creates or updates a product batch (lot/expiry record) in VitePOS by POSTing to the bridge's /wp-json/vtab/v1/batches/upsert endpoint. The body is built from the Batch Fields collection or from a raw JSON payload.
Inputs
- Input Mode — 'Use Fields' (default) builds the body from Batch Fields. 'Advanced JSON' sends the JSON Body as-is and ignores Batch Fields.
- JSON Body — Shown only in Advanced JSON mode. Raw request body sent to the upsert endpoint. Defaults to {"dry_run": true}. Invalid JSON throws an error. Objects pass through unchanged.
- Batch Fields — Shown only in Use Fields mode. Optional fields: Batch ID, Batch No, Product ID, Outlet ID, Warehouse ID, Expiry Date, Purchase Price, Sale Price, Received Quantity, Remaining Quantity, Sold Quantity, Purchase ID, Purchase Item ID, Is Archived (Y/N), Dry Run. Only fields you add are sent. Dry Run is sent only when true, so the bridge can validate without writing.
Output shape
One output item per input item, containing the bridge's JSON response with a human-readable 'response' string added at the top.
The 'response' string is generally 'Batch request completed.' for this operation. If the bridge returns status/success false, the string is its message. A non-object response is wrapped as {response, raw}. With Continue On Fail enabled, failed items return {error: message}. Expiry Date is sent as entered, not trimmed to a date. The node does not require any field, so the bridge decides which are needed for matching or creating a batch.
Examples
Example 1: Register a new batch with an expiry date for a product at an outlet
Input Mode: Use Fields; Batch Fields: Product ID, Outlet ID, Batch No, Expiry Date, Purchase Price, Sale Price, Received Quantity.
Example 2: Preview a batch upsert without saving
Use Fields with the desired batch fields plus Dry Run enabled.
Example 3: Send a custom payload built upstream
Input Mode: Advanced JSON; JSON Body set to an expression such as {{ JSON.stringify($json) }}.