Overview
Sandbox authentication uses the same two layers as production:- X.509 certificate (mTLS) — issued by NTX Pay at onboarding.
- OAuth 2.0
client_credentials—clientId+clientSecretreceived during signup.
Authorization: Bearer ....
Sandbox credentials are distinct from production. If you use production credentials against
https://sandbox.mx.ntxpay.com, you will get 401. The HTTP contract is identical — what changes is the certificate + clientId/clientSecret pair.Get a Token
POST /api/auth/token
Response (201)
Use the Token
On a sandbox account, any authenticated call simulates the full pipeline without moving real money:201 Created with status: PENDING. The final outcome (confirmation or failure) arrives via webhook ~1 second later. See Scenarios to force specific outcomes.
Renewal
The token expires in 10 minutes (600s). There is no refresh token — get a new one viaPOST /api/auth/token before expiration.
Common Errors
| Code | Cause | Fix |
|---|---|---|
400 | X-SSL-Client-Cert missing | Configure NGINX/ALB to forward the certificate |
401 | Invalid clientId/clientSecret | Double-check credentials; confirm you are using the sandbox ones |
401 | Certificate expired/revoked | Request renewal from NTX Pay |
Detailed documentation
For the full step-by-step (certificate encoding, examples in multiple languages, etc.) see Authentication in the main guide — the only difference is the base URLhttps://sandbox.mx.ntxpay.com.