DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk3 min

Create Your First Delivery Task with Relay in Node.js (Test Mode)

Use Relay’s Node tutorial to create a simulated pickup-and-drop-off task from Node.js, and learn why the returned task ID matters for later status checks.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Relay’s test-mode workflow lets you create a simulated delivery task from a Node.js application without involving a real rider or real payment. A task describes a pickup followed by a drop-off. Create it with a test key, then save the returned task ID so your application can associate later status updates with the right order.

What you’ll build

Relay describes its developer API as a way to create and manage delivery tasks, then keep an app in sync through lifecycle events and rider tracking. Its developer page says: “Create and manage delivery tasks with a REST API, then keep your app in sync with WebSocket tracking and webhooks.” Relay developer page.

As an Amazon Associate I earn from qualifying purchases.

This walkthrough follows Relay’s Node tutorial: configure test access, describe a pickup and destination, request simulated processing, and retain the task ID. The code reflects the tutorial’s example; it has not been independently run or verified against the current live documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare test access and your Node project

  1. Create a Relay account and obtain a test key using Relay’s developer documentation. Use the test key for this exercise, not a live credential.

  2. Set the key in a server-side environment variable. Do not put it in browser code, commit it to source control, or paste it into a shared example. The tutorial’s indexed excerpt specifies Node.js 18 or newer; confirm the runtime requirement and current SDK instructions in Relay’s documentation before using this as a production setup.

  3. Install the package used by the tutorial, @relay-sdk/sdk-node, following the package installation instructions in the Relay task tutorial. The current package version has not been independently confirmed.

  4. Save a script in your Node project. The tutorial runs its script with node; use the exact filename you chose when running it.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Describe the pickup and drop-off

The tutorial’s task payload has two ordered stages: a PICKUP with a location and parcel details, followed by a DROPOFF with the destination. Its Lagos addresses and coordinates are demonstration inputs only; they do not establish service coverage. The sample’s estimatedValue is a declared parcel value in kobo, not a delivery quote.

Relay’s example also sets simulationOutcome: 'SUCCESS' and autoAssign: true. In this tutorial context, the outcome is part of the simulation request; it does not mean a live rider is dispatched. Check the current payload schema in Relay’s documentation before adapting the example to your integration.

Create a simulated task

Call the SDK’s task-creation method with the task payload and an idempotency key in the call options, following the tutorial’s example. An idempotency key helps identify a request consistently if your application retries it; use a value appropriate to your own order or request rather than reusing the tutorial’s sample value.

Run the script with node and inspect the response. The tutorial prints the returned task ID and initial status. A successful creation response means Relay accepted the task for processing; it does not mean delivery is complete. This is simulated processing, not authorization for a real rider dispatch or payment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Save the task ID for later updates

Persist the returned task ID alongside your application’s own order or delivery record. That association is what lets your app retrieve the task later and connect lifecycle updates to the correct order. Do not treat the initial status as the final outcome.

Relay describes lifecycle events and webhooks for keeping an application synchronized, and WebSocket tracking for rider location. Those are distinct update mechanisms; the available material does not establish their event names, connection details, or setup steps, so consult Relay’s current documentation before implementing either.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.