yAppointment Developers

Sandbox Mode

The sandbox environment lets you build and test your integration without affecting live data or processing real payments.

Key Differences

| Aspect | Live | Sandbox | |--------|------|---------| | Data isolation | Shared | Isolated test database | | Payments | Real charges | Fake charges (no money moves) | | Key prefix | yapp_sk_live_ | yapp_sk_test_ | | Email sending | Real emails | Logged, not sent | | Webhooks | Production | Test events |

Getting a Sandbox Key

  1. Go to Admin Settings > Integrations > API Keys
  2. Under Test Keys, click Create New Key
  3. Name it (e.g., "Local Development")
  4. Copy the key (starts with yapp_sk_test_)

Using Test Keys

Simply replace your live key with a test key in requests:

curl -H "Authorization: Bearer yapp_sk_test_YOUR_TEST_KEY" \
https://api.yappointment.com/api/v1/me

Sandbox Test Companies

Your sandbox environment includes pre-created test companies with sample data:

Use the Admin Portal (sandbox mode) to create additional test companies as needed.

Payment Testing

When testing payments, use these Stripe test card numbers:

| Scenario | Card Number | CVC | Expiry | |----------|-------------|-----|--------| | Success | 4242 4242 4242 4242 | Any 3 digits | Any future date | | Decline | 4000 0000 0000 0002 | Any 3 digits | Any future date | | Insufficient Funds | 4000 0000 0000 9995 | Any 3 digits | Any future date |

Email Testing

Emails sent in sandbox mode are not delivered to real addresses. Instead, they're logged in the Email Log under Admin Settings.

To view sent emails:

  1. Go to Admin Settings > Logs > Email Log
  2. See all emails sent from your test company
  3. View full body, headers, and recipient

Data Cleanup

Sandbox data persists between requests, allowing you to test multi-step workflows. If you need a fresh start:

  1. Go to Admin Settings > Advanced > Database Reset
  2. Click Wipe Test Data
  3. All sandbox test companies and data are deleted

Webhook Testing

Test webhooks locally using ngrok:

# Start your local webhook listener (e.g., on port 3000)
npm start

# Create an ngrok tunnel
ngrok http 3000

# Use the ngrok URL in Webhook Settings:
# https://abc123.ngrok.io/webhooks/yappointment

When you create bookings in sandbox mode, webhooks fire to your tunnel in real-time:

{
  "event": "booking.created",
  "timestamp": 1702650000000,
  "data": {
    "bookingId": "507f1f77bcf86cd799439011",
    "customerId": "507f1f77bcf86cd799439012",
    "startTime": "2024-02-15T14:00:00Z",
    "endTime": "2024-02-15T15:00:00Z",
    "status": "confirmed"
  }
}

Next Steps

Once you're confident in sandbox:

  1. Create a live API key in production Admin Settings
  2. Update your configuration to use the live key
  3. Run final integration tests with live data
  4. Go live — customers can now book appointments

Never share sandbox test keys in public repositories. Store them in .env.local or a secret manager.