Testing against the Apier sandbox
The Apier sandbox mirrors the production API under /api/v1/sandbox/* with synthetic fixtures and never calls a government system; it sets _meta.is_sandbox.
Jurisdiction: Norway · Verified against Apier (synthetic sandbox surface) as of 2026-10-21
What the sandbox guarantees
Sandbox responses are served entirely from in-code synthetic fixtures and ephemeral session state. No real credentials are exchanged: the sandbox auth mirror accepts Bearer tokens of the form apier_sandbox_test_<suffix> and bypasses the live key lookup entirely, and no Maskinporten or Altinn credential is ever spent. Responses are deterministic — same input, same fixture version, same output.
Synthetic companies and personas
Fixture companies use reserved MOD-11-valid organisation numbers (the 999… range; 999999999 is the docs-standard example). Beyond the happy-path fixtures, eleven difficult-company personas in the 999770-series model realistic hard cases (bankruptcy in progress, voluntary liquidation, VAT-deregistered, disputed signature rights, degraded data, merger-absorbed, NUF branch, dormant, and more), each internally consistent across verify, roles, VAT, accounts, obligations, and deadlines.
Failure simulation
Sandbox endpoints support a ?simulate_error= query parameter with the values missing_delegation (a legacy token kept for compatibility; the delegation surfaces are withdrawn), invalid_token, validation_error, and scope_missing. Simulated errors are produced locally and return production-shaped error bodies using the same Compliance Explainer format as production, so an agent can rehearse its error handling without triggering a real failure. Latency simulation is likewise local and deterministic.
No write loop
The former sandbox rehearsal of an MVA write loop is withdrawn (2026-10-21): POST /api/v1/sandbox/rehearsal/execute answers HTTP 410 CAPABILITY_WITHDRAWN, and no sandbox route models a submission to a government system. The sandbox is a read surface: company facts, obligations, deadlines, signing authority and the error envelope, all from fixtures.
Use cases
- Develop and test an agent integration end-to-end before holding a live API key
- Rehearse error handling by inducing production-shaped failures deterministically
- Exercise hard company states (bankruptcy, liquidation, disputed signatur) that are rare in live data
- Demo an onboarding read chain with zero risk of a binding government write
Requirements
- A sandbox bearer token of the form apier_sandbox_test_<suffix> for the authenticated mirror (no registration needed)
- Nothing at all for the zero-auth public sandbox mirror
Authentication
Method: none
The public sandbox mirror is zero-auth; the authenticated mirror accepts any apier_sandbox_test_<suffix> bearer without a live key lookup. No production credential is ever required or accepted on the sandbox path.
Common errors
VALIDATION_FAILED
Returned genuinely for malformed input — or on demand via ?simulate_error=validation_error.
Fix: Fix the input; or if simulating, this is the expected rehearsal outcome.
SANDBOX_TOOL_UNAVAILABLE
The MCP tool called under a sandbox bearer has no sandbox mirror route.
Fix: Use one of the sandbox-mirrored tools/routes, or switch to a live API key for tools without a mirror.
Related topics
Related APIs
These are capability ids; resolve each against the machine-readable manifest at /api/v1/capabilities for the endpoint, auth mode, and tier.
- sandboxCompanyVerify
- sandboxCompanyObligations
Related MCP tools
Registered tools on the Apier MCP server.
- get_company_verification
- get_company_obligations