Skip to main content
Routal

Recipes

Complete, runnable integration walkthroughs, one per common operation rhythm.

The pages in this section are complete, runnable scenarios, not snippets. Each one walks from the business problem (the conversation a sales rep has with a prospect) to a production-ready integration (the runbook a platform team needs), in the three languages most Routal integrations ship today.

Find the one closest to your operation:

B2B / ERP-driven

  • Nightly batch for B2B distribution: orders close yesterday at 18:00, the fleet rolls out today at dawn. The default mode for food distributors, beverage wholesalers, and industrial supply.
  • Nightly batch + live dispatch: most of the work is the nightly batch, but new orders keep arriving during operations and have to be slotted into active routes without disrupting in-progress drivers.
  • Capacitated distribution: weight, volume, cold chain, oversized loads. The optimizer respects every constraint; failing to declare them costs you trips.
  • Package tracking: one delivery stop, many tracked parcels. Per-parcel pending → picked → delivered status and partial-delivery reconciliation back into your WMS. It layers onto any delivery operation.
  • Reverse logistics: pickups, returns, RMA, asset recovery. Pure pickup routes or mixed delivery + pickup via Routal's chain mechanic.

B2C / consumer-facing

  • Last-mile e-commerce: B2C parcel delivery with high stop count per route and customer-facing tracking links sent automatically by Routal's customers app.
  • Same-day grocery delivery: dark stores and same-day grocers. Continuous order flow, wave optimization every N minutes, cold-chain enforcement.

Service & calendar-driven

  • Field service with appointments: technicians, installers, mobile workforce. Tight time windows, skill-matched assignment, signature/photo/checklist tasks on completion.
  • Recurring services: maintenance, ITV, gas refills, elevators. Same customer every N weeks at the same contracted slot, and the schedule itself is the product.

Each recipe opens with a TL;DR card (industry, ERPs, restrictions, flow in N steps) plus an "Open in AI" button that pastes the recipe context into your assistant of choice. Below the card, a one-paragraph business profile (who this is for, what their pain is, what their daily rhythm looks like), then the architectural decisions and the production code.

Conventions across all recipes

  • IDs in code samples are placeholders. YOUR_KEY, YOUR_PROJECT_ID, PLAN_ID, ROUTE_ID, STOP_ID. Replace them with real 24-char hex values from your tenant.
  • external_id is your idempotency lever. Every recipe assumes you carry a stable identifier from your source system (order number, vehicle plate, job ID, ticket ID). If you don't have one, generate it before the integration starts: retries become much cheaper.
  • Timestamps are ISO 8601 UTC. Time windows on stops and vehicles use seconds from midnight ([28800, 61200] = 8am–5pm in the project's local time).
  • All snippets redact private_key from log lines. The key in a URL is the biggest leak vector, see Authentication.
  • Examples are deliberately geography-agnostic. Routal customers run on five continents; placeholder coordinates and customer names work in any jurisdiction.