TypeScript SDK

Install and start using the TypeScript SDK.

Intro

The Sayso Shops API SDK provides access to the Sayso Shops API REST APIs.

Buy from small shops on Sayso from any agent platform. Discover shops and products, build a cart with PayPal's Agentic Commerce merchant-cart API, send the buyer to PayPal to approve, then complete the checkout.

Money only moves with a say-so: the buyer approves in PayPal, and each shop's Guard checks stock and the owner's rules before anything is captured. If an order can't go through, the PayPal hold is released and the buyer is not charged.

Agents that speak MCP can use /api/shopping/mcp instead; it offers the same operations as tools.

Installation

The SDK compiles to dist/ before it can be referenced — run its build script once in the SDK folder, then add it to your project by path:

Terminal
npm install <path-to-sdk>

Quick Start

Create one client and reuse it. Configure its behaviour through ClientOptions.

TypeScript
import { SaysoShopsApiClient, ServerEnvironment } from "sayso-shops-api";

const client = new SaysoShopsApiClient({ serverEnvironment: ServerEnvironment.Production });

Nothing in ClientOptions is required — new SaysoShopsApiClient() compiles — and each option left out falls back to its default. serverEnvironment is spelled out above so the environment a call reaches is visible where the client is built rather than inherited silently.

From CommonJS

The package ships both dialects from a single entry, so require works with full types. In a TypeScript CommonJS file use the import ... = require(...) form — a plain destructuring require runs fine but gives you any.

TypeScript
import sdk = require("sayso-shops-api");

const client = new sdk.SaysoShopsApiClient({ serverEnvironment: sdk.ServerEnvironment.Production });

On this page