Vendu Docs
ProductDevelopers
/

Product

Getting started

  • What Vendu does
  • How the agent decides what to say

Team

  • Roles and permissions

Orders

  • The order lifecycle

Automation

  • Triggers and actions

Apps

  • What apps are

Conversations

  • When the agent hands over

Developers

API

  • Build on Vendu
  • API error codes
  • Make your first API call
  • MCP server
  • Migrate from offset to cursor pagination
  • Outbound webhooks
  • Rate limits
  • Versioning and deprecation

Apps

  • Build an app

api · guide

Make your first API call

How to create an API key and call the Vendu REST API from curl, JavaScript, Python or Go.

The Vendu API has official client libraries in TypeScript, Python (planned), and Go (planned). All SDKs are generated from the single source of truth: the OpenAPI specification.


TypeScript (working)

Install

Publishing to npm is pending. Until then, install from source.

npm install @vendu/sdk   # once published
# OR from monorepo source:
npm install ./sdks/ts

Auth

Every request is authenticated with an API key from Settings → Developers → API Keys. Keys start with vk_live_ in production.

These are not the same keys the MCP server uses. Vendu has two key types, for two different surfaces: a REST API key (vk_live_…, Settings → Developers) authenticates /api/v1/*, and an MCP key (vndu_…, Settings → Integrations) authenticates an AI assistant connecting to your workspace. One will not work in place of the other, and a 401 when they are swapped is the most common first mistake.

First call

import { VenduClient, VenduApiError } from '@vendu/sdk'

const client = new VenduClient({ apiKey: 'vk_live_...' })

// List orders (page 1)
const page = await client.orders.list({ limit: 20 })
console.log(page.data)        // Order[]
console.log(page.next_cursor) // string | null

// Fetch next page
if (page.has_more) {
  const page2 = await client.orders.list({ cursor: page.next_cursor! })
}

// Single order
const order = await client.orders.get('uuid')

// Products
const products = await client.products.list()
const newProduct = await client.products.create({ name: 'Dress', price: 499 })

// Conversations
const conversations = await client.conversations.list()

Error handling

try {
  await client.orders.list()
} catch (err) {
  if (err instanceof VenduApiError) {
    // HTTP 4xx / 5xx
    console.error(err.status)                 // e.g. 429
    console.error(err.problem.title)          // "Rate limit exceeded"
    console.error(err.problem.retry_after_sec) // 30
  } else {
    throw err // network / TLS error
  }
}

Regenerating types

Types in sdks/ts/src/types.ts are derived from openapi.yaml.

npm run sdk:generate   # regenerate
npm run sdk:check      # CI check: fail if stale

Python (skeleton)

pip install vendu-sdk  # once published — see docs/BLOCKERS.md
from vendu import VenduClient, VenduApiError

client = VenduClient(api_key="vk_live_...")
orders = client.orders.list(limit=20)

Status: skeleton — methods raise NotImplementedError. Full transport pending publish blocker in docs/BLOCKERS.md.


Go (skeleton)

go get github.com/vendu/sdk-go  # once published — see docs/BLOCKERS.md
client := vendu.NewClient("vk_live_...")
orders, err := client.Orders.List(ctx, vendu.ListParams{Limit: 20})

Status: skeleton — methods return ErrNotImplemented. Full transport pending publish blocker in docs/BLOCKERS.md.


Generate script reference

ScriptCommandDescription
sdk:generatenpm run sdk:generateRegenerate sdks/ts/src/types.ts from openapi.yaml
sdk:checknpm run sdk:checkCI check — exits 1 if types are stale

See sdks/README.md for the full directory structure.


CLI (npx vendu)

The vendu CLI (in cli/) is the fastest way to make a first API call from the terminal — it reuses @vendu/sdk.

# Authenticate (paste a key or set VENDU_API_KEY), then make a call
npx vendu auth
npx vendu list-orders --limit 5 --json
CommandDescription
vendu initInteractive setup → writes .vendu config
vendu authValidate + persist an API key (paste/env, not device-flow yet)
vendu list-orders / list-conversationsRead resources (--json for scripting)
vendu test-webhook <url>POST a sample event to your webhook URL
vendu docsOpen the developer portal

Auth is key-based today; the full browser device-flow and npm publish of the vendu package are tracked in docs/BLOCKERS.md (T-6).

Last updated 2026-07-29

On this page

  • TypeScript (working)
  • Install
  • Auth
  • First call
  • Error handling
  • Regenerating types
  • Python (skeleton)
  • Go (skeleton)
  • Generate script reference
  • CLI (npx vendu)