# Merchant_Pre_Onboarding

The merchant’s first step is to request an invitation to apply.
The merchant provides the sponsor with required business and contact information,
which the sponsor then submits to Momnt for storage and initial account creation.
The response from this endpoint allows the sponsor to store Momnt’s merchant-specific identifiers for future use.
After a successful request, Momnt sends the new merchant an email invitation to complete their application
using Momnt’s merchant onboarding user interface (UI). Please ensure the address submitted is a valid,
mailable address. Momnt uses Smarty Streets (smarty.com) as the address verification provider.
**Notes for Testing:**
- After a successful POST, a merchant account will be created along with the first merchant admin user.
- If you wish to test again, you must change the `users_business_email`, `user_id`,
and `contractor_id` values so they are unique for each request.

**Error Responses:**
- 400: `User Already Exists`
- 400: `Merchant Already Exists`
- 400: `Merchant User Already Exists`

Endpoint: POST /api/v1/sponsor/merchants/onboarding/
Version: 1.0.0 (sponsor_merchant_v1)
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Request fields (application/json):

  - `first_name` (string, required)

  - `middle_name` (string)

  - `last_name` (string, required)

  - `user_business_email` (string, required)

  - `mobile_phone` (string, required)
    Format as: +15552223333. This will be used to verify merchant’s email via one-time password (OTP) text message.

  - `user_id` (string, required)
    Your system user ID associated to this specific merchant user.

  - `business_name` (string, required)

  - `business_address_1` (string, required)
    This should be a physical address and not a P.O. Box.

  - `business_address_2` (string)

  - `business_phone` (string, required)
    Format as: +15552223333

  - `state` (string, required)
    Format as two letters (ex. NY, CA, etc.)

  - `city` (string, required)

  - `zip_code` (string, required)
    Format as five digits (ex. 10456). Verified zip codes with four-digit extension can be sent (ex. 10456-1234)

  - `contractor_id` (string, required)
    External Sponsor assigned identifier for this specific merchant (contractor).

  - `sponsor_callback_url` (string, required)
    Callback URL is static and provided by the sponsor.

  - `sponsor_redirect_url` (string, required)
    URL where a merchant should be redirected after application process is complete (typically your portal login).

## Response 201 fields (application/json):

  - `artis_merchant_user_id` (string, required)

  - `artis_merchant_id` (string, required)

  - `invitation_link` (string)

## Response 400 fields (application/json):

  - `detail` (string, required)

## Callback:

  - `pre_onboarding_callback` (unknown)
    Merchant Pre-Onboarding Callback (POST)
For an external partner to create a merchant, a user with admin/owner permissions on
that merchant must complete Momnt's onboarding workflow. Once the workflow is successfully completed,
and the user has accepted the Terms & Conditions,
Momnt will send a callback and POST the finalized merchant data.
**Requirements**
- A successful start-merchant-onboarding POST must occur before any callback will fire.
- The merchant user must complete the onboarding UI flow and accept the Terms & Conditions.
- Only after both steps are complete will Momnt issue the callback.

**URL Parameters**
- URL parameters should follow standard key/value format and are fully optional.
- Authentication for the callback uses Basic Auth, requiring a username and password
that the partner provides to Momnt and that Momnt stores securely in our system.

## Callback request fields (application/json):

  - `owners` (array, required)
    One object per merchant owner.

  - `owners.first_name` (string, required)

  - `owners.middle_name` (string)

  - `owners.last_name` (string, required)

  - `owners.owner_percentage` (string, required)

  - `contractor_id` (string, required)
    External Partner assigned identifier for this merchant/contractor.

  - `legal_business_name` (string, required)
    Registered business name for this merchant.

  - `dba_name` (string)
    Registered Doing Business As name, if different from the legal_business_name.

  - `ein` (string)
    Federal Tax ID Number.

  - `merchant_application_status` (string, required)

  - `status` (string, required)

  - `terms_and_conditions_accepted` (boolean, required)
    This is always true, as they can't complete an app without accepting the T&C.

  - `business_structure` (string, required)
    Expected Values: Sole Proprietorship, LLC, S Corp, or C Corp, or Partnership.
* `Sole Proprietorship` - Sole Proprietorship
* `LLC` - LLC
* `S Corp` - S Corp
* `C Corp` - C Corp
* `Partnership` - Partnership
    Enum: "Sole Proprietorship", "LLC", "S Corp", "C Corp", "Partnership"

  - `offers_financing` (boolean, required)

  - `average_customer_spend` (string, required)
    Average customer spend amount in USD floating point 111.22.

  - `merchant_website_url` (string, required)
    A URL to the merchant's website.

  - `data_business_started` (string, required)

  - `annual_sales_revenue` (string, required)
    Annual revenue amount in USD.

  - `yearly_financing_volume` (string, required)
    Yearly financing amount in USD.

  - `payment_types` (array, required)

  - `merchant_account_exists` (boolean, required)
    Whether a Merchant has a payment account.

  - `bank_account_status` (string, required)
    The status of the Merchant’s bank account verification. Values can be: `false`, `new`, `pending`, `verified`, `verificationFailed`, `errored`

  - `last_four` (string, required)
    Empty string.

## Callback response 201 fields (application/json):

  - `artis_merchant_user_id` (string, required)

  - `artis_merchant_id` (string, required)

  - `invitation_link` (string)

## Callback response 400 fields (application/json):

  - `detail` (string, required)

