Sandbox
The Mozart Pay sandbox lets you test your integration without processing real payments. Use test card numbers and sort codes to simulate success and failure scenarios.
Getting Started
The sandbox gateway is available to all merchants. Add it from your Gateways page in the dashboard — no credentials are required.
Create a payment using the sandbox gateway:
curl -X POST https://mozartpay.io/api/v1/payments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gateway": "sandbox",
"amount_cents": 1000,
"currency": "GBP",
"success_url": "https://yoursite.com/success",
"failure_url": "https://yoursite.com/failure"
}'
The response includes a redirect_url pointing to the sandbox checkout page.
Redirect your customer there to complete the payment.
Test Card Numbers
| Card Number | Result |
|---|---|
4242 4242 4242 4242 |
Payment succeeds |
4000 0000 0000 0002 |
Payment is declined |
| Any other valid number | Payment succeeds |
Use any future expiry date and any 3-digit CVC.
Test Bank Accounts (Open Banking)
| Sort Code | Result |
|---|---|
00-00-00 |
Payment succeeds |
00-00-01 |
Payment is declined |
Switching from Sandbox to Live
- Add real gateway credentials (Stripe, TrueLayer, etc.) from your Gateways page.
- Change the
gatewayparameter in your API calls from"sandbox"to your chosen provider (e.g."stripe"). - That's it. The rest of the API is identical.
Embedded Form
You can embed the Mozart Pay payment form directly in your page:
<div id="mozart-payment"></div>
<script src="https://mozartpay.io/sandbox/embed.js"></script>
<script>
MozartPay.mount('#mozart-payment', {
paymentId: 'pay_xxx',
onSuccess: (result) => {
console.log('Payment succeeded:', result);
},
onError: (error) => {
console.error('Payment failed:', error);
}
});
</script>
Try It Now
The live demo is not currently available.