Skip to main content
Time to first API call: Less than 5 minutes
Prerequisites: Basic programming knowledge and a StateSet account

Overview

This quickstart guide will walk you through making your first StateSet API call, then progressively build up to a complete integration. By the end, you’ll be able to:
  • ✅ Authenticate with the API
  • ✅ Create and manage orders
  • ✅ Handle webhooks
  • ✅ Implement error handling
  • ✅ Use advanced features

Step 1: Get Your API Keys

1

Sign up for StateSet

Create your account at stateset.com/sign-up
2

Navigate to API Settings

Go to Dashboard → Settings → API Keys
3

Create Your First API Key

Click “Create API Key” and save it securely - you’ll only see it once!
Security First: Never commit API keys to version control. Use environment variables instead.

Step 2: Set Up Your Environment

Step 3: Make Your First API Call

Let’s start with a simple request to list orders:

Step 4: Create Your First Resource

Now let’s create an order:

Step 5: Handle Webhooks

Set up webhook handling for real-time events:

Step 6: Implement Error Handling

Add robust error handling to your integration:

Step 7: Use Advanced Features

Pagination

Handle large datasets efficiently:

Filtering and Searching

Batch Operations

Idempotency

Ensure safe retries with idempotency keys:

Complete Example: Order Management System

Here’s a complete example that ties everything together:

Next Steps

Now that you have a working integration, explore these advanced features:

GraphQL API

Use our GraphQL API for flexible queries

Batch Operations

Process multiple resources efficiently

Real-time Updates

Subscribe to real-time events via WebSockets

Advanced Search

Implement full-text search and filtering

Resources

Documentation

Code Examples

Support

Troubleshooting

Problem: Getting 401 Unauthorized errorsSolutions:
  • Verify your API key is correct and active
  • Check you’re using the right environment (test vs live)
  • Ensure Bearer prefix in Authorization header
  • Verify API key has required permissions
Problem: Getting 429 Too Many Requests errorsSolutions:
  • Implement exponential backoff
  • Cache frequently accessed data
  • Use batch operations where possible
  • Consider upgrading your plan for higher limits
Problem: Webhooks not being receivedSolutions:
  • Verify webhook URL is publicly accessible
  • Check webhook signature verification
  • Ensure your server responds with 2xx status
  • Test with webhook simulator in dashboard
Problem: Getting validation errorsSolutions:
  • Check required fields are included
  • Verify data types match specification
  • Ensure enum values are valid
  • Review error details for specific issues

🎉 Congratulations! You’ve successfully integrated with the StateSet API. You’re now ready to build powerful commerce applications! For questions or feedback, reach out on Discord or email api-support@stateset.com.