10 Minute Guide

Payment Links Integration

Complete guide to implementing hosted payment links with custom branding and advanced features.

1

Basic Payment Link

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'
  })
});
2

Custom Branding

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'
  }
})
3

Success & Cancel URLs

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
})
4

Handle Response

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);
}

Advanced Features

🔄 Recurring Payments

Set up subscription billing with automatic renewals

📊 Analytics

Track conversion rates and payment analytics

🌍 Multi-Currency

Accept payments in 135+ currencies

📱 Mobile Optimized

Responsive design for all devices