POST
/
api
/
v0
/
payment-links
Create a new payment link
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"
}'

Authorizations

x-client-secret
string
header
required

Your secret API key. Keep this secure and never expose it in client-side code.

Body

application/json

Payment link creation data

title
string
required

Display title for the payment link. This appears on the checkout page and in customer communications.

Required string length: 3 - 100
Example:

"Premium Subscription"

url
string
required

Unique URL slug for the payment link. Can be a full URL or just the path segment. Must be unique within your account.

Example:

"premium-subscription"

Type of the payment link

Available options:
INVOICE,
PRODUCT,
COLLECTION,
DONATION
Example:

"PRODUCT"

allowQuantityAdjustment
boolean
default:true
required

Whether to allow quantity adjustment

Example:

true

collectTax
boolean
default:false
required

Whether to collect tax

Example:

true

collectAddress
boolean
default:false
required

Whether to collect address

Example:

true

allowMobilePayment
boolean
default:false
required

Whether to allow mobile payment

Example:

true

currency
enum<string>
default:usdc
required

Currency

Available options:
usdc,
eurc
Example:

"usdc"

description
string

Detailed description of what the customer is purchasing. Supports markdown formatting.

Maximum length: 500
Example:

"Get access to all premium features with our monthly subscription plan. Includes priority support and advanced analytics."

coverImage
string

Cover image URL

Example:

"https://example.com/images/premium-subscription.jpg"

amount
number

Amount for the payment link

Required range: x >= 0.01
Example:

29.99

paymentForId
string

Payment for ID

Example:

"sub_123456789"

customerId
string

Customer ID

Example:

"123e4567-e89b-12d3-a456-426614174002"

Array of products in the payment link

Example:
[
{
"productId": "123e4567-e89b-12d3-a456-426614174003",
"quantity": 1
},
{
"productId": "123e4567-e89b-12d3-a456-426614174004",
"quantity": 2
}
]
isForAllProduct
boolean
default:false

Whether the payment link is for all products

Example:

false

taxId
string

Tax ID

Example:

"123e4567-e89b-12d3-a456-426614174005"

limitPayments
boolean
default:false

Whether to limit payments

Example:

true

maxPayments
number

Maximum number of payments

Required range: x >= 1
Example:

100

customFields
object

Custom fields

Example:
{
"customField1": "value1",
"customField2": "value2"
}
expiration_date
string<date-time>

Expiration date

Example:

"2024-12-31T23:59:59Z"

Response

The payment link has been successfully created.