[
  {
    "id": "pl_01HZXK8M9N2P3Q4R5S6T7U8V9W",
    "title": "Premium Subscription",
    "url": "https://checkout.devdraft.ai/premium-subscription",
    "description": "Monthly access to all premium features",
    "coverImage": null,
    "linkType": "PRODUCT",
    "status": "ACTIVE",
    "amount": 29.99,
    "paymentForId": null,
    "currency": "usdc",
    "allowQuantityAdjustment": true,
    "allowMobilePayment": true,
    "collectTax": false,
    "collectAddress": false,
    "limitPayments": false,
    "maxPayments": null,
    "customFields": null,
    "paymentLinkProducts": [],
    "isForAllProduct": false,
    "appId": "app_123456789",
    "customerId": null,
    "taxId": null,
    "expiration_date": null,
    "createdAt": "2023-07-01T12:00:00.000Z",
    "updatedAt": "2023-07-01T12:00:00.000Z"
  },
  {
    "id": "pl_02HZXK8M9N2P3Q4R5S6T7U8V9X",
    "title": "Support Our Mission",
    "url": "https://checkout.devdraft.ai/donate",
    "description": "Help us continue our important work",
    "coverImage": "https://example.com/images/donation.jpg",
    "linkType": "DONATION",
    "status": "ACTIVE",
    "amount": null,
    "paymentForId": null,
    "currency": "usdc",
    "allowQuantityAdjustment": false,
    "allowMobilePayment": true,
    "collectTax": false,
    "collectAddress": true,
    "limitPayments": false,
    "maxPayments": null,
    "customFields": {
      "donor_message": "Optional message from donor",
      "anonymous": "Allow anonymous donations"
    },
    "paymentLinkProducts": [],
    "isForAllProduct": false,
    "appId": "app_123456789",
    "customerId": null,
    "taxId": null,
    "expiration_date": null,
    "createdAt": "2023-06-30T15:30:00.000Z",
    "updatedAt": "2023-06-30T15:30:00.000Z"
  }
]
The List Payment Links API enables you to retrieve all payment links created for your application with built-in pagination support. This endpoint is essential for managing payment link portfolios, tracking performance, and building administrative interfaces.

Endpoint Details

method
string
GET
url
string
/api/v0/payment-links
Authentication: Required (API Key & Secret)

Authentication

All requests require API key authentication using the following headers:
  • x-client-key: Your application’s client key
  • x-client-secret: Your application’s client secret

Query Parameters

skip
number
Number of records to skip (must be non-negative)
Default: 0
Example: 10
take
number
Number of records to take (must be positive)
Default: 10
Maximum: 100
Example: 20

Pagination

The API uses offset-based pagination:
  • skip: Number of records to skip from the beginning
  • take: Maximum number of records to return
  • Results are returned in reverse chronological order (newest first)
  • For page-based navigation: skip = (page - 1) * take

Request Examples

curl -X GET "https://api.devdraft.ai/api/v0/payment-links" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET"

Response Format

Success Response (200 OK)

[
  {
    "id": "pl_01HZXK8M9N2P3Q4R5S6T7U8V9W",
    "title": "Premium Subscription",
    "url": "https://checkout.devdraft.ai/premium-subscription",
    "description": "Monthly access to all premium features",
    "coverImage": null,
    "linkType": "PRODUCT",
    "status": "ACTIVE",
    "amount": 29.99,
    "paymentForId": null,
    "currency": "usdc",
    "allowQuantityAdjustment": true,
    "allowMobilePayment": true,
    "collectTax": false,
    "collectAddress": false,
    "limitPayments": false,
    "maxPayments": null,
    "customFields": null,
    "paymentLinkProducts": [],
    "isForAllProduct": false,
    "appId": "app_123456789",
    "customerId": null,
    "taxId": null,
    "expiration_date": null,
    "createdAt": "2023-07-01T12:00:00.000Z",
    "updatedAt": "2023-07-01T12:00:00.000Z"
  },
  {
    "id": "pl_02HZXK8M9N2P3Q4R5S6T7U8V9X",
    "title": "Support Our Mission",
    "url": "https://checkout.devdraft.ai/donate",
    "description": "Help us continue our important work",
    "coverImage": "https://example.com/images/donation.jpg",
    "linkType": "DONATION",
    "status": "ACTIVE",
    "amount": null,
    "paymentForId": null,
    "currency": "usdc",
    "allowQuantityAdjustment": false,
    "allowMobilePayment": true,
    "collectTax": false,
    "collectAddress": true,
    "limitPayments": false,
    "maxPayments": null,
    "customFields": {
      "donor_message": "Optional message from donor",
      "anonymous": "Allow anonymous donations"
    },
    "paymentLinkProducts": [],
    "isForAllProduct": false,
    "appId": "app_123456789",
    "customerId": null,
    "taxId": null,
    "expiration_date": null,
    "createdAt": "2023-06-30T15:30:00.000Z",
    "updatedAt": "2023-06-30T15:30:00.000Z"
  }
]

Response Fields

Each payment link in the array contains:
id
string
Unique payment link identifier
title
string
Display title of the payment link
url
string
Full checkout URL for the payment link
description
string | null
Description of the payment link
coverImage
string | null
Cover image URL
Type of payment link (PRODUCT, DONATION, SUBSCRIPTION)
status
string
Current status (ACTIVE, INACTIVE, EXPIRED)
amount
number | null
Fixed amount (null for flexible amounts)
currency
string
Payment currency (usdc, eurc)
allowQuantityAdjustment
boolean
Whether quantity adjustment is allowed
allowMobilePayment
boolean
Whether mobile payments are allowed
collectTax
boolean
Whether tax collection is enabled
collectAddress
boolean
Whether address collection is enabled
limitPayments
boolean
Whether payment count is limited
maxPayments
number | null
Maximum number of payments allowed
customFields
object | null
Custom fields for data collection
Array of associated products
appId
string
Application identifier
expiration_date
string | null
Expiration date (ISO 8601)
createdAt
string
Creation timestamp (ISO 8601)
updatedAt
string
Last update timestamp (ISO 8601)

Error Responses

{
  "statusCode": 400,
  "message": "Skip parameter must be a non-negative number",
  "error": "Bad Request"
}

Use Cases

1. Dashboard Management

Display all payment links in administrative interfaces with pagination and filtering capabilities.

2. Performance Analytics

Retrieve payment links to analyze conversion rates, revenue patterns, and usage statistics.

3. Bulk Operations

Get all payment links for bulk updates, archival, or migration operations.

4. Status Monitoring

Monitor payment link health by checking statuses and expiration dates.

5. Customer Support

Quickly find and troubleshoot specific payment links for customer inquiries.

Best Practices

Pagination Strategy

  • Use reasonable page sizes (10-50 items) to balance performance and usability
  • Implement cursor-based pagination for real-time applications
  • Cache results when appropriate to reduce API calls

Performance Optimization

  • Request only the page size you need
  • Use filtering on the client side for simple operations
  • Implement proper error handling for network issues

Data Management

  • Sort results by creation date (newest first) for better user experience
  • Track pagination state in your application
  • Handle empty result sets gracefully

Security Considerations

  • Never expose API credentials in client-side code
  • Implement proper access controls for payment link data
  • Use HTTPS for all API requests

Filtering Examples

class PaymentLinkManager {
  constructor(api) {
    this.api = api;
    this.cache = new Map();
  }

  async getFilteredLinks(filters) {
    const cacheKey = JSON.stringify(filters);
    
    if (this.cache.has(cacheKey)) {
      return this.cache.get(cacheKey);
    }

    const allLinks = await this.api.getAllPaymentLinks();
    let filtered = allLinks;

    if (filters.status) {
      filtered = filtered.filter(link => link.status === filters.status);
    }

    if (filters.linkType) {
      filtered = filtered.filter(link => link.linkType === filters.linkType);
    }

    if (filters.hasExpiration) {
      filtered = filtered.filter(link => 
        filters.hasExpiration ? link.expiration_date : !link.expiration_date
      );
    }

    if (filters.minAmount || filters.maxAmount) {
      filtered = filtered.filter(link => {
        if (!link.amount) return !filters.minAmount && !filters.maxAmount;
        if (filters.minAmount && link.amount < filters.minAmount) return false;
        if (filters.maxAmount && link.amount > filters.maxAmount) return false;
        return true;
      });
    }

    if (filters.createdAfter) {
      filtered = filtered.filter(link => 
        new Date(link.createdAt) > new Date(filters.createdAfter)
      );
    }

    if (filters.createdBefore) {
      filtered = filtered.filter(link => 
        new Date(link.createdAt) < new Date(filters.createdBefore)
      );
    }

    // Cache results for 5 minutes
    this.cache.set(cacheKey, filtered);
    setTimeout(() => this.cache.delete(cacheKey), 5 * 60 * 1000);

    return filtered;
  }

  async getActiveProductLinks() {
    return this.getFilteredLinks({
      status: 'ACTIVE',
      linkType: 'PRODUCT'
    });
  }

  async getRecentLinks(days = 7) {
    const since = new Date();
    since.setDate(since.getDate() - days);
    
    return this.getFilteredLinks({
      createdAfter: since.toISOString()
    });
  }

  async getHighValueLinks(minAmount = 100) {
    return this.getFilteredLinks({
      minAmount: minAmount
    });
  }
}

Support

For additional support with the List Payment Links API:
  1. Ensure proper pagination parameters (skip ≥ 0, take > 0)
  2. Check API key permissions for payment link access
  3. Monitor response times for large datasets
  4. Implement proper error handling for network issues