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

# Create an on-demand transfer authorization

> Create an on-demand transfer authorization that allows Customers to pre-authorize variable amount ACH transfers from their bank account for future payments. This authorization is used when creating Customer funding sources to enable flexible payment processing. Returns UI text elements including authorization body text and button text for display in your application's bank account addition flow.



## OpenAPI

````yaml post /on-demand-authorizations
openapi: 3.1.0
info:
  title: Dwolla API
  description: Dwolla API Documentation
  contact:
    name: Dwolla Developer Relations Team
    url: https://developers.dwolla.com
    email: api@dwolla.com
  version: '2.0'
  termsOfService: https://www.dwolla.com/legal/tos/
  license:
    name: MIT
    url: https://github.com/Dwolla/dwolla-openapi/blob/master/LICENSE
servers:
  - url: https://api.dwolla.com
    description: Production server
  - url: https://api-sandbox.dwolla.com
    description: Sandbox server
security:
  - clientCredentials: []
tags:
  - name: tokens
    description: Operations related to Application Access Tokens
  - name: root
    description: Root API operations
  - name: accounts
    description: Operations related to Accounts
  - name: customers
    description: Operations related to Customers
  - name: kba
    description: Operations related to Knowledge-Based Authentication
  - name: beneficial owners
    description: Operations related to Beneficial Owners
  - name: documents
    description: Operations related to Documents
  - name: exchanges
    description: Operations related to Exchanges
  - name: exchange sessions
    description: Operations related to Exchange Sessions
  - name: funding sources
    description: Operations related to Funding Sources
  - name: transfers
    description: Operations related to Transfers
  - name: labels
    description: Operations related to Labels
  - name: mass payments
    description: Operations related to Mass Payments
  - name: events
    description: Operations related to Events
  - name: webhook subscriptions
    description: Operations related to Webhook Subscriptions
  - name: webhooks
    description: Operations related to Webhooks
  - name: client tokens
    description: Operations related to Client Tokens
  - name: sandbox simulations
    description: Sandbox-only operations for simulating processing of bank transfers
paths:
  /on-demand-authorizations:
    post:
      tags:
        - funding sources
      summary: Create an on-demand transfer authorization
      description: >-
        Create an on-demand transfer authorization that allows Customers to
        pre-authorize variable amount ACH transfers from their bank account for
        future payments. This authorization is used when creating Customer
        funding sources to enable flexible payment processing. Returns UI text
        elements including authorization body text and button text for display
        in your application's bank account addition flow.
      operationId: createOnDemandTransferAuthorization
      parameters:
        - $ref: '#/components/parameters/Accept'
      responses:
        '200':
          description: Ok
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/OnDemandAuthorization'
        '403':
          description: 403 Error
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
      x-codeSamples:
        - lang: bash
          source: >
            POST https://api-sandbox.dwolla.com/on-demand-authorizations

            Accept: application/vnd.dwolla.v1.hal+json

            Content-Type: application/vnd.dwolla.v1.hal+json

            Authorization: Bearer
            pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY


            {
              "_links": {
                "self": {
                  "href": "https://api-sandbox.dwolla.com/on-demand-authorizations/30e7c028-0bdf-e511-80de-0aa34a9b2388"
                }
              },
              "bodyText": "I agree that future payments to Company ABC inc. will be processed by the Dwolla payment system from the selected account above. In order to cancel this authorization, I will change my payment settings within my Company ABC inc. account.",
              "buttonText": "Agree & Continue"
            }
        - lang: javascript
          source: >
            // Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node

            dwolla.post("on-demand-authorizations").then((res) =>
            res.body.buttonText); // => "Agree & Continue"
        - lang: python
          source: |
            # Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
            on_demand_authorization = app_token.post('on-demand-authorizations')
            on_demand_authorization.body['buttonText'] # => 'Agree & Continue'
        - lang: php
          source: >
            <?php

            // Using dwollaswagger -
            https://github.com/Dwolla/dwolla-swagger-php

            $onDemandApi = new
            DwollaSwagger\OndemandauthorizationsApi($apiClient);


            $onDemandAuth = $onDemandApi->createAuthorization();

            $onDemandAuth->_links["self"]->href; # =>
            "https://api-sandbox.dwolla.com/on-demand-authorizations/30e7c028-0bdf-e511-80de-0aa34a9b2388"

            ?>
        - lang: ruby
          source: |
            # Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
            on_demand_authorization = app_token.post "on-demand-authorizations"
            on_demand_authorization.buttonText # => "Agree & Continue"
components:
  parameters:
    Accept:
      name: Accept
      in: header
      required: true
      description: >-
        The media type of the response. Must be
        application/vnd.dwolla.v1.hal+json
      schema:
        type: string
        enum:
          - application/vnd.dwolla.v1.hal+json
        default: application/vnd.dwolla.v1.hal+json
  schemas:
    OnDemandAuthorization:
      title: OnDemandAuthorization
      type: object
      properties:
        _links:
          type: object
          properties:
            self:
              type: object
              properties:
                href:
                  type: string
                  example: >-
                    https://api.dwolla.com/on-demand-authorizations/30e7c028-0bdf-e511-80de-0aa34a9b2388
        bodyText:
          type: string
          example: >-
            I agree that future payments to Company ABC inc. will be processed
            by the Dwolla payment system from the selected account above. In
            order to cancel this authorization, I will change my payment
            settings within my Company ABC inc. account.
        buttonText:
          type: string
          example: Agree & Continue
    ForbiddenError:
      title: ForbiddenError
      description: Error response schema for 403 Forbidden
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: Forbidden
        message:
          type: string
          example: The supplied credentials are not authorized for this resource.
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /token
          x-speakeasy-token-endpoint-authentication: client_secret_basic
          scopes: {}

````