POST
/
collect
/
payment_links
curl --request POST \
--url https://api.momentco.io/collect/payment_links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{
"amount": 10000,
"currency": "ZAR"
}'
{
"id": "pl_6phg74i4jG9wbzZbFDUQB",
"status": "active",
"amount": 10000,
"currency": "ZAR",
"external_reference": "INV-2024-001",
"description": "Product purchase",
"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-16T10:30:00Z",
"updated_at": "2025-06-16T10:30:00Z"
}

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

Body

application/json

Request payload for creating a new payment link

Response

201
application/json

Payment link created 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.