API Testing with Postman
Test Staqr and Commerce APIs interactively using Postman's GUI interface - no coding required.
What are Postman Collections?โ
Postman collections are pre-configured sets of API requests that you can import into Postman Desktop or Postman Web to test APIs visually.
Benefits:
- ๐ฏ No command-line knowledge required
- ๐ Save and reuse API requests
- ๐ View formatted JSON responses
- โ Perfect for support engineers, sales demos, partner onboarding
- ๐งช Test workflows interactively
Available Collectionsโ
Staqr Platform APIโ
Download: Staqr-Platform-API.postman_collection.json
Coverage:
- Flows API - Create, list, execute flows
- Connections API - Manage integration credentials
- Folders API - Organize flows and connections
- Users API - User management
- Platform API - System configuration
Size: ~15MB Endpoints: 100+ requests organized by category
Commerce API v1 (Recommended)โ
Download: Commerce-API-v1.postman_collection.json
Coverage:
- Customer Management - Create and manage customers
- Subscription Management - Subscriptions, services, products
- Billing - Invoices, payments, wallets
- Orders - Create and track orders
Size: ~15MB Endpoints: 200+ business-focused requests Status: โ Recommended for new integrations
Commerce API v2 (Generic CRUD)โ
Download: Commerce-API-v2.postman_collection.json
Coverage:
- Generic entity CRUD operations
- Simpler, more RESTful interface
Size: ~7MB Endpoints: 50+ generic operations Use for: Simple entity management
Commerce API v0 (Legacy)โ
Download: Commerce-API-v0.postman_collection.json
Coverage: Complete legacy API (for migration support only)
Size: ~83MB Status: โ ๏ธ Legacy - use v1 or v2 for new work
Pre-configured Environmentsโ
Sandbox Environment (Recommended)โ
Download: Sandbox.postman_environment.json
Configuration:
{
"baseUrl": "https://sandbox.api.staqr.com",
"apiKey": "(set this yourself)",
"sellerId": "demo-seller",
"commerceBaseUrl": "https://sandbox-commerce.staqr.com/api"
}
Use for: API exploration, partner testing, sales demos
Development Environment (Local)โ
Download: Development.postman_environment.json
Configuration:
{
"baseUrl": "http://localhost:4600",
"apiKey": "(from your .env file)",
"sellerId": "local-seller",
"commerceBaseUrl": "http://localhost:8080/api"
}
Requires: Local Staqr API running (npm run dev)
Use for: Local development, debugging
Quick Start Guideโ
Step 1: Install Postmanโ
Download Postman Desktop: https://www.postman.com/downloads/
Or use Postman Web: https://www.postman.com/ (requires account)
Step 2: Import Collectionโ
- Open Postman
- Click Import button (top-left)
- Click Upload Files
- Select downloaded collection JSON file
- Click Import
The collection appears in the left sidebar.
Step 3: Import Environmentโ
- Click Environments tab (left sidebar)
- Click Import
- Select
Sandbox.postman_environment.json - Click Import
Step 4: Configure API Keyโ
- Click Environments โ "Staqr Sandbox"
- Find the
apiKeyrow - Click in the Current Value field
- Paste your API key
- Click Save
Get your API key:
- Sandbox: https://sandbox.staqr.com/settings/api-keys
- Development: Check your
.envfile forAP_API_KEY
Step 5: Select Environmentโ
- Click the Environment dropdown (top-right)
- Select "Staqr Sandbox"
Step 6: Test an Endpointโ
- Expand the collection in the sidebar
- Click on a request (e.g., "List Flows")
- Click the Send button
- View the response in the bottom panel
Success! You just called the API without writing any code.
Example: Testing the Flows APIโ
List All Flowsโ
- Collection: Staqr Platform API
- Folder: Flows
- Request: List Flows (GET)
- Expected Response:
{
"data": [
{
"id": "flow-uuid",
"name": "My Flow",
"status": "active",
"trigger": { "type": "webhook" }
}
]
}
Create a New Flowโ
- Request: Create Flow (POST)
- Body: Already pre-populated with example
- Click Send
- Expected Response: 201 Created with flow details
Authenticationโ
All collections use Bearer token authentication:
Authorization: Bearer {{apiKey}}
The {{apiKey}} variable is automatically populated from your active environment.
Getting an API Keyโ
Sandbox:
- Visit https://sandbox.staqr.com
- Sign in or create account
- Navigate to Settings โ API Keys
- Click Create New Key
- Copy the key
- Paste into Postman environment
Development:
- Open your
.envfile in the project root - Find
AP_API_KEY=... - Copy the value
- Paste into Development environment
Common Issuesโ
"401 Unauthorized"โ
Cause: API key not set or incorrect
Fix:
- Check environment is selected (top-right dropdown)
- Click Environments โ Your environment
- Verify
apiKeyhas a value in Current Value column - Save environment
- Retry request
"404 Not Found"โ
Cause: Incorrect base URL
Fix:
- Check
baseUrlin your environment - Verify it matches your deployment:
- Sandbox:
https://sandbox.api.staqr.com - Development:
http://localhost:4600
- Sandbox:
"Connection Refused" (Development)โ
Cause: Local API server not running
Fix:
# Start Staqr API locally
npm run dev
"CORS Error" (Postman Web)โ
Cause: Browser security blocking request
Fix: Use Postman Desktop app instead (no CORS restrictions)
Advanced Featuresโ
Running Collection Testsโ
Postman can run entire collections automatically:
- Click collection name
- Click Run button (Collection Runner)
- Select environment
- Click Run [Collection Name]
- View pass/fail results
Variables and Scriptingโ
Collections use Postman variables:
{{baseUrl}}- API server{{apiKey}}- Your token{{sellerId}}- Tenant ID
You can add custom variables in environments.
Sharing Collectionsโ
Safe to share:
- โ Collection JSON files (no credentials)
- โ Empty environment templates
Never share:
- โ Environments with real API keys filled in
- โ Production credentials
Regenerating Collectionsโ
Collections are auto-generated from OpenAPI specs. To get the latest version:
From Repository:
# Generate locally
npm run generate:postman
# Collections updated in postman/ directory
From GitHub Releases: Collections are attached to each release:
- Visit https://github.com/staqr/staqr/releases/latest
- Download collection JSON files from Assets section
- Re-import into Postman (overwrites old version)
Integration with Other Toolsโ
Use with SDKsโ
- Explore in Postman - Understand API behavior visually
- Copy request details - See exact parameters needed
- Generate code - Use SDK with copied parameters
Use with Documentationโ
- Read endpoint docs - Understand what API does
- Test in Postman - Try it interactively
- Verify behavior - Confirm documentation is accurate
Programmatic Access with SDKsโ
Prefer programmatic access? Our SDKs provide type-safe, language-native interfaces:
| Language | Documentation | Status |
|---|---|---|
| TypeScript | TypeScript SDK Guide | Stable |
| Python | Python SDK Guide | Stable |
| PHP, Java, C#, Go | SDK Overview | Coming Soon |
Why use SDKs?
- Type safety and IDE autocomplete
- Pre-built request/response models
- Error handling built-in
- Same OpenAPI specs as these Postman collections
See SDK Libraries Overview for the complete language support matrix.
Supportโ
Having issues?
- Check Common Issues section above
- Review postman/README.md in repository
- Contact support: support@staqr.com
Want to contribute? Collections are auto-generated from OpenAPI specs. To improve them:
- Improve OpenAPI spec documentation
- Run
npm run generate:postman - Submit PR with updated collections