Paylinks
Paylinks are shareable payment links that allow you to collect payments from customers without requiring a full integration. Create a paylink, share the URL, and customers can pay directly through a simple checkout page.
Overview
Paylinks are perfect for:
- One-time payments
- Donations
- Invoice payments
- Selling products or services
- Variable or fixed amount payments
Each paylink has a unique slug that creates a public URL: https://cari.finance/p/{slug}
The paylink model
- Name
id- Type
- string
- Description
Unique identifier for the paylink (e.g., "plink_abc123...")
- Name
title- Type
- string
- Description
Display title for the paylink
- Name
description- Type
- string
- Description
Optional description shown to customers
- Name
amount- Type
- integer
- Description
Fixed amount in cents (required for fixed amount type)
- Name
currency- Type
- string
- Description
Three-letter ISO currency code (e.g., "usd")
- Name
amount_type- Type
- string
- Description
Either "fixed" or "variable"
- Name
slug- Type
- string
- Description
Unique URL-friendly identifier
- Name
password- Type
- string
- Description
Optional password protection
- Name
expires_at- Type
- string
- Description
ISO 8601 timestamp when the paylink expires
- Name
max_uses- Type
- integer
- Description
Maximum number of times the paylink can be used
- Name
current_uses- Type
- integer
- Description
Number of times the paylink has been used
- Name
enabled_providers- Type
- array
- Description
Array of enabled payment methods (e.g., ["card", "mobile"])
- Name
active- Type
- boolean
- Description
Whether the paylink is currently active
- Name
metadata- Type
- object
- Description
Custom key-value pairs for storing additional information
Create a paylink
Create a new paylink. You can create fixed or variable amount paylinks, set expiration dates, limit usage, and add password protection.
Required Parameters
- Name
title- Type
- string
- Description
Display title for the paylink
- Name
amount_type- Type
- string
- Description
Either "fixed" or "variable"
- Name
currency- Type
- string
- Description
Three-letter ISO currency code
Optional Parameters
- Name
description- Type
- string
- Description
Description shown to customers
- Name
amount- Type
- integer
- Description
Fixed amount in cents (required if amount_type is "fixed")
- Name
slug- Type
- string
- Description
Custom URL slug (auto-generated if not provided)
- Name
password- Type
- string
- Description
Password to protect the paylink
- Name
expires_at- Type
- string
- Description
ISO 8601 expiration timestamp
- Name
max_uses- Type
- integer
- Description
Maximum number of uses
- Name
enabled_providers- Type
- array
- Description
Payment methods to enable (default: ["card"])
- Name
metadata- Type
- object
- Description
Custom metadata
Request
curl -X POST https://api.cari.finance/paylinks \
-H "Authorization: Bearer pk_test_27436257e3fe4b0fa266f4a6f59047a3" \
-H "Content-Type: application/json" \
-d '{
"title": "Premium Subscription",
"description": "Monthly premium subscription",
"amount": 2999,
"currency": "usd",
"amount_type": "fixed",
"max_uses": 1,
"enabled_providers": ["card"]
}'
Response
{
"id": "plink_abc123def456",
"title": "Premium Subscription",
"description": "Monthly premium subscription",
"amount": 2999,
"currency": "usd",
"amount_type": "fixed",
"slug": "premium-subscription",
"current_uses": 0,
"max_uses": 1,
"active": true,
"expires_at": null,
"enabled_providers": ["card"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
List all paylinks
Retrieve a paginated list of all your paylinks.
Query Parameters
- Name
page- Type
- integer
- Description
Page number (default: 1)
- Name
items_per_page- Type
- integer
- Description
Items per page (default: 20, max: 100)
Request
curl -G https://api.cari.finance/paylinks \
-H "Authorization: Bearer pk_test_27436257e3fe4b0fa266f4a6f59047a3" \
-d page=1 \
-d items_per_page=20
Response
{
"data": [
{
"id": "plink_abc123",
"title": "Premium Subscription",
"amount": 2999,
"currency": "usd",
"amount_type": "fixed",
"slug": "premium-subscription",
"current_uses": 0,
"active": true
}
],
"total_count": 1,
"has_more": false
}
Retrieve a paylink
Get details about a specific paylink by its ID.
Request
curl https://api.cari.finance/paylinks/plink_abc123def456 \
-H "Authorization: Bearer pk_test_27436257e3fe4b0fa266f4a6f59047a3"
Update a paylink
Update an existing paylink. You can update most fields except the slug and ID.
Updatable Fields
- Name
title- Type
- string
- Description
Display title
- Name
description- Type
- string
- Description
Description
- Name
amount- Type
- integer
- Description
Fixed amount (for fixed amount type)
- Name
active- Type
- boolean
- Description
Whether the paylink is active
- Name
expires_at- Type
- string
- Description
Expiration timestamp
- Name
max_uses- Type
- integer
- Description
Maximum uses
- Name
enabled_providers- Type
- array
- Description
Enabled payment methods
- Name
metadata- Type
- object
- Description
Custom metadata
Request
curl -X PUT https://api.cari.finance/paylinks/plink_abc123def456 \
-H "Authorization: Bearer pk_test_27436257e3fe4b0fa266f4a6f59047a3" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Title",
"active": false
}'
Delete a paylink
Permanently delete a paylink. This action cannot be undone.
Request
curl -X DELETE https://api.cari.finance/paylinks/plink_abc123def456 \
-H "Authorization: Bearer pk_test_27436257e3fe4b0fa266f4a6f59047a3"
Public endpoints
These endpoints don't require authentication and are used by the public checkout page.
Get public paylink
Retrieve public information about a paylink by its slug.
Request
curl https://api.cari.finance/p/premium-subscription
Validate paylink
Validate a paylink password (if password-protected).
Request
curl -X POST https://api.cari.finance/p/premium-subscription/validate \
-H "Content-Type: application/json" \
-d '{
"password": "secret123"
}'
Process paylink payment
Process a payment through a paylink. This endpoint handles the payment processing and links the charge to the paylink.
Request
curl -X POST https://api.cari.finance/p/premium-subscription/pay \
-H "Content-Type: application/json" \
-d '{
"amount": 2999,
"provider": "card",
"card": {
"token": "card_token_here"
},
"customer": {
"name": "John Doe",
"email": "john@example.com"
},
"password": "secret123"
}'
Variable amount paylinks
For variable amount paylinks, customers can specify their own payment amount. When processing the payment, include the amount parameter:
{
"amount": 5000,
"provider": "card",
"card": {
"token": "card_token_here"
},
"customer": {
"name": "John Doe",
"email": "john@example.com"
}
}
Best practices
- Use descriptive slugs: Create meaningful slugs that reflect the purpose of the paylink
- Set expiration dates: For time-sensitive offers, always set an expiration date
- Limit usage: Use
max_usesto prevent abuse of donation or one-time payment links - Password protection: Add password protection for sensitive or high-value paylinks
- Monitor usage: Track
current_usesto understand how your paylinks are being used