> ## 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 stable payment intent

> Creates a new stable payment intent for stablecoin-to-stablecoin transfers.
    
This endpoint allows you to create payment intents for transfers between different stablecoins and networks.
Perfect for cross-chain stablecoin swaps and conversions.

## Use Cases
- USDC to EURC conversions
- Cross-chain stablecoin transfers (e.g., Ethereum USDC to Polygon USDC)
- Flexible amount payment intents for dynamic pricing

## Example: USDC to EURC Conversion
```json
{
  "sourceCurrency": "usdc",
  "sourceNetwork": "ethereum",
  "destinationCurrency": "eurc",
  "destinationNetwork": "polygon",
  "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1",
  "amount": "100.00",
  "customer_first_name": "John",
  "customer_last_name": "Doe",
  "customer_email": "john.doe@example.com"
}
```

## Flexible Amount Payments
Omit the `amount` field to create a flexible payment intent where users can specify the amount during payment.

## Idempotency
Include an `idempotency-key` header with a unique UUID v4 to prevent duplicate payments. Subsequent requests with the same key will return the original response.



## OpenAPI

````yaml /swagger.yml post /api/v0/payment-intents/stablecoin
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-intents/stablecoin:
    post:
      tags:
        - Payment Intents
      summary: Create a stable payment intent
      description: >-
        Creates a new stable payment intent for stablecoin-to-stablecoin
        transfers.
            
        This endpoint allows you to create payment intents for transfers between
        different stablecoins and networks.

        Perfect for cross-chain stablecoin swaps and conversions.


        ## Use Cases

        - USDC to EURC conversions

        - Cross-chain stablecoin transfers (e.g., Ethereum USDC to Polygon USDC)

        - Flexible amount payment intents for dynamic pricing


        ## Example: USDC to EURC Conversion

        ```json

        {
          "sourceCurrency": "usdc",
          "sourceNetwork": "ethereum",
          "destinationCurrency": "eurc",
          "destinationNetwork": "polygon",
          "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1",
          "amount": "100.00",
          "customer_first_name": "John",
          "customer_last_name": "Doe",
          "customer_email": "john.doe@example.com"
        }

        ```


        ## Flexible Amount Payments

        Omit the `amount` field to create a flexible payment intent where users
        can specify the amount during payment.


        ## Idempotency

        Include an `idempotency-key` header with a unique UUID v4 to prevent
        duplicate payments. Subsequent requests with the same key will return
        the original response.
      operationId: PaymentIntentController_createStablePaymentIntent
      parameters:
        - name: idempotency-key
          in: header
          description: Unique UUID v4 for idempotent requests. Prevents duplicate payments.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        description: Stable payment intent creation data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateStablePaymentIntentDto'
      responses:
        '201':
          description: Stable payment intent created successfully
          content:
            application/json:
              example:
                id: txn_01HZXK8M9N2P3Q4R5S6T7U8V9W
                bridge_transfer_id: transfer_abc123xyz456
                state: pending
                amount: '100.00'
                source:
                  payment_rail: ethereum
                  currency: usdc
                destination:
                  payment_rail: polygon
                  currency: eurc
                  to_address: '0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1'
                customer:
                  first_name: John
                  last_name: Doe
                  email: john.doe@example.com
                  address: 123 Main St, New York, NY 10001
                  country: United States
                  phone_number: +1-555-123-4567
                created_at: '2023-07-01T12:00:00.000Z'
                updated_at: '2023-07-01T12:00:00.000Z'
        '400':
          description: Bad Request - Invalid input data
        '401':
          description: Unauthorized - Invalid API credentials
        '404':
          description: Not Found - App not found
        '409':
          description: Conflict - Idempotency key already used with different parameters
      security:
        - x-client-secret: []
        - x-client-key: []
components:
  schemas:
    CreateStablePaymentIntentDto:
      type: object
      properties:
        sourceCurrency:
          description: >-
            The stablecoin currency to convert FROM. This is the currency the
            customer will pay with.
          example: usdc
          allOf:
            - $ref: '#/components/schemas/StableCoinCurrency'
        sourceNetwork:
          description: >-
            The blockchain network where the source currency resides. Determines
            gas fees and transaction speed.
          example: ethereum
          allOf:
            - $ref: '#/components/schemas/BridgePaymentRail'
        destinationCurrency:
          description: >-
            The stablecoin currency to convert TO. If omitted, defaults to the
            same as source currency (cross-chain transfer).
          example: eurc
          allOf:
            - $ref: '#/components/schemas/StableCoinCurrency'
        destinationNetwork:
          description: >-
            The blockchain network where the converted currency will be
            delivered. Must support the destination currency.
          example: polygon
          allOf:
            - $ref: '#/components/schemas/BridgePaymentRail'
        destinationAddress:
          type: string
          description: >-
            The wallet address where converted funds will be sent. Supports
            Ethereum (0x...) and Solana address formats.
          example: '0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1'
        amount:
          type: string
          description: >-
            Payment amount in the source currency. Omit for flexible amount
            payments where users specify the amount during checkout.
          example: '100.50'
          pattern: ^\d+(\.\d{1,6})?$
          minimum: 0.01
        customer_first_name:
          type: string
          description: >-
            Customer's first name. Used for transaction records and compliance.
            Required for amounts over $1000.
          example: John
          maxLength: 100
        customer_last_name:
          type: string
          description: >-
            Customer's last name. Used for transaction records and compliance.
            Required for amounts over $1000.
          example: Doe
          maxLength: 100
        customer_email:
          type: string
          description: >-
            Customer's email address. Used for transaction notifications and
            receipts. Highly recommended for all transactions.
          example: john.doe@example.com
          format: email
          maxLength: 255
        customer_address:
          type: string
          description: >-
            Customer's full address. Required for compliance in certain
            jurisdictions and high-value transactions.
          example: 123 Main St, New York, NY 10001
          maxLength: 500
        customer_country:
          type: string
          description: >-
            Customer's country of residence. Used for compliance and tax
            reporting.
          example: United States
          maxLength: 100
        customer_countryISO:
          type: string
          description: >-
            Customer's country ISO 3166-1 alpha-2 code. Used for automated
            compliance checks.
          example: US
          pattern: ^[A-Z]{2}$
          maxLength: 2
        customer_province:
          type: string
          description: >-
            Customer's state or province. Required for US and Canadian
            customers.
          example: New York
          maxLength: 100
        customer_provinceISO:
          type: string
          description: >-
            Customer's state or province ISO code. Used for automated tax
            calculations.
          example: NY
          maxLength: 10
        phoneNumber:
          type: string
          description: >-
            Customer's phone number with country code. Used for SMS
            notifications and verification.
          example: +1-555-123-4567
          pattern: ^[+]?[\d\s\-\(\)]+$
          maxLength: 20
      required:
        - sourceCurrency
        - sourceNetwork
        - destinationNetwork
    StableCoinCurrency:
      type: string
      enum:
        - usdc
        - eurc
      description: >-
        The stablecoin currency to convert FROM. This is the currency the
        customer will pay with.
    BridgePaymentRail:
      type: string
      enum:
        - ethereum
        - solana
        - polygon
        - avalanche_c_chain
        - base
        - arbitrum
        - optimism
        - stellar
        - tron
        - bridge_wallet
        - wire
        - ach
        - ach_push
        - ach_same_day
        - sepa
        - swift
        - spei
      description: >-
        The blockchain network where the source currency resides. Determines gas
        fees and transaction speed.
  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.

````