🚀 Devdraft Launch Week I is live! Sign up for exclusive access and early features. Learn more →
curl --request POST \
--url https://api.devdraft.ai/api/v0/payment-links \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <api-key>' \
--data '{
"title": "Premium Subscription",
"url": "premium-subscription",
"description": "Get access to all premium features with our monthly subscription plan. Includes priority support and advanced analytics.",
"coverImage": "https://example.com/images/premium-subscription.jpg",
"linkType": "PRODUCT",
"amount": 29.99,
"paymentForId": "sub_123456789",
"customerId": "123e4567-e89b-12d3-a456-426614174002",
"paymentLinkProducts": [
{
"productId": "123e4567-e89b-12d3-a456-426614174003",
"quantity": 1
},
{
"productId": "123e4567-e89b-12d3-a456-426614174004",
"quantity": 2
}
],
"isForAllProduct": false,
"allowQuantityAdjustment": true,
"collectTax": true,
"taxId": "123e4567-e89b-12d3-a456-426614174005",
"collectAddress": true,
"limitPayments": true,
"maxPayments": 100,
"customFields": {
"customField1": "value1",
"customField2": "value2"
},
"allowMobilePayment": true,
"currency": "usdc",
"expiration_date": "2024-12-31T23:59:59Z"
}'
Creates a new payment link with the provided details. Supports both simple one-time payments and complex product bundles.
curl --request POST \
--url https://api.devdraft.ai/api/v0/payment-links \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <api-key>' \
--data '{
"title": "Premium Subscription",
"url": "premium-subscription",
"description": "Get access to all premium features with our monthly subscription plan. Includes priority support and advanced analytics.",
"coverImage": "https://example.com/images/premium-subscription.jpg",
"linkType": "PRODUCT",
"amount": 29.99,
"paymentForId": "sub_123456789",
"customerId": "123e4567-e89b-12d3-a456-426614174002",
"paymentLinkProducts": [
{
"productId": "123e4567-e89b-12d3-a456-426614174003",
"quantity": 1
},
{
"productId": "123e4567-e89b-12d3-a456-426614174004",
"quantity": 2
}
],
"isForAllProduct": false,
"allowQuantityAdjustment": true,
"collectTax": true,
"taxId": "123e4567-e89b-12d3-a456-426614174005",
"collectAddress": true,
"limitPayments": true,
"maxPayments": 100,
"customFields": {
"customField1": "value1",
"customField2": "value2"
},
"allowMobilePayment": true,
"currency": "usdc",
"expiration_date": "2024-12-31T23:59:59Z"
}'
Your secret API key. Keep this secure and never expose it in client-side code.
Payment link creation data
The body is of type object
.
The payment link has been successfully created.