Quick Start
Start accepting payments with Mozart Pay in minutes.
Create an Account
Sign up at mozartpay.io to create your merchant account.
Create an App
From your dashboard, create an app. Apps let you separate different projects or environments. Each app has its own API keys, gateway credentials, and webhooks.
Add Gateway Credentials
Go to Gateway Credentials and add credentials for the payment gateway you want to use. Mozart Pay supports Stripe, TrueLayer, Pay360, Fena, and Trust Payments.
You can add multiple gateways and switch between them without changing your integration code.
Generate an API Key
Go to API Keys and generate a key. This key is shown only once, so copy it and store it securely.
Important: Keep your API key secret. Do not expose it in client-side code or commit it to version control.
Make Your First Payment
Use the API to create a payment. The response includes a redirect_url — redirect your customer there to complete the payment.
curl -X POST https://api.mozartpay.io/api/v1/payments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gateway": "stripe",
"amount_cents": 2500,
"currency": "GBP",
"success_url": "https://yoursite.com/success",
"failure_url": "https://yoursite.com/failure"
}'
require "net/http"
require "json"
uri = URI("https://api.mozartpay.io/api/v1/payments")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"
request["Content-Type"] = "application/json"
request.body = {
gateway: "stripe",
amount_cents: 2500,
currency: "GBP",
success_url: "https://yoursite.com/success",
failure_url: "https://yoursite.com/failure"
}.to_json
response = http.request(request)
data = JSON.parse(response.body)
redirect_url = data["redirect_url"]
const response = await fetch("https://api.mozartpay.io/api/v1/payments", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
gateway: "stripe",
amount_cents: 2500,
currency: "GBP",
success_url: "https://yoursite.com/success",
failure_url: "https://yoursite.com/failure",
}),
});
const { redirect_url } = await response.json();
import requests
response = requests.post(
"https://api.mozartpay.io/api/v1/payments",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"gateway": "stripe",
"amount_cents": 2500,
"currency": "GBP",
"success_url": "https://yoursite.com/success",
"failure_url": "https://yoursite.com/failure",
},
)
redirect_url = response.json()["redirect_url"]
Handle the Redirect
After the customer completes (or cancels) the payment on the gateway's page, they'll be redirected to your success_url or failure_url.
You can check the final payment status by calling the Get Payment endpoint.
Receive Webhooks
For the most reliable payment status updates, set up a webhook endpoint. Mozart Pay will send a POST request to your URL whenever a payment status changes.
Go to Webhooks in your dashboard to add an endpoint, then read the Webhooks documentation to learn about verifying signatures and handling events.
Next Steps
- Read the full API Reference for all available endpoints.
- Set up Webhooks for real-time payment notifications.
- Add multiple gateways for redundancy and better coverage.