Skip to main content

Payment Links Integration

Generate shareable payment URLs for off-platform payments. Perfect for sending invoices via email, SMS payments, social media distribution, or manual billing scenarios.
Perfect for:
  • Sending invoices to customers via email or SMS
  • Sharing payment URLs through messaging apps
  • Social media bio links or posts
  • Manual billing and one-off purchases
  • Off-platform payment collection

How It Works

  1. Create payment link via dashboard or API
  2. Gale returns a payment URL
  3. Share the link with customer via email, SMS, or QR code
  4. Customer clicks link and completes checkout on Gale’s secure page
  5. Gale sends webhook notification to your system
  6. You fulfill the order

Setup Methods

You can create payment links in two ways:
  • Dashboard (No Code)
  • API (Programmatic)

Create via Dashboard

  1. Log in to your Gale Dashboard
  2. Navigate to ProductsAdd Product
  3. Enter product details (name, price, description)
  4. Click Generate Payment Link
  5. Copy the link and share it!
That’s it! Your payment link is ready to use.Via Email:
Subject: Complete Your Purchase

Click here to complete your purchase with your HSA/FSA card:
https://checkout.withgale.com/pay/pl_abc123xyz
Embed on Website:
<a href="https://checkout.withgale.com/pay/pl_abc123xyz"
   class="btn btn-primary">
  Pay with HSA/FSA
</a>
QR Code: Generate a QR code from your link using any QR code generator, then print or display it.

Subscription Support

Payment links support recurring payments automatically.
  • Dashboard
  • API
  1. Create a Subscription Product in your dashboard
  2. Set billing frequency (monthly, quarterly, annually)
  3. Generate payment link
  4. Customer agrees to recurring billing at checkout

Customization Options

Set when payment links expire:
{
  "expires_at": "2025-12-31T23:59:59Z"
}

Success/Failure URLs

Redirect customers after payment:
{
  "success_url": "https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}",
  "cancel_url": "https://yourdomain.com/cancel"
}

Metadata

Store custom data with the link:
{
  "metadata": {
    "customer_id": "cust_123",
    "campaign": "email_nov_2025",
    "referral_code": "FRIEND20"
  }
}

Handling Payment Confirmation

Receive real-time notifications when payment is completed:
// Webhook handler
app.post('/webhooks/gale', (req, res) => {
  const event = req.body;

  if (event.type === 'payment_link.paid') {
    const { payment_link_id, customer, amount_cents, metadata } = event.data;

    // Fulfill the order
    await fulfillOrder(metadata.order_id, customer.email);

    // Store subscription info if applicable
    if (event.data.subscription) {
      await createSubscription(customer.id, event.data.subscription);
    }
  }

  res.status(200).send('OK');
});
Learn more about Webhooks →

Polling (Alternative)

Check payment status via API:
GET /v2/payment-links/pl_abc123xyz
{
  "id": "pl_abc123xyz",
  "status": "paid",
  "paid_at": "2025-10-18T14:30:00Z",
  "customer": {
    "email": "customer@example.com",
    "name": "John Doe"
  },
  "amount_cents": 4999
}

Best Practices

Use Expiration Dates

Set reasonable expiration dates (7-30 days) to keep links fresh

Include Metadata

Store order IDs, customer info for easy reconciliation

Test Mode First

Use test API keys to verify flow before going live

Monitor Webhooks

Set up webhook endpoints for reliable order fulfillment

Common Use Cases

  • Membership Sign-Up: Generate link when user selects tier, email to customer
  • Email Campaigns: Include payment link in promotional emails
  • Social Media: Add to Instagram bio, Facebook posts, or Twitter links
  • Manual Billing: Send invoices to customers via email or SMS

Testing

Use test API keys to create test links:
curl -X POST https://api.withgale.com/v2/payment-links \
  -H "Authorization: Bearer glm_test_YOUR_TEST_KEY" \
  ...

Test Cards

Use these test HSA cards on checkout:
Card NumberScenario
4111111111111111Successful payment
4000000000000002Card declined
4000000000000069Expired card
See all test cards →

Going Live

1

Test Thoroughly

Create test payment links and complete test checkouts
2

Set Up Webhooks

Configure webhook endpoints for payment notifications
3

Switch to Live Keys

Replace test API keys with live keys
4

Monitor

Watch for successful payments in your dashboard

Troubleshooting

Possible causes:
  • Product not HSA/FSA eligible → Check eligibility in dashboard
  • Card declined → Customer should contact their HSA/FSA provider
  • Link expired → Generate new link
Solution:
  1. Verify webhook URL is publicly accessible
  2. Check webhook logs in dashboard
  3. Ensure HTTPS endpoint
  4. Validate webhook signature
Webhook setup guide →
Solution: Payment links are immutable once created. Generate a new link with updated price.

API Reference

For complete API documentation:

Next Steps

Support

Need help with payment links?