Web Integration
SkyPay makes it easy to accept payments on your website with minimal code and zero crying. Here's how it works:
How SkyPay Checkout Works
- User Adds to Cart: Your app generates a unique
code(like an order ID) for the payment. - Checkout: You redirect the user to SkyPay with the
code,amount, and redirect URLs. - Payment Page: SkyPay handles the transaction at
https://checkout.skypay.com. - Redirect Back: On success/failure, users are redirected back to your site with extra info.
- Verify: Use the Verify Payment API to confirm the payment.
- Deliver: Fulfill the order or unlock access once verified.
- Everyone Wins:
Generating a Checkout Link
Environment URLs
| Environment | Base URL |
|---|---|
| Live | https://checkout.skypay.dev |
| Param | Description |
|---|---|
api_key | Your merchant API key |
amount | Amount to be paid (in Rupees) |
code | Unique order ID (used later for verification) |
success_url | Redirect after successful payment (can be null — defaults to SkyPay page) |
failure_url | Redirect after failed payment (can be null — defaults to SkyPay page) |
debug | (Optional) Set to 1 to bypass redirects and stay on the success page. |
Method 1: Direct Checkout URL
html
<a href="https://checkout.skypay.dev?api_key=YOUR_API_KEY&amount=100&code=ORDER123&success_url=https://yourapp.com/success&failure_url=https://yourapp.com/failure" target="_blank">
Pay with SkyPay
</a>This is perfect for quick redirects, email/SMS links, or low-code flows.
Method 2: HTML Form (GET)
html
<form action="https://checkout.skypay.dev" method="GET">
<input type="hidden" name="api_key" value="YOUR_API_KEY">
<input type="hidden" name="amount" value="500">
<input type="hidden" name="code" value="ORDER123">
<input type="hidden" name="success_url" value="https://yourapp.com/success">
<input type="hidden" name="failure_url" value="https://yourapp.com/failure">
<input type="submit" value="Pay with SkyPay">
</form>Use this for a more integrated, styled experience.
Handling Redirects
On Success
Users are redirected to:
https://yourapp.com/success?data=<base64_encoded_transaction_data>datais a base64-encoded JSON string with transaction details.- Decode it server-side for security.
json
{
"code": "ORDER123",
"amount": 100,
"status": "complete"
}On Failure
Users are redirected to:
https://yourapp.com/failure?message=Something+went+wrongmessagehelps show friendly error messages.
Integration Modes Explained
SkyPay allows you to choose how much control you want over the integration:
1. API Mode (Most Popular)
- Flow: User clicks pay -> Redirect to SkyPay -> Choose Provider -> Automatic Redirect to Provider (eSewa/Khalti) -> Pay -> Return.
- Setup: Provide your own merchant credentials for eSewa/Khalti in the SkyPay dashboard.
- Best for: Businesses with existing merchant accounts who want a unified integration.
2. Manual Mode (QR/Bank)
- Flow: User clicks pay -> Redirect to SkyPay -> Choose "Manual Transfer" -> Scan QR or copy bank details -> Pay via banking app -> Upload screenshot.
- Setup: Simply add your bank account/QR in the SkyPay dashboard.
- Best for: Small businesses, P2P sellers, and social media commerce.
3. Assisted Mode (Managed)
- Flow: Similar to API mode but uses SkyPay's own merchant accounts.
- Setup: Zero. SkyPay manages the transaction and aggregates your balance.
- Best for: Startups and individuals who don't want to deal with bank paperwork.
Security Note
All checkout sessions expire after 15 minutes. Ensure your users are aware that they need to complete the payment within this window to avoid transaction failure.