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

> Creates a new bank payment intent for fiat-to-stablecoin transfers.
    
This endpoint allows you to create payment intents for bank transfers (ACH, Wire, SEPA) that convert to stablecoins.
Perfect for onboarding users from traditional banking to crypto.

## Supported Payment Rails
- **ACH_PUSH**: US bank transfers (same-day or standard)
- **WIRE**: International wire transfers
- **SEPA**: European bank transfers

## Use Cases
- USD bank account to USDC conversion
- EUR bank account to EURC conversion
- MXN bank account to stablecoin conversion
- Flexible amount payment intents for variable pricing

## Supported Source Currencies
- **USD**: US Dollar
- **EUR**: Euro
- **MXN**: Mexican Peso

## Example: USD Bank to USDC
```json
{
  "sourcePaymentRail": "ach_push",
  "sourceCurrency": "usd",
  "destinationCurrency": "usdc",
  "destinationNetwork": "ethereum",
  "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1",
  "amount": "1000.00",
  "customer_first_name": "John",
  "customer_last_name": "Doe",
  "customer_email": "john.doe@example.com",
  "ach_reference": "INV12345"
}
```

## Reference Fields
Use appropriate reference fields based on the payment rail:
- `ach_reference`: For ACH transfers (max 10 chars, alphanumeric + spaces)
- `wire_message`: For wire transfers (max 256 chars)
- `sepa_reference`: For SEPA transfers (6-140 chars, specific character set)

## 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/bank
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/bank:
    post:
      tags:
        - Payment Intents
      summary: Create a bank payment intent
      description: >-
        Creates a new bank payment intent for fiat-to-stablecoin transfers.
            
        This endpoint allows you to create payment intents for bank transfers
        (ACH, Wire, SEPA) that convert to stablecoins.

        Perfect for onboarding users from traditional banking to crypto.


        ## Supported Payment Rails

        - **ACH_PUSH**: US bank transfers (same-day or standard)

        - **WIRE**: International wire transfers

        - **SEPA**: European bank transfers


        ## Use Cases

        - USD bank account to USDC conversion

        - EUR bank account to EURC conversion

        - MXN bank account to stablecoin conversion

        - Flexible amount payment intents for variable pricing


        ## Supported Source Currencies

        - **USD**: US Dollar

        - **EUR**: Euro

        - **MXN**: Mexican Peso


        ## Example: USD Bank to USDC

        ```json

        {
          "sourcePaymentRail": "ach_push",
          "sourceCurrency": "usd",
          "destinationCurrency": "usdc",
          "destinationNetwork": "ethereum",
          "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1",
          "amount": "1000.00",
          "customer_first_name": "John",
          "customer_last_name": "Doe",
          "customer_email": "john.doe@example.com",
          "ach_reference": "INV12345"
        }

        ```


        ## Reference Fields

        Use appropriate reference fields based on the payment rail:

        - `ach_reference`: For ACH transfers (max 10 chars, alphanumeric +
        spaces)

        - `wire_message`: For wire transfers (max 256 chars)

        - `sepa_reference`: For SEPA transfers (6-140 chars, specific character
        set)


        ## 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_createBankPaymentIntent
      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: Bank payment intent creation data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBankPaymentIntentDto'
      responses:
        '201':
          description: Bank payment intent created successfully
          content:
            application/json:
              example:
                id: txn_01HZXK8M9N2P3Q4R5S6T7U8V9X
                bridge_transfer_id: transfer_def456ghi789
                state: pending
                amount: '1000.00'
                source:
                  payment_rail: ach_push
                  currency: usd
                destination:
                  payment_rail: ethereum
                  currency: usdc
                  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
                references:
                  ach_reference: INV12345
                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:
    CreateBankPaymentIntentDto:
      type: object
      properties:
        sourcePaymentRail:
          description: >-
            The banking payment method to use for the transfer. Determines
            processing time and fees.
          example: ach_push
          allOf:
            - $ref: '#/components/schemas/BridgePaymentRail'
        sourceCurrency:
          description: >-
            The fiat currency to convert FROM. Must match the currency of the
            source payment rail.
          example: usd
          default: usd
          allOf:
            - $ref: '#/components/schemas/FiatCurrency'
        destinationCurrency:
          description: >-
            The stablecoin currency to convert TO. The customer will receive
            this currency.
          example: usdc
          allOf:
            - $ref: '#/components/schemas/StableCoinCurrency'
        destinationNetwork:
          description: >-
            The blockchain network where the stablecoin will be delivered. Must
            support the destination currency.
          example: ethereum
          allOf:
            - $ref: '#/components/schemas/BridgePaymentRail'
        destinationAddress:
          type: string
          description: >-
            Destination wallet address. Supports Ethereum (0x...) and Solana
            address formats.
          example: '0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1'
        amount:
          type: string
          description: Payment amount (optional for flexible amount)
          example: '1000.00'
        customer_first_name:
          type: string
          description: Customer first name
          example: John
        customer_last_name:
          type: string
          description: Customer last name
          example: Doe
        customer_email:
          type: string
          description: Customer email address
          example: john.doe@example.com
        customer_address:
          type: string
          description: Customer address
          example: 123 Main St, New York, NY 10001
        customer_country:
          type: string
          description: Customer country
          example: United States
        customer_countryISO:
          type: string
          description: Customer country ISO code
          example: US
        customer_province:
          type: string
          description: Customer province/state
          example: New York
        customer_provinceISO:
          type: string
          description: Customer province/state ISO code
          example: NY
        phoneNumber:
          type: string
          description: Customer phone number
          example: +1-555-123-4567
        wire_message:
          type: string
          description: Wire transfer message (for WIRE transfers)
          maxLength: 256
          example: 'Payment for invoice #12345'
        sepa_reference:
          type: string
          description: SEPA reference (for SEPA transfers)
          minLength: 6
          maxLength: 140
          example: REF-123456789
        ach_reference:
          type: string
          description: ACH reference (for ACH transfers)
          maxLength: 10
          example: ACH123456
      required:
        - sourcePaymentRail
        - sourceCurrency
        - destinationCurrency
        - destinationNetwork
    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.
    FiatCurrency:
      type: string
      enum:
        - usd
        - eur
        - mxn
      description: >-
        The fiat currency to convert FROM. Must match the currency of the source
        payment rail.
    StableCoinCurrency:
      type: string
      enum:
        - usdc
        - eurc
      description: >-
        The stablecoin currency to convert FROM. This is the currency the
        customer will pay with.
  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.

````