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
- Go to Admin Settings > Integrations > API Keys
- Under Test Keys, click Create New Key
- Name it (e.g., "Local Development")
- 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/meSandbox Test Companies
Your sandbox environment includes pre-created test companies with sample data:
- Test Salon — Hair salon with 3 employees and services
- Test Clinic — Medical clinic with 5 employees
- Test Gym — Fitness center with classes
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:
- Go to Admin Settings > Logs > Email Log
- See all emails sent from your test company
- 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:
- Go to Admin Settings > Advanced > Database Reset
- Click Wipe Test Data
- 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:
- Create a live API key in production Admin Settings
- Update your configuration to use the live key
- Run final integration tests with live data
- Go live — customers can now book appointments
Never share sandbox test keys in public repositories. Store them in .env.local or a secret manager.