Skip to main content

Update Payment Link

Update an existing payment link. Only provided fields will be updated.

PUThttps://api.zenpayz.com/merchant/api/v1/payment-links/:linkId
Bearer · API key

Request

Headers

HeaderDescription
Authorization
REQUIRED
Bearer {api_key}
X-Signature
REQUIRED
HMAC-SHA256 signature
X-Timestamp
REQUIRED
ISO 8601 timestamp
X-Secret-Salt
REQUIRED
Secret salt for HMAC validation
Content-Type
REQUIRED
application/json

Path Parameters

ParameterTypeDescription
linkId
REQUIRED
stringThe payment link ID (e.g. pl_a1b2c3d4e5f6g7h8)

Body Parameters

ParameterTypeDescription
title
OPTIONAL
stringPayment link title (1-255 characters)
description
OPTIONAL
stringPayment link description
amount
OPTIONAL
numberPayment amount (minimum 0.01)
currency
OPTIONAL
stringCurrency code
usageType
OPTIONAL
stringUsage type. One of SINGLE, MULTI
status
OPTIONAL
stringLink status. One of ACTIVE, INACTIVE, EXPIRED
maxUses
OPTIONAL
numberMaximum number of uses (minimum 1)
expiresAt
OPTIONAL
stringExpiration date (ISO 8601)
invoiceIds
OPTIONAL
string[]Array of associated invoice IDs

Response

Success (200 OK)

{
"success": true,
"data": {
"linkId": "pl_a1b2c3d4e5f6g7h8",
"title": "Pro Plan Payment - Updated",
"description": "Payment for Pro Plan subscription (updated)",
"amount": 3999,
"currency": "INR",
"status": "ACTIVE",
"usageType": "MULTI",
"maxUses": 10,
"usageCount": 0,
"expiresAt": "2024-03-15T23:59:59.000Z",
"productId": "prod_a1b2c3d4e5f6g7h8",
"customerId": null,
"invoiceId": null,
"paymentUrl": "https://pay.zenpayz.com/pl_a1b2c3d4e5f6g7h8",
"shortCode": "ZP-XYZ789",
"shortUrl": "https://pay.zenpayz.com/s/ZP-XYZ789",
"metadata": {},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-16T14:20:00.000Z"
},
"message": "Payment link updated successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-01-16T14:20:00.000Z",
"processing_time_ms": 40,
"api_version": "v1",
"endpoint": "PUT /payment-links/:linkId",
"user_type": "merchant"
}
}

Error Responses

CodeHTTPMessage
VALIDATION_ERROR400Invalid request parameters
UNAUTHORIZED401Invalid API key
PAYMENT_LINK_NOT_FOUND404Payment link does not exist

Examples

curl -X PUT https://api.zenpayz.com/merchant/api/v1/payment-links/pl_a1b2c3d4e5f6g7h8 \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-16T14:20:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt" \
-H "Content-Type: application/json" \
-d '{
"title": "Pro Plan Payment - Updated",
"amount": 3999,
"usageType": "MULTI",
"maxUses": 10,
"expiresAt": "2024-03-15T23:59:59.000Z"
}'