> ## 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 a document for customer

> Uploads an identity verification document for a customer using multipart form-data. Required when a customer has "document" status during the verification process.



## OpenAPI

````yaml post /customers/{id}/documents
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:
  /customers/{id}/documents:
    post:
      tags:
        - documents
      summary: Create a document for customer
      description: >-
        Uploads an identity verification document for a customer using multipart
        form-data. Required when a customer has "document" status during the
        verification process.
      operationId: createCustomerDocument
      parameters:
        - name: id
          in: path
          description: customer unique identifier
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/Accept'
      requestBody:
        description: Upload a document for a customer.
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - documentType
                - file
              properties:
                documentType:
                  type: string
                  enum:
                    - passport
                    - license
                    - idCard
                    - other
                  example: license
                file:
                  type: string
                  format: binary
      responses:
        '201':
          description: successful operation
          headers:
            Location:
              $ref: '#/components/headers/Location'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/MaximumNumberOfResourcesSchema'
                  - $ref: '#/components/schemas/InvalidFileTypeSchema'
                  - $ref: '#/components/schemas/DuplicateResourceSchema'
        '403':
          description: not found
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/InvalidResourceStateSchema'
                  - $ref: '#/components/schemas/NotAuthorizedSchema'
        '404':
          description: not found
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: notFound
                  message:
                    type: string
                    example: Customer not found. Check CustomerId.
        '413':
          description: request entity too large
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: fileTooLarge
                  message:
                    type: string
                    example: Document requests are limited to 10 MiB.
      x-codeSamples:
        - lang: bash
          source: >
            curl -X POST

            \ -H "Authorization: Bearer
            tJlyMNW6e3QVbzHjeJ9JvAPsRglFjwnba4NdfCzsYJm7XbckcR"

            \ -H "Accept: application/vnd.dwolla.v1.hal+json"

            \ -H "Cache-Control: no-cache"

            \ -H "Content-Type: multipart/form-data;
            boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"

            \ -F "documentType=passport"

            \ -F "file=@foo.png"

            \
            'https://api-sandbox.dwolla.com/customers/1de32eC7-ff0b-4c0c-9f09-19629e6788ce/documents'


            ...


            HTTP/1.1 201 Created

            Location:
            https://api-sandbox.dwolla.com/documents/11fe0bab-39bd-42ee-bb39-275afcc050d0
        - lang: javascript
          source: >
            // Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node

            // Using form-data - https://github.com/form-data/form-data (Not
            Maintained By Dwolla)

            var customerUrl =
            "https://api-sandbox.dwolla.com/customers/1de32eC7-ff0b-4c0c-9f09-19629e6788ce";


            var requestBody = new FormData();

            requestBody.append("file", fs.createReadStream("mclovin.jpg"), {
              filename: "mclovin.jpg",
              contentType: "image/jpeg",
              knownLength: fs.statSync("mclovin.jpg").size,
            });

            requestBody.append("documentType", "license");


            dwolla
              .post(`${customerUrl}/documents`, requestBody)
              .then((res) => res.headers.get("location")); // => "https://api-sandbox.dwolla.com/documents/fb919e0b-ffbe-4268-b1e2-947b44328a16"
        - lang: python
          source: >
            # Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python

            customer_url =
            'https://api-sandbox.dwolla.com/customers/1de32eC7-ff0b-4c0c-9f09-19629e6788ce'


            document = app_token.post('%s/documents' % customer_url, file =
            open('mclovin.jpg', 'rb'), documentType = 'license')

            document.headers['location'] # =>
            'https://api-sandbox.dwolla.com/documents/fb919e0b-ffbe-4268-b1e2-947b44328a16'
        - lang: php
          source: |
            /**
             * No example for this language yet.
             **/
        - lang: ruby
          source: >
            # Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby

            customer_url =
            'https://api-sandbox.dwolla.com/customers/1de32eC7-ff0b-4c0c-9f09-19629e6788ce'


            file = Faraday::UploadIO.new('mclovin.jpg', 'image/jpeg')

            document = app_token.post "#{customer_url}/documents", file: file,
            documentType: 'license'

            document.response_headers[:location] # =>
            "https://api.dwolla.com/documents/fb919e0b-ffbe-4268-b1e2-947b44328a16"
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
  headers:
    Location:
      description: The location of the created resource
      schema:
        type: string
  schemas:
    MaximumNumberOfResourcesSchema:
      title: MaximumNumberOfResourcesSchema
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: maximumNumberOfResources
        message:
          type: string
          example: >-
            Max of four files upload allowed. Please wait for Dwolla to manually
            check the documents.
    InvalidFileTypeSchema:
      title: InvalidFileTypeSchema
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalidFileType
        message:
          type: string
          example: >-
            File types supported: Personal IDs - .jpg, .jpeg or .png. Business
            Documents - .jpg, .jpeg, .png, or .pdf.
    DuplicateResourceSchema:
      title: DuplicateResourceSchema
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: DuplicateResource
        message:
          type: string
          example: 'Bank already exists: id=df8392e5-4c06-42ed-b247-c098ed6f5a11'
        _links:
          type: object
          properties:
            about:
              type: object
              properties:
                href:
                  type: string
                  example: >-
                    https://api.dwolla.com/funding-sources/df8392e5-4c06-42ed-b247-c098ed6f5a11
                type:
                  type: string
                  example: application/vnd.dwolla.v1.hal+json
                resource-type:
                  type: string
                  example: funding-source
    InvalidResourceStateSchema:
      title: InvalidResourceStateSchema
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalidResourceState
        message:
          type: string
          example: >-
            Resource cannot be modified. Document creation not allowed for
            already verified Customers or non-verified Customer types.
    NotAuthorizedSchema:
      title: NotAuthorizedSchema
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: notAuthorized
        message:
          type: string
          example: Not authorized to create documents.
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /token
          x-speakeasy-token-endpoint-authentication: client_secret_basic
          scopes: {}

````