curl --location --request POST 'https://api.sxdigitalpay.com/api/external/payment-links' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Premium subscription",
"description": "Annual plan invoice",
"amount": 129.9,
"expiresAt": "2026-01-31T23:59:59.000Z",
"externalReference": "annual-plan-2025",
"metadata": {
"plan": "premium",
"period": "annual"
},
"webhookUrl": "https://merchant.com/webhooks/sxpay"
}'{
"success": true,
"paymentLink": {
"id": "pl_123",
"externalReference": "annual-plan-2025",
"title": "Premium subscription",
"description": "Annual plan invoice",
"amount": 129.9,
"currency": "USD",
"status": "ACTIVE",
"isMultiUse": false,
"isActive": true,
"isExpired": false,
"expiresAt": "2025-01-31T23:59:59.000Z",
"url": "https://app.sxdigitalpay.com/quote/[merchantShortName]/[paymentLinkId]",
"shortUrl": "https://sxpay.me/[paymentLinkShortId]",
"metadata": {
"plan": "premium",
"period": "annual"
},
"paymentStatus": "NOT_STARTED",
"paymentsSummary": {
"total": 0,
"byStatus": {}
},
"payments": [],
"webhookUrl": "https://merchant.com/webhooks/sxpay",
"webhookSecret": "8f2c58c1c9a34f7e8b1a2c3d4e5f6789"
}
}