Complete guide to implementing hosted payment links with custom branding and advanced features.
Create a simple payment link with minimal configuration.
const paymentLink = await fetch('https://api.gopay.now/v1/payment-links', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_your_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 5000, // ₺ 50.00
currency: 'USD',
description: 'Premium Subscription'
})
});
Add your brand colors, logo, and custom styling.
body: JSON.stringify({
amount: 5000,
currency: 'USD',
description: 'Premium Subscription',
branding: {
logo_url: 'https://yoursite.com/logo.png',
primary_color: '#3B82F6',
company_name: 'Your Company'
}
})
Handle payment completion and cancellation flows.
body: JSON.stringify({
amount: 5000,
currency: 'USD',
success_url: 'https://yoursite.com/success?session_id={CHECKOUT_SESSION_ID}',
cancel_url: 'https://yoursite.com/cancel',
expires_at: Math.floor(Date.now() / 1000) + 3600 // 1 hour
})
Process the payment link response and redirect users.
const result = await response.json();
if (response.ok) {
// Redirect user to payment page
window.location.href = result.url;
} else {
console.error('Error creating payment link:', result.error);
}
Set up subscription billing with automatic renewals
Track conversion rates and payment analytics
Accept payments in 135+ currencies
Responsive design for all devices