{
  "id": "pl_01HZXK8M9N2P3Q4R5S6T7U8V9W",
  "name": "Premium Service Package",
  "description": "Updated premium service package with enhanced features",
  "type": "PRODUCT",
  "status": "ACTIVE",
  "url": "https://checkout.devdraft.ai/pl_01HZXK8M9N2P3Q4R5S6T7U8V9W",
  "updatedAt": "2024-03-22T16:45:30Z"
}
The Update Payment Link API enables you to modify existing payment links while preserving their unique URLs and transaction history. This endpoint supports partial updates, allowing you to change specific fields without affecting the entire configuration.

Endpoint Details

method
string
PUT
url
string
/api/v0/payment-links/{id}
Authentication: Required (API Key & Secret)
Idempotency: Supported (recommended for all update operations)

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

Idempotency

The endpoint supports idempotency to prevent duplicate updates:
  • idempotency-key: Include a unique UUID v4 in the header
  • Subsequent requests with the same key return the original response
  • Keys expire after 24 hours

Path Parameters

id
string
required
Unique payment link identifier
Example: "pl_01HZXK8M9N2P3Q4R5S6T7U8V9W"

Request Parameters

All parameters are optional for updates. Only provided fields will be modified.

Basic Information

title
string
Display title for the payment link (3-100 characters)
Example: "Updated Premium Subscription"
description
string
Detailed description (max 500 chars, supports markdown)
Example: "Enhanced premium features with new benefits"
coverImage
string
Cover image URL for the payment link
Example: "https://example.com/images/new-cover.jpg"

Pricing and Configuration

amount
number
Fixed amount for the payment link (minimum 0.01)
Example: 39.99
currency
enum
Payment currency
Values: "usdc", "eurc"
Example: "eurc"
allowQuantityAdjustment
boolean
Whether to allow quantity adjustment
Example: false
allowMobilePayment
boolean
Whether to allow mobile payment methods
Example: true

Product Configuration

Array of products to include in the payment link
Type: Array of PaymentLinkProduct objects
Note: This replaces the entire product list
isForAllProduct
boolean
Whether the payment link is for all products
Example: true

Tax and Collection Settings

collectTax
boolean
Whether to collect tax on the payment
Example: true
taxId
string
UUID of the tax configuration to apply
Example: "123e4567-e89b-12d3-a456-426614174005"
collectAddress
boolean
Whether to collect customer address
Example: true

Payment Limits

limitPayments
boolean
Whether to limit the number of payments
Example: true
maxPayments
number
Maximum number of payments allowed (minimum 1)
Example: 500

Advanced Settings

customFields
object
Custom fields for additional data collection
Example: {"updated_field": "new_value"}
expiration_date
string
Expiration date for the payment link (ISO 8601 format)
Example: "2025-12-31T23:59:59Z"

Request Examples

curl -X PUT "https://api.devdraft.ai/api/v0/payment-links/pl_01HZXK8M9N2P3Q4R5S6T7U8V9W" \
  -H "Content-Type: application/json" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "idempotency-key: $(uuidgen)" \
  -d '{
    "amount": 39.99,
    "description": "Enhanced premium features with new benefits and tools"
  }'

Response Format

Success Response (200 OK)

{
  "id": "pl_01HZXK8M9N2P3Q4R5S6T7U8V9W",
  "name": "Premium Service Package",
  "description": "Updated premium service package with enhanced features",
  "type": "PRODUCT",
  "status": "ACTIVE",
  "url": "https://checkout.devdraft.ai/pl_01HZXK8M9N2P3Q4R5S6T7U8V9W",
  "updatedAt": "2024-03-22T16:45:30Z"
}

Use Cases

1. Price Updates

Update payment link pricing based on market conditions or promotions.

2. Content Management

Keep payment link descriptions and branding current.

3. Configuration Changes

Modify payment settings and collection requirements.

Best Practices

  • Use idempotency keys for all update operations
  • Validate data before making API calls
  • Handle partial updates gracefully
  • Monitor payment link performance after changes