Skip to content

Sandbox Setup

Before going live, test your integration in the Zatlas sandbox environment.

Contact the Zatlas team to receive:

CredentialExampleWhere to use
Publishable keypk_sandbox_a1b2c3d4...Frontend — passed to ZatlasCardCapture constructor
Client ID3abc123def456...Backend — OAuth2 token exchange
Client secretsecret-xyz-789...Backend — OAuth2 token exchange (keep secret)
Token endpointhttps://cde-api-staging.zatlas.com/oauth2/tokenBackend — where to request access tokens

Your server exchanges client_id + client_secret for a short-lived access token:

Terminal window
curl -X POST https://cde-api-staging.zatlas.com/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"

Response:

{
"access_token": "eyJhbGciOi...",
"expires_in": 3600,
"token_type": "Bearer"
}

This single token works for both tokenization and payments — no need for separate credentials.

  1. Install the SDK: npm install @zatlas/card-capture
  2. Initialize with your sandbox key: new ZatlasCardCapture({ publishableKey: 'pk_sandbox_...' })
  3. Mount the card form and test with the cards below
ScenarioCard NumberCVCResult
Success4242 4242 4242 4242Any 3 digitsPayment succeeds
Mastercard5555 5555 5555 4444Any 3 digitsPayment succeeds
Amex3782 822463 10005Any 4 digitsPayment succeeds
Installments (MSI)4000 0048 4000 0008Any 3 digitsShows installment picker: 3, 6, 9, 12, 18, 24 months
3D Secure4000 0000 0000 3220Any 3 digits3DS challenge flow
Declined4000 0000 0000 0002Any 3 digitscard_declined
Insufficient funds4000 0000 0000 9995Any 3 digitsinsufficient_funds
Expired card4000 0000 0000 0069Any 3 digitsexpired_card
Incorrect CVC4000 0000 0000 0127Any 3 digitsincorrect_cvc

Use any future expiry date (e.g. 12/30).

Walk through each step below to confirm the SDK is working end-to-end in your sandbox environment.

  1. Card form renders on your page
  2. Guest can enter a card number, expiry, and CVC
  3. Card brand is detected (Visa, Mastercard, etc.)
  4. Clicking “Continuar” fires the cta_clicked event
  5. checkout() with card 4242... returns { payment: { status: 'succeeded' } }
  6. checkout() with card 4000...0002 returns { error: { code: 'card_declined' } }
  7. Installment picker appears with card 4000 0048 4000 0008
  8. Decline error is shown to the guest inside the card form
  1. Clicking “Guardar metodo” fires the cta_clicked event
  2. createToken() returns { token: { id: 'mth_...', card: { last4, brand } } }
  3. Your server receives the mth_* token
  4. Your server can create a payment via the Payments API using the token

When sandbox testing is complete, contact the Zatlas team to receive production credentials:

SandboxProduction
pk_sandbox_...pk_live_...
Sandbox client_id / secretProduction client_id / secret
cde-api-staging.zatlas.comcde-api.zatlas.com

No code changes needed — just swap the publishable key and credentials.