Checkout Link
Generate hosted payment URLs with no frontend development required
Easiest Integration
Checkout Links are the simplest way to accept payments. Generate a URL, redirect your customer, and we handle everything else - payment collection, security, and confirmations.
When to Use Checkout Links
- ✓ Invoices & payment requests: Email or text customers a link to pay
- ✓ Simple e-commerce: Quick checkout without complex integration
- ✓ Donations: One-click payment pages for nonprofits
- ✓ Event tickets: Sell access with pre-set amounts
- ✓ Service deposits: Collect payments before appointments
Create via Dashboard
The easiest way - no code required:
- 1. Go to your Hedge Payments Dashboard
- 2. Click "Payments" → "Create Checkout Link"
- 3. Enter amount, description, and optional settings
- 4. Copy the generated URL and share with your customer
💡 Tip: You can also create checkout links directly from invoices in the dashboard.
Create via API
Programmatically generate checkout links:
Node.js
import { HedgePayments } from '@hedgepayments/node'
const hedge = new HedgePayments({
apiKey: process.env.HEDGE_API_KEY,
apiSecret: process.env.HEDGE_API_SECRET
})
const checkoutLink = await hedge.checkoutLinks.create({
// Required
amount: 9999, // Amount in cents ($99.99)
// Optional - Basic info
currency: 'USD',
description: 'Premium Plan - Annual',
customerEmail: 'customer@example.com',
// Optional - Redirect URLs
successUrl: 'https://yoursite.com/success',
cancelUrl: 'https://yoursite.com/cancel',
// Optional - Payment settings
paymentMethods: ['card', 'ach'], // Allowed methods
expiresAt: '2024-12-31T23:59:59Z', // Link expiration
// Optional - Metadata
metadata: {
orderId: 'order_123',
customerId: 'cust_456'
}
})
console.log('Checkout URL:', checkoutLink.url)
// https://checkout.hedgepayments.com/pay/cs_abc123...cURL
curl -X POST https://api.hedgepayments.com/v1/checkout-links \
-H "Authorization: Bearer YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"amount": 9999,
"currency": "USD",
"description": "Premium Plan - Annual",
"success_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel"
}'Response Object
{
"id": "cs_abc123xyz",
"url": "https://checkout.hedgepayments.com/pay/cs_abc123xyz",
"amount": 9999,
"currency": "USD",
"description": "Premium Plan - Annual",
"status": "open", // open, complete, expired
"customer_email": "customer@example.com",
"success_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel",
"expires_at": "2024-12-31T23:59:59Z",
"metadata": {
"orderId": "order_123"
},
"created_at": "2024-01-15T10:30:00Z"
}Customization Options
| Parameter | Type | Description |
|---|---|---|
| amount | integer | Amount in cents (required) |
| currency | string | USD, EUR, GBP, BRL (default: USD) |
| description | string | Shown on checkout page |
| customer_email | string | Pre-fill customer email |
| success_url | string | Redirect after payment |
| cancel_url | string | Redirect on cancel |
| payment_methods | string[] | ['card', 'ach', 'crypto', 'apple_pay'] |
| expires_at | string | ISO 8601 expiration date |
| allow_promotion_codes | boolean | Enable discount codes |
| metadata | object | Custom key-value pairs |
Custom Branding
Customize the checkout page appearance in your dashboard settings:
- • Upload your company logo
- • Set primary and secondary brand colors
- • Custom success/thank you message
- • Custom terms and conditions link
Configure branding at Dashboard → Settings → Branding
Payment Notifications
Set up webhooks to receive payment confirmations:
app.post('/webhooks/hedge', async (req, res) => {
const event = hedge.webhooks.verify(req.body, req.headers['x-hedge-signature'])
if (event.type === 'checkout.completed') {
const session = event.data
// Fulfill the order
await fulfillOrder({
orderId: session.metadata.orderId,
customerEmail: session.customer_email,
amount: session.amount
})
}
res.status(200).send('OK')
})