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

# Create a Payment

> Creates a transaction from a user or a payment customer to the app. User the `/users/{user_id}/payout-methods` route to get a user's stored payment methods.



## OpenAPI

````yaml /v2.yaml post /v2/payments
openapi: 3.1.0
info:
  title: dots api
  version: '1.0'
  summary: Dots Payout API
  description: Scalable and Flexible Payouts Infrastructure
  contact:
    name: Kartikye Mittal
    url: https://dots.dev
    email: info@dots.dev
  license:
    name: MIT
    url: https://opensource.org/license/mit/
servers:
  - url: https://api.dots.dev/api
    description: Production
security:
  - api_key: []
tags:
  - name: accounts-payable
    description: Accounts Payable Routes
  - name: apps
    description: App Routes
  - name: flows
    description: Flow routes
  - name: organizations
    description: Organization Routes
  - name: payment-customers
    description: Payment Customer Routes
  - name: payments
    description: Payment Routes
  - name: payout-batches
    description: Payout Batch Routes
  - name: payout-links
    description: Payout Link Routes
  - name: payout-requests
    description: Payout Request Routes
  - name: payouts
    description: Payout Routes
  - name: transactions
    description: Transaction Routes
  - name: transfer-batches
    description: Transfer Batch routes
  - name: transfers
    description: Transfer routes
  - name: users
    description: User routes
paths:
  /v2/payments:
    post:
      tags:
        - payments
      summary: Create a Payment
      description: >-
        Creates a transaction from a user or a payment customer to the app. User
        the `/users/{user_id}/payout-methods` route to get a user's stored
        payment methods.
      operationId: create-payment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: string
                  format: uuid
                customer_id:
                  type: string
                  format: uuid
                amount:
                  type: integer
                  exclusiveMinimum: 0
                platform:
                  type: string
                  enum:
                    - ach
                ach_info:
                  type: object
                  properties:
                    account_number:
                      type: string
                      pattern: '[0-9]{7,17}'
                    routing_number:
                      type: string
                      pattern: '[0-9]{9}'
                    account_type:
                      type: string
                      enum:
                        - checking
                        - savings
                  description: >
                    Specifies the bank account to draw the payment from. This
                    can be used as an alternative to a stored account ID.
                account_id:
                  type:
                    - string
                    - 'null'
                  description: The user's ACH account ID.
                metadata: {}
              required:
                - amount
                - platform
              oneOf:
                - required:
                    - user_id
                - required:
                    - customer_id
              if:
                properties:
                  platform:
                    const: ach
              then:
                oneOf:
                  - required:
                      - account_id
                  - required:
                      - ach_info
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transfer'
                description: The `transfer` object.
components:
  schemas:
    transfer:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created:
          type: string
          format: date-time
        user_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - created
            - pending
            - failed
            - completed
            - reversed
            - canceled
            - flagged
        type:
          type: string
          enum:
            - refill
            - payout
            - balance
            - payment
            - settlement
            - payable
          description: |
            The type of this transfer.
             * `refill` - refill of an API App or Organization's Dots Wallet
             * `payout` - payout to a User
             * `balance` - balance transfer between Dots Wallets, such as from an API App to a User's Dots Wallet
             * `payment` - payment from a User to an API App
             * `settlement` - legacy, currently unused
             * `payable` - payable for Accounts Payable 
        amount:
          type: number
        external_data:
          type: object
          properties:
            account_id:
              type: string
            external_id:
              type: string
            platform:
              type: string
              enum:
                - ach
                - rtp
                - paypal
                - venmo
                - visa
                - amazon
                - cash_app
                - intl_bank
                - airtm
                - payoneer
                - wire
                - invoice
                - crypto
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/transaction'
        payout_link_id:
          type: string
          format: uuid
          description: ID of the `payout-link` that the transfer belongs to.
        metadata:
          type:
            - string
            - object
            - 'null'
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
    transaction:
      type: object
      properties:
        id:
          type: integer
        amount:
          type: number
        created:
          type: string
          format: date-time
        source_name:
          type: string
        destination_name:
          type: string
        type:
          type: string
          enum:
            - balance
            - refill
            - payout
            - payment
            - fee
            - surrogate
          description: The general category of the transaction
        metadata:
          type:
            - string
            - object
            - 'null'
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
        transfer_id:
          type: string
          format: uuid
          description: ID of the `transfer` that the transaction belongs to.
        transfer:
          $ref: '#/components/schemas/transfer'
          description: >-
            The `transfer` that the transaction belongs to. This is only present
            if `include_transfer` is true.
  securitySchemes:
    api_key:
      type: http
      scheme: basic

````