Environments
StudentPay NZ runs isolated sandbox and production environments.
| Sandbox | Production | |
|---|---|---|
| Base URL | https://sandbox-api.studentpay.co.nz |
https://api.studentpay.co.nz |
| v1 root | https://sandbox-api.studentpay.co.nz/v1 |
https://api.studentpay.co.nz/v1 |
| Recommended for integration | Yes | After sandbox sign-off |
| API keys | Sandbox-only keys | Production-only keys |
| GoCardless | Sandbox | Live |
| Salesforce | Sandbox org | Production org |
| Test data | Fictional students only | Real enrolments only |
Discovery
GET /v1/environment
No API key. Returns non-secret metadata and a readiness report (missing variable names only).
In the API Reference, keep the server dropdown on Sandbox while you try requests.
The topbar Sandbox status link calls:
https://sandbox-api.studentpay.co.nz/v1/environment
Isolation rules
- Do not reuse production secrets in sandbox (or the reverse)
- Sandbox refuses production Salesforce login URLs
- Production refuses Salesforce sandbox login URLs
- Missing credentials fail closed — they are never borrowed from the other environment
- Browser demo enrolment pages are sandbox-only
Hosted setup URLs
direct_debit.setup_url is minted for the active API host. A sandbox checkout returns a sandbox setup link, for example:
https://sandbox-api.studentpay.co.nz/api/dd-setup?token=eyJ…
Allowlist your enrolment origin with StudentPay if the setup page is embedded or opened from your domain.