# Submit Application API Migration Guide

## Overview

This document provides guidance for developers migrating from the legacy endpoint `/linear/api/submit` to the new endpoint `/api/v3/applications/submit`.

{% callout type="info" %}
**Both endpoints are currently available.** The legacy endpoint (`/linear/api/submit`) remains operational in QA and production environments. While we encourage you to migrate to the new v3 endpoint at your earliest convenience, you can make the switch whenever your team is ready.

The legacy endpoint is considered deprecated and will eventually be phased out. Additionally, the new v3 endpoint is required to access additional API capabilities, such as document uploads.
{% /callout %}

## Authentication

The authentication is the same as it is for `www.quantumfintech.com/linear/api/submit` / `quantumlends.com/linear/api/submit`. You should use the same authentication token as before. If migrating from the `secure.fundation.com` endpoint, Bearer token authentication replaces the API Key or Client Certificate (mutual TLS).

**Example:**

```
Authorization: Bearer <token>
```

## Request Payload Comparison

### Owner Information

| Legacy Field | New API Field |
|-------------|---------------|
| `owner_first_name` | `owners[0].first_name` |
| `owner_middle` | `owners[0].middle_name` |
| `owner_last_name` | `owners[0].last_name` |
| `owner_suffix` | `owners[0].name_suffix` |
| `owner_job_title` | `owners[0].job_title` |
| `owner_email` | `owners[0].email` |
| `owner_mobile_phone` | `owners[0].phone_number` |
| `owner_DOB` | `owners[0].date_of_birth` |
| `owner_ownership_percentage` | `owners[0].ownership_percent` |
| `owner_ssn` | `owners[0].ssn` |

### Owner Address

| Legacy Field | New API Field |
|-------------|---------------|
| `owner_street_address` | `owners[0].address.street` |
| `owner_street_address_line_2` | `owners[0].address.street_2` |
| `owner_apt_suite_number` | `owners[0].address.apt_suite_number` |
| `owner_city` | `owners[0].address.city` |
| `owner_state` | `owners[0].address.state` |
| `owner_zip_code` | `owners[0].address.zip_code` |

### Business Information

| Legacy Field | New API Field |
|-------------|---------------|
| `business_name` | `business.legal_name` |
| `business_dba` | `business.doing_business_as` |
| `business_street_address` | `business.address.street` |
| `business_street_address_line_2` | `business.address.street_2` |
| `business_apt_suite_number` | `business.address.apt_suite_number` |
| `business_city` | `business.address.city` |
| `business_state` | `business.address.state` |
| `business_zip_code` | `business.address.zip_code` |
| `business_phone` | `business.phone_number` |
| `business_phone_ext_num` | `business.phone_extension` |
| `industry_id` | `business.naics_code` |
| `business_entity_type` | `business.entity_type` |
| `business_tenure_value` | `business.start_date` |
| `business_tax_id` | `business.tax_identification` |

### Additional Questions

| Legacy Field | New API Field |
|-------------|---------------|
| `outstanding_debt` | `additional_questions.outstanding_debt` |
| `business_annual_sales` | `additional_questions.annual_sales` |
| `business_number_of_employees_value` | `additional_questions.number_of_employees` |
| `business_number_of_customers_value` | `additional_questions.number_of_customers` |

### Loan Request

| Legacy Field | New API Field |
|-------------|---------------|
| `loan_amount` | `loan_request.amount` |
| `loan_purpose` | `loan_request.purpose` |
| `owner_permission_to_pull_credit` | `loan_request.authorization` |

## Important Notes

### Owners Array
- `owners` is an array in the new API, but we currently only allow one owner
- `is_applicant` must be `true` for this owner

### Middle Name
- While the legacy API `owner_middle` was a single character for middle initial, the `middle_name` in the new API allows for 100 characters for the middle name

### Phone Number Format
- Phone numbers should now be in the format `"212-555-1234"`

### Loan Purpose Values
`loan_purpose` is now `loan_request.purpose` and supports the following string values:
- `business_expansion`
- `cash_crunch`
- `debt_refinancing`
- `equipment_purchase`
- `inventory_purchase`
- `marketing_campaign`
- `meet_payroll`
- `renovations_or_capital_improvements`
- `working_capital`
- `other`

### Business Entity Type
The `business_entity_type` now uses string values instead of numeric codes:
- `limited_liability_company`
- `partnership`
- `sole_proprietor`
- `s_corporation`
- `c_corporation`
- `other`

### Reference ID
The legacy field `your_customer_id` is now `reference_id` in the new API. This optional field allows you to associate your internal identifier with applications:

```json
{
  "reference_id": "your-internal-id-12345"
}
```

## Fields Not in New API

The following legacy fields are **not supported** in the new API:

**Owner Information:**
- `owner_home_phone`
- `owner_home_own_rent`
- `owner_total_investments_value`
- `owner_household_income`
- `owner_yrs_current_address`
- `owner_months_current_address`
- `owner_prev_*` (all previous address fields)

**Business Information:**
- `business_owns_property`
- `business_annual_pretaxprofit`
- `business_monthly_rent_expense`
- `business_employee_benefits`

**Loan Information:**
- `loan_term`
- `product_type`
- `outstanding_debt_*` (breakdown by type)
- `loan_use_of_proceeds`
- `receivables_*` (all receivables fields)

**Bank Information:**
- All `bank_*` fields (balance, deposits, withdrawals, NSF transactions, etc.)

## Response Differences

### Legacy API Success Response

The Legacy API returns **HTTP Status 200 (OK)** when an application is submitted:

```json
{
  "application_id": "426e224f-1cee-4355-9b76-bf88a67eb2fb",
  "application_status": "204",
  "customer_call_required": "0",
  "doc_requ_bank_statements_3mos": "1",
  "doc_requ_bank_statements_1mos": "1",
  "doc_requ_bus_tax_return_most_recent_year": "0",
  "doc_requ_bus_tax_return_prior_year": "0",
  "doc_requ_bus_debt_schedule": "0",
  "doc_requ_bus_fncl_statements": "0",
  "doc_requ_audited_fncl_statements": "0",
  "doc_requ_pers_tax_return_most_recent_year": "0",
  "doc_requ_pers_tax_return_prior_year": "0",
  "offer_type": "0"
}
```

### New API Success Response

The New API returns **HTTP Status 201 (Created)**. The payload includes the application data that was submitted plus the following fields:

```json
{
  "id": "31c3fa8f-07bc-4b6d-8678-44eb51e4e140",
  "status": "in-review",
  "created": "2024-04-11 17:51:42",
  "modified": "2024-06-02 11:23:10"
}
```

{% callout type="info" %}
For complete details on the new API endpoint, including request schemas, validation rules, and error responses, see the [API Reference](/api-reference.html#tag/Applications/operation/applications_api_submit_application).
{% /callout %}
