Skip to content

Sandbox & test cards

Test every payment outcome on the Cardencer sandbox: successful cards, declines and 3D Secure challenges.

The sandbox at https://sandbox.cardencer.com mirrors the live API but routes payments to a test processor. No bank is involved and no real money moves.

Sandbox vs live#

Sandbox Live
Base URL https://sandbox.cardencer.com https://api.cardencer.com
Secret key snd_… prd_…
Publishable key pk_snd_… pk_prd_…
Money moves No Yes

Keys only work in their own environment: a snd_ key against api.cardencer.com, or a prd_ key against the sandbox, returns 401 with error code IR_01.

Test cards#

Use any future expiry date and any 3-digit CVC.

Card number Brand Result
4242 4242 4242 4242 Visa Succeeds
5555 5555 5555 4444 Mastercard Succeeds
4000 0000 0000 0002 Visa Declined
4000 0000 0000 9987 Visa Declined, lost card
4000 0000 0000 9979 Visa Declined, stolen card
4000 0038 0000 0446 Visa 3D Secure challenge, then succeeds

Send the number without spaces in payment_method_data.card.card_number, or type it into the checkout SDK.

Test 3D Secure#

Create a payment with 4000003800000446, "authentication_type": "three_ds" and a return_url:

curl https://sandbox.cardencer.com/payments \
  -H "api-key: $CARDENCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 4900,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "authentication_type": "three_ds",
    "return_url": "https://example.com/checkout/complete",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
      "card": {
        "card_number": "4000003800000446",
        "card_exp_month": "12",
        "card_exp_year": "2030",
        "card_holder_name": "Test Customer",
        "card_cvc": "123"
      }
    }
  }'

The payment returns "status": "requires_customer_action" with a next_action.redirect_to_url. Open that URL in a browser, complete the test challenge, and you land on your return_url. Retrieve the payment: its status is now succeeded. With the checkout SDK, the challenge opens automatically. See 3D Secure / SCA.

Test webhooks#

Your webhook endpoint receives sandbox events exactly as it will in production. Expose a local server with a tunnel (for example ngrok http 3000), register the HTTPS URL as described in Webhooks, then run the quickstart payment.

What the sandbox does not simulate#

  • Settlement timing and payouts to your bank account.
  • Real issuer decisions: only the cards above produce deterministic outcomes.
  • Disputes raised by cardholders.

Once your flows work in the sandbox, follow Going live.