Environments
Manage Sandbox and Production environments, switch between them, and activate Production.
PacSpace supports two environments:
- Sandbox — For development and testing. No cost. Automatically activated when you register.
- Production — For live, verified data. Available on paid plans (Pilot and above).
New accounts: Your Sandbox environment is activated automatically during registration. You can start using the API immediately — no manual provisioning required.
All routes require a valid JWT in the Authorization header:
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Base URL: https://balance-api.pacspace.io
API Endpoints and Infrastructure
PacSpace V3.6 uses separate API endpoints for Sandbox and Production environments, each running on dedicated infrastructure.
Endpoint Structure
- Production API:
https://api.pacspace.io— Handles allpk_live_*API key requests - Sandbox API:
https://api-sandbox-wnizuypena-uw.a.run.app— Handles allpk_test_*API key requests
Automatic Routing
The SDK automatically routes requests based on your API key prefix:
pk_test_*keys → Sandbox API endpointpk_live_*keys → Production API endpoint
No manual endpoint configuration needed — the SDK handles routing transparently.
Dedicated Infrastructure
Each environment runs on isolated infrastructure:
- Sandbox: Separate infrastructure for development and testing, ensuring test data never affects production
- Production: Dedicated infrastructure with higher availability and throughput for live verified records
This separation provides true isolation between environments, not just logical separation. Your test operations run on completely separate systems from production.
Switching Environments
Once you have both Sandbox and Production active, you can switch between them from the dashboard header. The toggle is available globally on every page.
How it works:
- Your environment preference is saved to your account and persists across devices and browsers
- When in Sandbox mode, a persistent amber banner appears to remind you that operations are for testing only
- When in Production mode, a green indicator confirms you're working with live data
API keys are scoped to environments:
pk_test_...keys only work in Sandboxpk_live_...keys only work in Production
This means you can't accidentally write test data to production or vice versa.
Update Preferred Environment
Save the user's active environment preference to their account.
curl -X PATCH https://balance-api.pacspace.io/dashboard/auth/preferences \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"preferredEnvironment": "production"
}'
Valid values: sandbox or production.
Response 200 OK
{
"statusCode": 200,
"data": {
"preferredEnvironment": "production"
},
"message": "Preferences updated successfully"
}
Provision an Environment
Activate Sandbox or Production infrastructure for your tenant.
Note: Sandbox is auto-provisioned on registration. You only need this endpoint for Production, or if you need to re-provision.
curl -X POST https://balance-api.pacspace.io/dashboard/contracts/provision \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"environment": "mainnet"
}'
Valid values for environment: testnet (Sandbox) or mainnet (Production).
Production requires a paid plan. Free-tier tenants will receive a 403 Forbidden response when attempting to provision Production. Upgrade to Pilot or above first.
Response 201 Created
{
"statusCode": 201,
"data": {
"tenantId": "tnt_xyz789",
"environment": "mainnet",
"status": "provisioning",
"message": "Environment is being provisioned. This usually takes a few seconds."
}
}
Provisioning is typically fast (under 30 seconds). Use the status endpoint below to confirm when it's ready.
Check Environment Status
Check whether a specific environment has been provisioned and is ready to use.
curl https://balance-api.pacspace.io/dashboard/contracts/tnt_xyz789/status \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response 200 OK
{
"statusCode": 200,
"data": {
"tenantId": "tnt_xyz789",
"environments": [
{
"environment": "testnet",
"status": "active",
"provisionedAt": "2026-01-15T12:00:05.000Z"
},
{
"environment": "mainnet",
"status": "active",
"provisionedAt": "2026-02-01T09:00:10.000Z"
}
]
}
}
Status Values
| Status | Meaning |
|---|---|
not_provisioned | Environment has not been activated yet |
provisioning | Setup is in progress |
active | Ready to accept API requests |
error | Provisioning failed — contact support |
List Environments
Retrieve all provisioned environments for your tenant.
curl https://balance-api.pacspace.io/dashboard/contracts \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response 200 OK
{
"statusCode": 200,
"data": [
{
"id": "ctr_abc123",
"tenantId": "tnt_xyz789",
"environment": "testnet",
"status": "active",
"provisionedAt": "2026-01-15T12:00:05.000Z"
},
{
"id": "ctr_def456",
"tenantId": "tnt_xyz789",
"environment": "mainnet",
"status": "active",
"provisionedAt": "2026-02-01T09:00:10.000Z"
}
]
}
Recommended Setup Flow
- Register an account and verify your email (Sandbox is auto-provisioned)
- Create a Sandbox API key —
POST /dashboard/api-keyswith"environment": "test" - Build and test — use the Sandbox key to develop your integration
- Upgrade your plan — select Pilot or above from the dashboard
- Activate Production — from the dashboard Settings page or via
POST /dashboard/contracts/provision - Create a Production API key —
POST /dashboard/api-keyswith"environment": "live" - Go live — switch to Production in the dashboard header and use your production key
Dashboard Visual Indicators
The dashboard provides clear visual cues so you always know which environment you're working in:
- Environment toggle — Available in the header on every page. Shows Sandbox (amber) and Production (green).
- Sandbox banner — A persistent amber banner appears below the header when Sandbox is active: "Sandbox Mode — Data here is for testing only and does not affect production."
- Production locked — If your plan doesn't support Production, the toggle shows a lock icon. Upgrade to unlock.
Endpoints Summary
| Endpoint | Method | Description |
|---|---|---|
/dashboard/auth/preferences | PATCH | Update environment preference |
/dashboard/contracts/provision | POST | Provision a new environment |
/dashboard/contracts/:tenantId/status | GET | Check environment status |
/dashboard/contracts | GET | List all environments |