# Convert multiple documents

Converts multiple documents, creating an application if one doesn't already exist.   Results can be received in multiple ways:

Callback (preferred): If a URL is specified in the webhook parameter, the following will occur:
 1. This call will return a 202 ACCEPTED.
 2. Once conversion is complete, Insights will call the provided webhook URL with the results.

Sychronous (deprecated): If the webhook parameter is not provided, one of the following will happen:
 * If the file is text-based, the results will be returned in the response. 
 * If the file requires OCR, 202 ACCEPTED will be returned and you will need to use other endpoints to retrieve the results.

While not required, we recommend including the following parameters:
 * accounttype - Specifies the type of document. You can also use autodetectto automatically pick up different types of documents.
 * includescorecard - (true/false) Includes the full underwriting scorecard in the results.
 * includetransactions - (true/false) Includes the full transaction list in the results.
 * format - Changes the structure of the JSON for the scorecard (if included).  jsonobject is recommended.

Endpoint: POST /uploadpdfs
Version: 1.5
Security: 

## Path parameters:

  - `version` (string, required)
    The version of the API.
    Enum: "1.0", "1.1", "1.2", "1.3", "1.4", "1.5"

## Request fields (multipart/form-data):

  - `appnumber` (string, required)
    Customer-provided identifier for the application.
    Example: "ACME Widgets"

  - `pdf-filename` (string)
    The file to upload.  Accepts all supported file types, not just PDFs.  This property may be repeated to upload multiple files at once. Either pdf-filename or jsondata is required.

  - `fileurl` (string)
    The URL of the file(s) to upload. You can place your PDF and JSON files in one ZIP and point the URL to it. From this URL, we can retrieve the zip, unzip the files, and process them.

  - `webhook` (string)
    A URL for Insights to call with the conversion results.
    Example: "https://yourdomain.com/webhook.php"

  - `dowebsearch` (boolean)
    Setting to true performs an AI web search on a merchant to determine its North American Industry Classification System (NAICS) code.

  - `whonlynotify` (boolean)
    Send the webhook only a completion notification (true) or the full results (false).

  - `accounttype` (string)
    The type of document. The choices are Bank, CCard, taxform, MTJson, Plaid, applicationForm or autoDetect.
    Enum: "Bank", "CCard", "taxform", "MTJson", "Plaid", "applicationForm", "autoDetect"

  - `jsondata` (string)
    Use this field when sending JSON text in Plaid or [MoneyThumb format](https://docs.moneythumb.com/pdf-insights/moneythumb-format/mtjson_example). When setting this field, also set the accounttype field to the appropriate corresponding value, Plaid or MTJson.

  - `includescorecard` (boolean)
    Set to true to include the Scorecard data in the results.  Please also include the 'format' property set to 'jsonobject'

  - `includetransactions` (boolean)
    Set to true to include transactions data (JSON format) in results.

  - `includebalance` (boolean)
    Set to true to include the running balance for each transaction. Only use when includetransactions is set to true.

  - `format` (string)
    The desired structure of the scorecard section of the JSON reponse. default is deprecated.
    Enum: "default", "jsonobject"

  - `language` (string)
    The language of a statement.  Uses ISO abbreviations: en, es, fr, de, ln, pt, it. Only needed when the statement isn't in English.

  - `readUSdates` (boolean)
    Reads US dates. Set to true for US Date format (M-D-Y). Set to false for D-M-Y.

  - `writeUSdates` (boolean)
    Writes US dates. Set to true for US Date format (M-D-Y). Set to false for D-M-Y. Set to true if you need Euro dates returned as US dates.

  - `firstpage` (integer)
    The first page number to process (if not page 1).

  - `lastpage` (integer)
    The last page number to process (if not the last page in document).

  - `yearoverride` (integer)
    Sets the year of the statement.

  - `alloweddiff` (integer)
    Sets the value for allowing small balance differences to be ignored. Default is 0. A value such as 100 would mark the statement as reconciled if the balances were accurate within $100.00.

  - `logtype` (string)
    Sets the type of log to create. The choices are txt, htm or none.

  - `combinelines` (boolean)
    Combines description lines into one long description.

  - `noneedalphas` (boolean)
    Recognizes strictly numeric transaction descriptions.

  - `spacingfactor` (number)
    Adjusts how much distance is considered a space.

  - `doocrfile` (boolean)
    Run OCR. Use with caution. Intended for manual use. Set to true when initial processing of a statement does not return correct results.

  - `neverocr` (boolean)
    Never runs OCR. Set to true to never run OCR.

  - `asyncocr` (boolean)
    Only set to true to have an email sent at the completion of an OCR conversion.

  - `accountseqno` (integer)
    For statements with multiple accounts, set which accounts to process. Set to -1 to process all accounts. To process a specific account, use the integer that corresponds to order of appearance for that account. For example, to process the 2nd account, use 2.

  - `monthseqno` (integer)
    For files with multiple statements, set which statement to process. Set to -1 to process all statements. To process a specific statement, use the integer that corresponds to order of appearance for that statement. For example, to process the 2nd statement, use 2.

  - `readempty` (boolean)
    Set to true to show statements with no transactions.

  - `finduntrue` (boolean)
    Set to true to automatically find untrue transactions.

  - `sections` (string)
    The scorecard sections to return. This field can either contain a single section name or multiple section names. To have multiple sections returned, write each section name separated by commas. For a list of valid section names, see the object name of the section in the [Scorecard Reference page](https://docs.moneythumb.com/pdf-insights/scorecard). This overrides what is defined in the user profile.

  - `showtranstype` (boolean)
    Set to true to show all transaction amounts as positive and include debit/credit in the type field. Only use when includetransactions is set to true.

  - `customerid` (string)
    The reseller customer ID.

  - `owner` (string)
    The owner or company name of the applicant. This is only used in combination with appnumber.
    Example: "ACME Widgets"

  - `userdata` (string)
    The customer provided meta data to return with response. Must be valid JSON. Limited to 250 characters.

  - `appid` (integer)
    Insights-generated identifier for the application.
    Example: 123

  - `schema` (string)
    Use plaid when running a Plaid JSON file.  Required to get results for Plaid json files.

  - `fixedcolumns` (boolean)
    Sets whether standard CSV columns are used. If not set, then the columns will appear in the same order found in the PDF file.

## Response 400 fields (application/json):

  - `error` (string)
    Example: "No file found to process"

## Response 401 fields (application/json):

  - `error` (string)
    Example: "Bad token"

## Response 429 fields (application/json):

  - `error` (string)
    Example: "An identical file has been uploaded to this application too many times."

## Response 500 fields (application/json):

  - `error` (string)
    Example: "Encountered an unknown error. It has been reported. Please contact support@moneythumb.com for any questions."

  - `requestId` (string)
    Unique identifier for the request, useful for tracing.

## Response 503 fields (application/json):

  - `error` (string)
    Example: "Service unavailable"


