Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warp Freight API — Examples

License: MIT

Working examples that quote → book → track an LTL shipment against the Warp freight API. Same flow in six languages.

Language Path
curl (bash) curl/
Node.js node/
Python python/
Go go/
Ruby ruby/
PHP php/

The Warp freight API in 30 seconds

Three endpoints. Bearer auth with a wak_* token.

Step Method + path Body Returns
1. Quote POST https://www.wearewarp.com/api/v1/warp/freight/quote {pickupZip, deliveryZip, pickupDate, pallets, weightPerPallet} {ok, quotes: [{quoteId, carrier, rate, transitDays, mode}]}
2. Book POST https://www.wearewarp.com/api/v1/warp/freight/book {quoteId, pickupDate, pallets, weightPerPallet, pickup: {…}, delivery: {…}} {ok, trackingNumber, orderId, shipmentId, charged, stripePaymentIntentId}
3. Track GET https://www.wearewarp.com/api/v1/warp/freight/track/{trackingNumber} {shipmentId, status, events: […]}

All examples ship a 1-pallet 500-lb LTL from 90007 (Los Angeles) to 90038 (Hollywood) with pickup on 2026-06-25 — that lane is known to return a Warp quote so the examples actually run end-to-end against the live API.

Get an API key

npm install -g @warpfreight/cli-agent
warp-agent signup
# wak_live_* + wak_test_* saved to ~/.warp/config.json

Or grab a key from your Warp portal after signing up.

Set the environment variable each example reads:

export WARP_API_KEY="wak_test_..."   # sandbox — no real charges
# or
export WARP_API_KEY="wak_live_..."   # production — real labels, real money

Run any example

# curl  — no deps
./curl/quote-book-track.sh

# node 20+ — no deps
node node/quote-book-track.mjs

# python 3.8+ — no deps (uses stdlib urllib)
python3 python/quote_book_track.py

# go 1.21+
go run go/main.go

# ruby 3+
ruby ruby/quote_book_track.rb

# php 8+
php php/quote_book_track.php

What each example does

  1. Sends a quote request → captures the Warp quoteId from the response
  2. Books the quote with pickup + delivery addresses → captures the tracking number
  3. Tracks the shipment by tracking number → prints current status

Each runs as a single script with no framework dependencies. Read time per file: ~2 minutes.

Sandbox vs. live

Key prefix Behavior
wak_test_* Sandbox. Quotes are real (read-only); bookings return synthetic tracking numbers and never charge a card.
wak_live_* Production. Bookings dispatch real carriers and charge your card on file.

The book step in each example charges ~$98.36 (1 pallet × 500 lb on the 90007→90038 lane) when run with a live key. Use wak_test_* if you're just exploring.

Companion projects

License

MIT © Warp Technology, Inc.

About

Quote → book → track examples for the Warp freight API in curl, Node, Python, Go, Ruby, and PHP.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages