Payment Links
Create payment links that you can share anywhere - email, social media, messaging apps, or embed on your website. No coding required!
Quick Start
curl -X POST https://api.zendfi.tech/api/v1/payment-links \
-H "Authorization: Bearer zfi_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "Pro Plan Upgrade",
"amount": 99,
"currency": "USD"
}'
Response:
{
"id": "plink_abc123",
"url": "https://zendfi.tech/pay/plink_abc123",
"name": "Pro Plan Upgrade",
"amount": 99,
"currency": "USD"
}
Share https://zendfi.tech/pay/plink_abc123 and start collecting payments! 🎉
Features
- No-Code - Create links from dashboard or API
- Shareable - Works on any platform
- Customizable - Add metadata, limits, expiration
- Reusable - One link for multiple payments
- Analytics - Track views, conversions, revenue
Use Cases
| Use Case | Description |
|---|---|
| Donations | Accept tips, donations, or support payments |
| Quick Sales | Sell products without a full checkout |
| Event Tickets | Sell tickets via social media |
| Freelance Billing | Send payment links instead of invoices |
| Pre-Orders | Collect payments before launch |
Create Payment Link
Create a new shareable payment link.
Endpoint
POST /api/v1/payment-links
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Link name/description shown to payer |
amount | number | Conditional | Fixed amount (omit for PWYW) |
currency | string | Yes | Currency code ("USD" only) |
description | string | No | Longer description |
image_url | string | No | Product/service image URL |
allow_custom_amount | boolean | No | Allow payer to enter custom amount |
min_amount | number | No | Minimum amount (for PWYW) |
max_amount | number | No | Maximum amount |
suggested_amounts | array | No | Suggested amounts to display |
quantity_enabled | boolean | No | Allow quantity selection |
max_quantity | number | No | Maximum quantity per payment |
collect_email | boolean | No | Require email (default: false) |
collect_name | boolean | No | Require name (default: false) |
collect_phone | boolean | No | Require phone (default: false) |
collect_address | boolean | No | Require shipping address (default: false) |
success_url | string | No | Redirect URL after payment |
expires_at | string | No | Link expiration (ISO 8601) |
max_uses | number | No | Maximum times link can be used |
metadata | object | No | Custom key-value pairs |
Example: Fixed Amount Product
curl -X POST https://api.zendfi.tech/api/v1/payment-links \
-H "Authorization: Bearer zfi_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "ZendFi Pro License",
"description": "Lifetime access to ZendFi Pro features",
"amount": 299,
"currency": "USD",
"image_url": "https://zendfi.tech/images/pro-license.png",
"collect_email": true,
"success_url": "https://myapp.com/thank-you",
"metadata": {
"product_id": "pro_license",
"sku": "ZFPRO001"
}
}'
Example: Pay What You Want (Tips/Donations)
curl -X POST https://api.zendfi.tech/api/v1/payment-links \
-H "Authorization: Bearer zfi_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "Support My Work",
"description": "Buy me a coffee or support my open source work!",
"currency": "USD",
"allow_custom_amount": true,
"min_amount": 1,
"suggested_amounts": [5, 10, 25, 50],
"image_url": "https://example.com/coffee.png",
"collect_name": true,
"metadata": {
"type": "donation",
"campaign": "open_source_2025"
}
}'
Example: Event Tickets with Quantity
curl -X POST https://api.zendfi.tech/api/v1/payment-links \
-H "Authorization: Bearer zfi_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "Web3 Conference 2025 - General Admission",
"description": "Full day access to all sessions and networking",
"amount": 149,
"currency": "USD",
"image_url": "https://example.com/conference-banner.jpg",
"quantity_enabled": true,
"max_quantity": 10,
"collect_email": true,
"collect_name": true,
"expires_at": "2025-03-01T00:00:00Z",
"max_uses": 500,
"success_url": "https://myconference.com/tickets/confirmation",
"metadata": {
"event_id": "web3conf2025",
"ticket_type": "general"
}
}'
Example: Limited Time Offer
curl -X POST https://api.zendfi.tech/api/v1/payment-links \
-H "Authorization: Bearer zfi_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "Black Friday Deal - 50% Off!",
"description": "Limited time offer - ends Monday!",
"amount": 49.50,
"currency": "USD",
"expires_at": "2025-12-02T00:00:00Z",
"max_uses": 100,
"metadata": {
"campaign": "black_friday_2025",
"original_price": 99
}
}'
Get Payment Link
Retrieve payment link details.
Endpoint
GET /api/v1/payment-links/:id
Example
curl -X GET https://api.zendfi.tech/api/v1/payment-links/plink_abc123 \
-H "Authorization: Bearer zfi_live_abc123..."
Response:
{
"id": "plink_abc123",
"merchant_id": "merchant_xyz789",
"name": "ZendFi Pro License",
"description": "Lifetime access to ZendFi Pro features",
"amount": 299,
"currency": "USD",
"image_url": "https://zendfi.tech/images/pro-license.png",
"url": "https://zendfi.tech/pay/plink_abc123",
"active": true,
"collect_email": true,
"collect_name": false,
"success_url": "https://myapp.com/thank-you",
"expires_at": null,
"max_uses": null,
"times_used": 47,
"total_revenue": 14053,
"created_at": "2025-10-01T12:00:00Z",
"metadata": {
"product_id": "pro_license",
"sku": "ZFPRO001"
}
}
List Payment Links
Get all payment links for your merchant account.
Endpoint
GET /api/v1/payment-links
Query Parameters
| Parameter | Type | Description |
|---|---|---|
active | boolean | Filter by active status |
limit | number | Number of results (default: 20, max: 100) |
offset | number | Pagination offset |
Example
curl -X GET "https://api.zendfi.tech/api/v1/payment-links?active=true&limit=10" \
-H "Authorization: Bearer zfi_live_abc123..."
Update Payment Link
Update an existing payment link.
Endpoint
PATCH /api/v1/payment-links/:id
Example: Update Price
curl -X PATCH https://api.zendfi.tech/api/v1/payment-links/plink_abc123 \
-H "Authorization: Bearer zfi_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"amount": 249,
"description": "Holiday Sale - $50 off!"
}'
Deactivate Payment Link
Deactivate a payment link so it can no longer accept payments.
Endpoint
POST /api/v1/payment-links/:id/deactivate
Example
curl -X POST https://api.zendfi.tech/api/v1/payment-links/plink_abc123/deactivate \
-H "Authorization: Bearer zfi_live_abc123..."
Reactivate Payment Link
Reactivate a previously deactivated payment link.
Endpoint
POST /api/v1/payment-links/:id/activate
Example
curl -X POST https://api.zendfi.tech/api/v1/payment-links/plink_abc123/activate \
-H "Authorization: Bearer zfi_live_abc123..."
Payment Link Analytics
Get analytics for a specific payment link.
Endpoint
GET /api/v1/payment-links/:id/analytics
Example
curl -X GET https://api.zendfi.tech/api/v1/payment-links/plink_abc123/analytics \
-H "Authorization: Bearer zfi_live_abc123..."
Response:
{
"payment_link_id": "plink_abc123",
"views": 1250,
"unique_visitors": 980,
"payments_started": 120,
"payments_completed": 47,
"conversion_rate": 4.8,
"total_revenue": 14053,
"average_payment": 299,
"payments_by_day": [
{ "date": "2025-10-25", "count": 5, "revenue": 1495 },
{ "date": "2025-10-26", "count": 8, "revenue": 2392 }
]
}
Embedding Payment Links
Simple Link
<a href="https://zendfi.tech/pay/plink_abc123">Pay Now</a>
Button
<a href="https://zendfi.tech/pay/plink_abc123"
style="background: #6366f1; color: white; padding: 12px 24px;
border-radius: 8px; text-decoration: none; display: inline-block;">
Pay $299 with Crypto
</a>
QR Code
Generate a QR code for your payment link:
https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://zendfi.tech/pay/plink_abc123
Or use the built-in QR endpoint:
GET /api/v1/payment-links/:id/qr
Webhook Events
| Event | Description |
|---|---|
payment_link.created | Payment link created |
payment_link.payment_completed | Payment made via link |
payment_link.deactivated | Link deactivated |
payment_link.expired | Link reached expiration |
payment_link.limit_reached | Link reached max_uses |
Example Webhook Payload
{
"event": "payment_link.payment_completed",
"timestamp": "2025-10-26T15:30:00Z",
"data": {
"payment_link_id": "plink_abc123",
"payment_link_name": "ZendFi Pro License",
"payment_id": "pay_xyz789",
"amount": 299,
"currency": "USD",
"payer_wallet": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"payer_email": "customer@example.com",
"quantity": 1,
"transaction_signature": "5K2Nz...abc123",
"metadata": {
"product_id": "pro_license"
}
}
}
Best Practices
Creating Effective Payment Links
- Clear Names - Use descriptive names that explain what the payment is for
- Add Images - Visual products convert better
- Set Expectations - Include descriptions of what payer receives
- Success URLs - Redirect to a thank-you page with next steps
Managing Links
- Use Metadata - Track campaigns, products, and sources
- Set Limits - Use
max_usesfor limited offers - Expiration - Set
expires_atfor time-sensitive offers - Monitor Analytics - Track conversion rates and optimize
Next Steps
- Payments API - Full payment creation API
- Webhooks - Get notified of payment events