Create a payment link
A link generates a dedicated deposit address (or Lightning invoice) and a hosted checkout page.
POST /payment-links
bash
curl -X POST https://coinnectivepay-api-g34q.onrender.com/api/v1/payment-links \
-H "Authorization: Bearer $CPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: cmd-2026-0001" \
-d '{
"reference": "CMD-0001",
"amountUsdt": "25.500000",
"network": "TRC20",
"expiresInMinutes": 60
}'js
const res = await fetch("https://coinnectivepay-api-g34q.onrender.com/api/v1/payment-links", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.CPAY_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "cmd-2026-0001",
},
body: JSON.stringify({
reference: "CMD-0001",
amountUsdt: "25.500000",
network: "TRC20",
expiresInMinutes: 60,
}),
});
const { link, payment } = await res.json();Response
json
{
"link": { "id": "9bf...", "reference": "CMD-0001", "status": "ACTIVE" },
"payment": {
"id": "59c...",
"status": "PENDING",
"network": "TRC20",
"depositAddress": "TJ8...9f2c",
"expectedAmount": "25.500000"
}
}Fields
| Field | Description |
|---|---|
reference | Your reference (order, invoice). Echoed in webhooks. |
amountUsdt | Expected amount in USDT, decimal string (max 6 decimals). |
expiresInMinutes | Link validity in minutes (optional). |
Idempotency-Key
Send an Idempotency-Key header so a retry (network timeout) does not create a duplicate.
