Skip to main content

StateSet API Reference

Welcome to the StateSet API. Our comprehensive REST and GraphQL APIs enable you to build powerful autonomous business applications that scale with your needs.
API Version: v1 (Current) SDK Versions: Node.js v3.2.0 | Python v2.1.0 | Go v1.4.0 | Ruby v2.0.0 Last Updated: January 2026

REST API

RESTful endpoints for all StateSet resources

GraphQL API

Flexible queries with real-time subscriptions

SDKs

Official SDKs for popular languages

Webhooks

Real-time event notifications
Production Environment:
  • Base URL: https://api.stateset.com/v1
  • GraphQL: https://api.stateset.com/graphql
  • WebSocket: wss://api.stateset.com/v1/ws
Sandbox Environment:
  • Base URL: https://api.sandbox.stateset.com/v1
  • GraphQL: https://api.sandbox.stateset.com/graphql
  • WebSocket: wss://api.sandbox.stateset.com/v1/ws

Quick Start

1

Get Your API Key

  1. Sign up at stateset.com
  2. Navigate to SettingsAPI Keys
  3. Generate a new API key with appropriate scopes
Store your API key securely and never expose it in client-side code.
2

Make Your First Call

Test the connection with a simple API call:
3

Explore Resources

Browse our comprehensive API reference to discover all available endpoints and capabilities.

Authentication

StateSet API uses API key authentication with support for multiple authentication methods to suit different use cases.

API Key Types

API Key Authentication

Environment Variables

We recommend storing your API keys as environment variables:
Never commit API keys to version control. Use environment variables or secure key management services.

Rate Limits

Rate Limits by Plan:
  • Starter: 100 requests/minute, 10,000 requests/day
  • Growth: 1,000 requests/minute, 100,000 requests/day
  • Scale: 5,000 requests/minute, 500,000 requests/day
  • Enterprise: Custom limits up to 10,000 requests/minute
Rate limit headers included in responses:
  • X-RateLimit-Limit: Maximum requests allowed in current window
  • X-RateLimit-Remaining: Requests remaining in current window
  • X-RateLimit-Reset: Unix timestamp when limit resets
  • X-RateLimit-Retry-After: Seconds to wait before retrying (when limited)

Handling Rate Limits

When you exceed rate limits, you’ll receive a 429 Too Many Requests response:
Best practices for handling rate limits:

Error Handling

StateSet API uses conventional HTTP response codes and returns detailed error information in JSON format with consistent error structures.

HTTP Status Codes

Error Response Format

Common Error Codes

  • INVALID_API_KEY: API key is invalid or expired
  • MISSING_API_KEY: No API key provided
  • INSUFFICIENT_PERMISSIONS: API key doesn’t have required permissions
  • VALIDATION_ERROR: Request data failed validation
  • MISSING_REQUIRED_FIELD: Required field not provided
  • INVALID_FIELD_FORMAT: Field format is incorrect
  • RESOURCE_NOT_FOUND: Requested resource doesn’t exist
  • RESOURCE_ALREADY_EXISTS: Resource with same identifier exists
  • RESOURCE_CONFLICT: Operation conflicts with current resource state

Pagination

List endpoints support both offset-based and cursor-based pagination. We recommend cursor-based pagination for better performance and consistency.

Pagination Parameters

Offset-Based Pagination

More efficient for large datasets and handles real-time data changes:
Response format:

Filtering and Sorting

Most list endpoints support powerful filtering and sorting capabilities using a consistent query syntax.

Filter Operators

Common Filter Patterns

Sorting

Official SDKs

Node.js

Python

Ruby

Go

SDK Quick Example

GraphQL API

StateSet offers a powerful GraphQL API for flexible data querying and real-time subscriptions.

GraphQL Endpoint

Basic Query Example

Real-time Subscriptions

Webhooks

StateSet can send webhook notifications for important events in your account. Webhooks enable real-time integrations and automated workflows.

Webhook Configuration

  1. Configure endpoints in Dashboard → Settings → Webhooks
  2. Select events to subscribe to
  3. Add webhook signing secret to verify authenticity
  4. Test with webhook simulator

Webhook Events

  • order.created - New order placed
  • order.updated - Order details modified
  • order.paid - Payment confirmed
  • order.processing - Order processing started
  • order.shipped - Shipment created
  • order.delivered - Delivery confirmed
  • order.cancelled - Order cancelled
  • order.refunded - Refund processed
  • return.created - Return initiated
  • return.approved - Return approved
  • return.received - Items received
  • return.processed - Return completed
  • return.rejected - Return rejected
  • inventory.low_stock - Stock below threshold
  • inventory.out_of_stock - Item out of stock
  • inventory.updated - Stock levels changed
  • inventory.transfer - Stock transferred
  • customer.created - New customer registered
  • customer.updated - Customer profile updated
  • customer.deleted - Customer deleted
  • customer.subscription.created - Subscription started
  • customer.subscription.cancelled - Subscription cancelled

Webhook Payload Structure

Webhook Security & Verification

Testing

Sandbox Environment

The sandbox environment provides a complete testing environment that mirrors production:

Test Data

Idempotency

StateSet API supports idempotency for safely retrying requests without side effects:
Idempotency Keys:
  • Valid for 24 hours after first request
  • Must be unique per API key
  • Recommended format: {resource}-{uuid} (e.g., order-550e8400-e29b-41d4-a716)

API Limits & Quotas

Request Limits by Plan

Resource Limits

Support and Community

API Support

Get help with integration issues

Discord Community

Join our developer community

Status Page

Check API status and uptime

Additional Resources


Ready to get started? Check out our 5-minute quickstart guide or explore the API reference sections below.