Developer Hub
Built for developers, by developers
Integrate Spacepay UPI Gateway into your application in minutes with our robust REST APIs and lightweight SDKs.
Simple Integration Flow
Our API is designed to be as simple as possible. Follow these steps to start accepting payments:
- 1Get your API credentials from the dashboard
- 2Initiate a payment request via POST
- 3Redirect user to the generated payment URL
- 4Handle real-time webhook callbacks for status updates
POST /v1/pay
// Create a payment request
const response = await fetch(
'https://api.spacepay.in/v1/pay',
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
public_key: 'pk_live_xxxx',
secret_key: 'sk_live_xxxx',
amount: '100.00',
order_id: 'ORD12345',
customer_mobile: '9999999999',
redirect_url: 'https://yoursite.com/success'
})
}
);
const data = await response.json();
window.location.href = data.result.payment_url;Core API Features
Secure Authentication
All requests are authenticated using industry-standard API Key and Secret Key pairs.
Real-time Webhooks
Get instant notifications on your server when a payment status changes.
Detailed Error Codes
Understand exactly what went wrong with descriptive error responses and codes.