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}

  • 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


POST/paylinks

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

POST
/paylinks
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"
}

GET/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

GET
/paylinks
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
}

GET/paylinks/:id

Get details about a specific paylink by its ID.

Request

GET
/paylinks/{id}
curl https://api.cari.finance/paylinks/plink_abc123def456 \
  -H "Authorization: Bearer pk_test_27436257e3fe4b0fa266f4a6f59047a3"

PUT/paylinks/:id

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

PUT
/paylinks/{id}
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/paylinks/:id

Permanently delete a paylink. This action cannot be undone.

Request

DELETE
/paylinks/{id}
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

GET
/p/{slug}
curl https://api.cari.finance/p/premium-subscription

Validate paylink

Validate a paylink password (if password-protected).

Request

POST
/p/{slug}/validate
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

POST
/p/{slug}/pay
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"
  }'

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

  1. Use descriptive slugs: Create meaningful slugs that reflect the purpose of the paylink
  2. Set expiration dates: For time-sensitive offers, always set an expiration date
  3. Limit usage: Use max_uses to prevent abuse of donation or one-time payment links
  4. Password protection: Add password protection for sensitive or high-value paylinks
  5. Monitor usage: Track current_uses to understand how your paylinks are being used

Was this page helpful?