Developer Quickstart & OpenAPI
OpenAPI 3.1 JSON ↗Integrate Repackify (or any TMS/marketplace) with https://api.lanecost.com in minutes using @freight/sdk or the machine-readable OpenAPI 3.1 spec at https://api.lanecost.com/openapi.json.
End-to-End TypeScript Example (@freight/sdk)
import { FreightClient, FreightApiError } from "@freight/sdk";
const freight = new FreightClient({
apiKey: process.env.FREIGHT_API_KEY!,
baseUrl: "https://api.lanecost.com",
});
// 1. Pre-flight booking checks (catches past dates, truck capacity, liftgate vs 53' van, missing dock/contact)
const check = await freight.shipments.validate(load);
if (!check.ok) {
console.error("Fix before booking:", check.errors);
}
// 2. Side-by-side multi-carrier quotes (backed by global QuoteCacheDO)
const { quotes, cachedProviderIds } = await freight.quotes.create({
...load,
providerIds: ["warp", "uber_freight"],
});
// 3. Book directly with the cheapest carrier (automatically runs booking checks & assigns loads+<id>@lanecost.com)
const best = quotes[0]!;
const shipment = await freight.shipments.create({
...load,
externalId: "P-0478",
providerId: best.providerId,
providerQuoteId: best.providerQuoteId,
agreedRate: best.total,
bookedBy: { name: "Sarah Rep", email: "sarah@repackify.com" },
});
console.log("Booked:", shipment.id, "Carrier email:", shipment.inboundEmail);
// 4. Generate & immutably archive VICS BOL PDF to R2
const { bytes, documentId } = await freight.documents.bol(bolInput, { shipmentId: shipment.id });
Core API Endpoints (https://api.lanecost.com)
| Method & Path | Purpose |
|---|---|
POST /v1/providers/:id/connect | Validate, AES-256-GCM encrypt, and save carrier credentials (Warp, Uber Freight, TQL, J.B. Hunt, Curri) |
POST /v1/shipments/validate | Carrier-agnostic booking checks (returns plain errors and warnings) |
POST /v1/quotes | Parallel multi-carrier quoting with global QuoteCacheDO caching & rate-limit cooldowns |
POST /v1/shipments | Auto-validates then tenders directly to REST or X12 EDI 204 carrier; assigns loads+<externalId>@lanecost.com |
GET /v1/shipments & GET /v1/alerts | List shipments, flagged carrier emails (needsResponse), and missing PODs (>4h after delivery) |
POST /v1/shipments/:id/carrier-swap | Swap carrier on a live load without falsely cancelling it |
POST /v1/documents/bol & /rate-con | Generate print-ready VICS BOL (with Code-128B barcode) or Rate Confirmation PDF & archive to R2 |