Skip to content

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:

bash
-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 all pk_live_* API key requests
  • Sandbox API: https://api-sandbox-wnizuypena-uw.a.run.app — Handles all pk_test_* API key requests

Automatic Routing

The SDK automatically routes requests based on your API key prefix:

  • pk_test_* keys → Sandbox API endpoint
  • pk_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 Sandbox
  • pk_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.

bash
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

json
{
  "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.

bash
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

json
{
  "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.

bash
curl https://balance-api.pacspace.io/dashboard/contracts/tnt_xyz789/status \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response 200 OK

json
{
  "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

StatusMeaning
not_provisionedEnvironment has not been activated yet
provisioningSetup is in progress
activeReady to accept API requests
errorProvisioning failed — contact support

List Environments

Retrieve all provisioned environments for your tenant.

bash
curl https://balance-api.pacspace.io/dashboard/contracts \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response 200 OK

json
{
  "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"
    }
  ]
}

  1. Register an account and verify your email (Sandbox is auto-provisioned)
  2. Create a Sandbox API keyPOST /dashboard/api-keys with "environment": "test"
  3. Build and test — use the Sandbox key to develop your integration
  4. Upgrade your plan — select Pilot or above from the dashboard
  5. Activate Production — from the dashboard Settings page or via POST /dashboard/contracts/provision
  6. Create a Production API keyPOST /dashboard/api-keys with "environment": "live"
  7. 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

EndpointMethodDescription
/dashboard/auth/preferencesPATCHUpdate environment preference
/dashboard/contracts/provisionPOSTProvision a new environment
/dashboard/contracts/:tenantId/statusGETCheck environment status
/dashboard/contractsGETList all environments