Enterprise Commerce API

StateSet API

Enterprise-grade REST API powering intelligent commerce. 50+ endpoints for complete order lifecycle management, built with Rust for maximum performance and reliability.

50+
REST Endpoints
113K
Lines of Rust
15+
API Resources
99.99%
Uptime SLA

API Resources

Comprehensive REST endpoints for every aspect of your commerce operations

Orders

Complete order lifecycle management with line items, notes, and fulfillment tracking

Endpoints

GET/orders
POST/orders
GET/orders/{id}
PUT/orders/{id}
DELETE/orders/{id}
GET/orders/{id}/line-items

Features

Line item managementOrder notesStatus transitionsFulfillment tracking

Authentication

Multiple authentication methods to suit your integration needs

JWT Authentication

Secure token-based authentication for user sessions

// Login to get JWT token
const response = await fetch('https://api.stateset.com/auth/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'secure_password'
  })
});

const { access_token, refresh_token } = await response.json();

// Use token in subsequent requests
const orders = await fetch('https://api.stateset.com/orders', {
  headers: {
    'Authorization': `Bearer ${access_token}`
  }
});

Built for Scale

Enterprise-grade architecture designed for high-throughput commerce operations

Rust + Axum

High-performance async runtime with type-safe routing and middleware

SeaORM

Async ORM with PostgreSQL/SQLite support and migration management

Event Sourcing

CQRS pattern with event outbox for reliable event publishing

gRPC Support

High-performance binary protocol for service-to-service communication

Webhook Delivery

Reliable webhook dispatch with retry logic and signature verification

Enterprise Security

JWT + API key auth, RBAC, audit logging, and data encryption

Request Flow Architecture

Client
API Gateway
Auth Layer
Service Layer
Database
Event Bus
AI-Native Commerce

Agentic Commerce Protocol

Purpose-built for AI agents to interact with your commerce operations

ChatGPT Plugin

Native integration with OpenAI ChatGPT for conversational commerce

Agentic Commerce Protocol

Standardized protocol for AI agent interactions with commerce APIs

Tool Definitions

Pre-built function schemas for LLM tool use and function calling

Action Workflows

Multi-step action sequences that AI agents can execute autonomously

AI Agent Integration Example

Connect your AI agents to StateSet API with function calling

// Define tools for your AI agent
const tools = [
  {
    name: "create_order",
    description: "Create a new order in the system",
    parameters: {
      customer_id: { type: "string", required: true },
      line_items: { type: "array", required: true },
      shipping_address: { type: "object", required: true }
    }
  },
  {
    name: "check_inventory",
    description: "Check inventory levels for products",
    parameters: {
      product_ids: { type: "array", required: true },
      warehouse_id: { type: "string", required: false }
    }
  },
  {
    name: "process_return",
    description: "Initiate a return for an order",
    parameters: {
      order_id: { type: "string", required: true },
      reason: { type: "string", required: true },
      items: { type: "array", required: true }
    }
  }
];

// Agent executes tool calls via StateSet API
async function executeTool(name, params) {
  const response = await fetch(`https://api.stateset.com/${name}`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(params)
  });
  return response.json();
}

Quick Start

Get started with the StateSet API in minutes

01

Get Your API Key

Sign up for StateSet and generate your API credentials from the dashboard

stateset_api_key_your_key_here
02

Make Your First Request

Test your connection by fetching orders from the API

curl -X GET https://api.stateset.com/orders \
  -H "Authorization: Bearer stateset_api_key_..."
03

Build Your Integration

Use our SDKs and documentation to build your commerce workflows

npm install @stateset/api-client

Ready to Build?

Start building intelligent commerce experiences with the StateSet API