VitePOS Bridge icon

VitePOS Bridge

Use VitePOS automation bridge and analytics APIs

Order → Create Order

AI-generated

Summary

Creates a VitePOS order by sending a POST to the bridge endpoint /wp-json/vtab/v1/orders/create. The body comes from structured fields and line items, or from a raw JSON payload.

Inputs

  • Input Mode — 'Use Fields' (default) builds the body from Order Fields and Order Items. 'Advanced JSON' sends the JSON Body as-is and ignores the field collections.
  • JSON Body — Used only in Advanced JSON mode. It is parsed and sent as the request body, and invalid JSON raises an error. The default is {"dry_run": true}.
  • Order Items — Repeatable line items with product_id, variation_id, sku, quantity, price, regular_price, total override, tax_amount per unit, batch_id, batch_strategy (FEFO/FIFO), auto_allocate_batches, use_batch_price and skip_batch. Empty rows are dropped.
  • Order Fields: order meta — external_id, outlet_id, counter_id, channel (whatsapp/n8n/other), status (completed, processing, on-hold, vt_served, vt_processing), note, payment_note, reduce_stock, dry_run.
  • Order Fields: payment and totals — is_paid, payment_method (Cash/Card/Other), paid_at, given_amount, discount_total, fee_total, grand_total override.
  • Order Fields: batch allocation — auto_allocate_batches and batch_strategy (FEFO or FIFO), applied at order level.
  • Order Fields: customer — customer_id takes precedence. Otherwise a customer object is built from customer email, external ID, phone and first/last name, with create_customer_if_missing. The customer object is only sent if email, external ID or phone is set.
  • Order Fields: billing — Billing first/last name, email, phone, address, city, state, postcode and country. The billing object is only sent if billing phone, email or first name is filled.

Output shape

One JSON item per input item: the bridge API's response, with a human-readable 'response' string added at the top.

On success the 'response' text reads 'Order was created successfully.' when the API returns an order_id or id, and otherwise 'Order request completed.'. If the API returns status or success false, 'response' carries its message. If the API response already has a 'response' key, the original is returned under 'raw'. With Continue On Fail enabled, failures return {error: message}. Setting Dry Run sends dry_run: true, but what the server does with it isn't visible in the source.

Examples

Example 1: Create a WhatsApp order for a customer, with stock allocated automatically by earliest expiry

Input Mode: Use Fields. Order Fields: channel=whatsapp, customer_phone, customer_first_name, auto_allocate_batches=true, batch_strategy=fefo, payment_method=Cash. Order Items: product_id with quantity 2.

Example 2: Validate an order payload without committing it

Order Fields: dry_run=true, plus the usual customer and items.

Example 3: Send a custom payload built upstream

Input Mode: Advanced JSON. JSON Body: {{ $json.orderPayload }}

Links

Discussion