PATCH
/
collect
/
payment_links
/
{id}
curl --request PATCH \
--url https://api.momentco.io/collect/payment_links/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{
"external_reference": "V-134",
"description": "Updated Payment Link"
}'
{
"id": "pl_6phg74i4jG9wbzZbFDUQB",
"status": "active",
"amount": 15000,
"currency": "ZAR",
"external_reference": "INV-2024-001",
"description": "Updated product purchase amount",
"link_url": "https://links.momentpay.io/G9wbzZbFDUQBFAE",
"expires_at": "2025-06-17T10:30:00Z",
"metadata": {
"customer_id": "cust_123456",
"order_id": "ord_789012"
},
"created_at": "2025-06-17T18:27:27.445Z",
"updated_at": "2025-06-17T19:15:30.123Z"
}

Authorizations

Authorization
string
header
required

Authentication using Bearer tokens. Include your API key in the Authorization header.

Key Types:

  • Test Keys: sk_test_* for development and testing
  • Live Keys: sk_* for production environments
  • Public Keys: pk_test_* or pk_* for client-side operations

📩 Need access? Contact Support to request your API keys.

Usage:

Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc

Headers

Idempotency-Key
string<uuid>
required

A unique key to prevent duplicate operations. Use the same key for retries to ensure idempotent behavior.

Best Practices:

  • Use UUIDs or other cryptographically unique identifiers
  • Maintain keys for at least 24 hours for retry scenarios
  • Use different keys for different operations
  • Monitor Idempotent-Replayed header for cache hits
Required string length: 1 - 255

Path Parameters

id
string
required

Unique identifier for the payment link. Must be a valid payment link ID.

Example:

"pl_6phg74i4jG9wbzZbFDUQB"

Body

application/json

Request payload for updating an existing payment link. Only payment links that haven't been paid can be updated.

Response

200
application/json

Payment link updated successfully

A payment link represents a request for payment that can be shared with customers. Payment links have a lifecycle that includes creation, potential updates, and eventual completion or expiration.