> ## Documentation Index
> Fetch the complete documentation index at: https://devdraft.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new payment link

> Creates a new payment link with the provided details. Supports both simple one-time payments and complex product bundles.



## OpenAPI

````yaml /swagger.yml post /api/v0/payment-links
openapi: 3.0.0
info:
  title: Devdraft AI Payment & Business Management API
  description: >-

    A comprehensive payment processing and business management API that enables
    seamless integration of cryptocurrency and traditional payment methods.
        
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.devdraft.ai
    description: Production Server
security: []
tags: []
paths:
  /api/v0/payment-links:
    post:
      tags:
        - Payment Links
      summary: Create a new payment link
      description: >-
        Creates a new payment link with the provided details. Supports both
        simple one-time payments and complex product bundles.
      operationId: PaymentLinksController_create
      parameters: []
      requestBody:
        required: true
        description: Payment link creation data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentLinkDto'
      responses:
        '201':
          description: The payment link has been successfully created.
        '400':
          description: Bad Request.
      security:
        - x-client-secret: []
        - x-client-key: []
components:
  schemas:
    CreatePaymentLinkDto:
      type: object
      properties:
        title:
          type: string
          description: >-
            Display title for the payment link. This appears on the checkout
            page and in customer communications.
          minLength: 3
          maxLength: 100
          example: Premium Subscription
        url:
          type: string
          description: >-
            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
        description:
          type: string
          description: >-
            Detailed description of what the customer is purchasing. Supports
            markdown formatting.
          maxLength: 500
          example: >-
            Get access to all premium features with our monthly subscription
            plan. Includes priority support and advanced analytics.
        coverImage:
          type: string
          description: Cover image URL
          example: https://example.com/images/premium-subscription.jpg
        linkType:
          type: string
          description: Type of the payment link
          enum:
            - INVOICE
            - PRODUCT
            - COLLECTION
            - DONATION
          example: PRODUCT
        amount:
          type: number
          description: Amount for the payment link
          minimum: 0.01
          example: 29.99
        paymentForId:
          type: string
          description: Payment for ID
          example: sub_123456789
        customerId:
          type: string
          description: Customer ID
          example: 123e4567-e89b-12d3-a456-426614174002
        paymentLinkProducts:
          description: Array of products in the payment link
          example:
            - productId: 123e4567-e89b-12d3-a456-426614174003
              quantity: 1
            - productId: 123e4567-e89b-12d3-a456-426614174004
              quantity: 2
          type: array
          items:
            $ref: '#/components/schemas/PaymentLinkProductDto'
        isForAllProduct:
          type: boolean
          description: Whether the payment link is for all products
          default: false
          example: false
        allowQuantityAdjustment:
          type: boolean
          description: Whether to allow quantity adjustment
          default: true
          example: true
        collectTax:
          type: boolean
          description: Whether to collect tax
          default: false
          example: true
        taxId:
          type: string
          description: Tax ID
          example: 123e4567-e89b-12d3-a456-426614174005
        collectAddress:
          type: boolean
          description: Whether to collect address
          default: false
          example: true
        limitPayments:
          type: boolean
          description: Whether to limit payments
          default: false
          example: true
        maxPayments:
          type: number
          description: Maximum number of payments
          minimum: 1
          example: 100
        customFields:
          type: object
          description: Custom fields
          example:
            customField1: value1
            customField2: value2
        allowMobilePayment:
          type: boolean
          description: Whether to allow mobile payment
          default: false
          example: true
        currency:
          type: string
          description: Currency
          enum:
            - usdc
            - eurc
          default: usdc
          example: usdc
        expiration_date:
          format: date-time
          type: string
          description: Expiration date
          example: '2024-12-31T23:59:59Z'
      required:
        - title
        - url
        - linkType
        - allowQuantityAdjustment
        - collectTax
        - collectAddress
        - allowMobilePayment
        - currency
    PaymentLinkProductDto:
      type: object
      properties:
        productId:
          type: string
          description: >-
            UUID of the product to include in this payment link. Must be a valid
            product from your catalog.
          example: 123e4567-e89b-12d3-a456-426614174000
          format: uuid
        quantity:
          type: integer
          description: Quantity of this product to include. Must be at least 1.
          default: 1
          example: 2
          minimum: 1
      required:
        - productId
        - quantity
  securitySchemes:
    x-client-secret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Your secret API key. Keep this secure and never expose it in client-side
        code.
    x-client-key:
      type: apiKey
      in: header
      name: x-client-key
      description: Your unique client API key. Obtain this from your Devdraft AI dashboard.

````