Skip to content

Developers · quickstart

From install to a signed delivery in five minutes.

All five SDKs share the same surface: quote → book → webhook → done. Pick your language, install, copy the snippet, run.

Five SDKs

One install. Same shape, every language.

  • TypeScript

    bun add @l1fe/link

  • Python

    pip install l1fe-link

  • Go

    go get github.com/l1feai/link-go

  • Swift

    .package(url: "https://github.com/l1feai/link-swift", from: "0.1.0")

  • Kotlin

    implementation("ai.l1fe:link:0.1.0")

Quickstart — TypeScript

Quote → book → subscribe.

import { LinkClient, jobEventTypes } from "@l1fe/link";

const client = new LinkClient({
  apiKey: process.env.LINK_API_KEY!,
  tenant: "your-platform-id",
});

// 1. Quote
const q = await client.quoteJob({
  tenantRef: "order-12345",
  cityId: "dfw",
  pickups: [{ /* ... */ }],
  dropoff: { /* ... */ },
  cargo: [{ /* ... */ }],
  service: "instant",
});

// 2. Book (idempotent via Idempotency-Key)
if (q.feasible) {
  const job = await client.bookJob({
    quoteId: q.id,
    tenantRef: "order-12345",
    paymentRef: "garden:txn:abc",
    idempotencyKey: "order-12345",
  });
  console.log(job.trackingUrl);
}

// 3. Subscribe to every job lifecycle event
await client.registerWebhook({
  url: "https://your-app.com/hooks/link",
  topics: jobEventTypes,
  secret: process.env.LINK_WEBHOOK_SECRET!,
});

Quickstart — Python

Quote → book → subscribe.

from l1fe_link import LinkClient, job_event_types
import os

client = LinkClient(
    api_key=os.environ["LINK_API_KEY"],
    tenant="your-platform-id",
)

# 1. Quote
q = client.quote_job(
    tenant_ref="order-12345",
    city_id="dfw",
    pickups=[{...}],
    dropoff={...},
    cargo=[{...}],
    service="instant",
)

# 2. Book (idempotent via Idempotency-Key)
if q.feasible:
    job = client.book_job(
        quote_id=q.id,
        tenant_ref="order-12345",
        payment_ref="garden:txn:abc",
        idempotency_key="order-12345",
    )
    print(job.tracking_url)

# 3. Subscribe to every job lifecycle event
client.register_webhook(
    url="https://your-app.com/hooks/link",
    topics=job_event_types,
    secret=os.environ["LINK_WEBHOOK_SECRET"],
)

Quickstart — Go

Quote → book → subscribe.

package main

import (
    "context"
    "log"
    "os"

    link "github.com/l1feai/link-go"
)

func main() {
    ctx := context.Background()
    client, err := link.NewClient(link.Config{
        APIKey: os.Getenv("LINK_API_KEY"),
        Tenant: "your-platform-id",
    })
    if err != nil { log.Fatal(err) }
    defer client.Close()

    q, err := client.QuoteJob(ctx, link.JobRequest{
        TenantRef: "order-12345",
        CityID:    "dfw",
        Service:   "instant",
    })
    if err != nil { log.Fatal(err) }

    if q.Feasible {
        job, err := client.BookJob(ctx, link.BookArgs{
            QuoteID:        q.ID,
            TenantRef:      "order-12345",
            PaymentRef:     "garden:txn:abc",
            IdempotencyKey: "order-12345",
        })
        if err != nil { log.Fatal(err) }
        log.Println(job.TrackingURL)
    }
}

Next

Full Tenant API reference.

Every endpoint, every error code, every event type. Swift and Kotlin SDKs follow the same shape — see the per-language READMEs in the sdk/ tree.