API Reference
Complete documentation for all StateSet Commerce Network APIs. All API endpoints are RESTful and return JSON responses.๐ Base URLs
๐ Authentication
All requests must include your API key in the Authorization header:๐ Core APIs
Stablecoin API
Issue, redeem, and transfer ssUSD stablecoinsKey Endpoints:
POST /stablecoin/issue
POST /stablecoin/redeem
POST /stablecoin/transfer
GET /stablecoin/balance
Payments API
Process payments and handle transactionsKey Endpoints:
POST /payments/create
GET /payments/{id}
POST /payments/refund
GET /payments/list
Orders API
Manage e-commerce orders and fulfillmentKey Endpoints:
POST /orders/create
PATCH /orders/{id}
POST /orders/{id}/fulfill
GET /orders/list
Finance API
Trade finance, factoring, and lendingKey Endpoints:
POST /finance/invoices/factor
POST /finance/po/finance
POST /finance/loans/create
GET /finance/options
AI Agents API
Deploy and manage autonomous agentsKey Endpoints:
POST /agents/create
POST /agents/{id}/execute
GET /agents/{id}/activity
PATCH /agents/{id}/config
Global Commerce API
Cross-border trade and complianceKey Endpoints:
POST /global/orders/create
POST /global/compliance/check
GET /global/tax/calculate
POST /global/shipping/quote
๐ง Common Parameters
Pagination
Most list endpoints support pagination:Parameter | Type | Description | Default |
---|---|---|---|
limit | integer | Number of records to return | 10 |
starting_after | string | Cursor for pagination | null |
ending_before | string | Cursor for reverse pagination | null |
Filtering
List endpoints support filtering:Expanding Objects
Request nested objects in a single call:๐จ Request Format
Headers
Header | Required | Description |
---|---|---|
Authorization | Yes | Bearer token with your API key |
Content-Type | Yes* | application/json for POST/PUT/PATCH |
Idempotency-Key | No | Unique key for safe retries |
X-Account-Id | No | Act on behalf of a connected account |
Request Body
All POST, PUT, and PATCH requests accept JSON:๐ค Response Format
Success Response
Error Response
๐ Idempotency
Ensure safe retries with idempotency keys:๐ Rate Limits
Plan | Requests/Second | Daily Limit | Burst |
---|---|---|---|
Free | 10 | 1,000 | 20 |
Starter | 100 | 100,000 | 200 |
Growth | 1,000 | 10,000,000 | 2,000 |
Enterprise | Custom | Custom | Custom |
๐ CORS
The API supports CORS for browser-based requests:๐ Security
API Key Types
Key Type | Prefix | Usage |
---|---|---|
Secret | sk_test_ / sk_live_ | Server-side only |
Public | pk_test_ / pk_live_ | Client-side safe |
Restricted | rk_test_ / rk_live_ | Limited permissions |
Best Practices
- Never expose secret keys in client-side code
- Use HTTPS for all requests
- Verify webhooks with signature validation
- Implement retry logic with exponential backoff
- Monitor rate limits and implement caching
๐ก Webhooks
Register webhooks to receive real-time events:๐งช Testing
Test Mode
Use test API keys to simulate transactions:- No real money movement
- Immediate transaction processing
- Special test card numbers available
Test Data
Resource | Test ID Format | Example |
---|---|---|
Customer | cust_test_* | cust_test_123 |
Payment | pay_test_* | pay_test_456 |
Order | ord_test_* | ord_test_789 |