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

# JS SDK: Register New Partner Applications via Form

> Call kiflo('partner', ...) on form submission to enroll new partner applicants directly into your Kiflo program from your website.

Call `kiflo('partner', ...)` each time a prospective partner submits your partner application form. Kiflo creates a partner record in your account and places the new partner into the program level you specify, so your team can immediately review their application and move them through your onboarding workflow. This is the recommended approach if you want partners to apply directly from your marketing site or partner portal.

## Syntax

```javascript theme={null}
kiflo('partner', {
  // partnerObject
},
function(response) {
  // handle success
},
function(error) {
  // handle error
});
```

## Example

```javascript theme={null}
kiflo('partner', {
  name: 'Acme Corp',
  status: 'Prospect',
  programLevelId: 14,
  mainContact: {
    firstName: 'Jane',
    lastName: 'Smith',
    email: 'jane.smith@acme.com',
    jobTitle: 'CEO',
    createAccount: false
  },
  properties: {
    country: 'US'
  }
},
function(response) {
  // handle success
},
function(error) {
  // handle error
});
```

## Parameters

### PartnerObject

<ParamField body="name" type="string" required>
  The display name of the partner organization — typically the company name (e.g., `"Acme Corp"`).
</ParamField>

<ParamField body="mainContact" type="object" required>
  The primary contact person for this partner. `firstName`, `lastName`, and `email` are required.

  <Expandable title="MainContact fields">
    <ParamField body="firstName" type="string" required>
      The contact's first name.
    </ParamField>

    <ParamField body="lastName" type="string" required>
      The contact's last name.
    </ParamField>

    <ParamField body="email" type="string" required>
      The contact's email address. This is used to identify the contact in Kiflo.
    </ParamField>

    <ParamField body="jobTitle" type="string">
      The contact's job title (e.g., `"CEO"`, `"Partnerships Manager"`).
    </ParamField>

    <ParamField body="phoneNumber" type="string">
      The contact's phone number in any format (e.g., `"+1 555 666 777"`).
    </ParamField>

    <ParamField body="createAccount" type="boolean">
      Set to `true` to automatically create a Kiflo portal account for this contact, giving them access to the partner portal immediately. Defaults to `false`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="status" type="string">
  The initial status of the partner record. Accepted values are `"Applicant"`, `"Prospect"`, `"Active"`, and `"Declined"`. Use `"Applicant"` for partners submitting an application form so your team knows the record needs review.
</ParamField>

<ParamField body="programLevelId" type="number">
  The identifier of the program level the partner is applying to join. See [Finding the programLevelId](#finding-the-programlevelid) below.
</ParamField>

<ParamField body="properties" type="object">
  Custom partner properties as configured in your Kiflo [account properties](https://app.kiflo.com/account/properties). Use this to capture any additional data your application form collects, such as `country`, `website`, or `partnerType`.
</ParamField>

## Finding the programLevelId

The `programLevelId` is the numeric ID of a specific level within one of your Kiflo programs. To find it:

1. Log in to your Kiflo account.
2. Navigate to the program that contains the level.
3. Click on the level you want partners to apply to.
4. Look at the browser address bar — the URL will look like:
   ```
   https://app.kiflo.com/account/65758263/programs/93/levels/155
   ```
5. The last number in the URL is the `programLevelId`. In this example it is **155**.

<Tip>
  If your application form lets partners choose between multiple program levels (e.g., "Sales Partner", "Reseller"), populate a dropdown with each level's name and corresponding ID, then pass the selected value as `programLevelId` when the form is submitted.
</Tip>

## Full form integration example

Here is a complete example connecting an HTML application form to Kiflo:

```javascript theme={null}
function signUpPartner() {
  var firstname      = document.getElementById('firstname').value;
  var lastname       = document.getElementById('lastname').value;
  var email          = document.getElementById('email').value;
  var companyName    = document.getElementById('companyName').value;
  var country        = document.getElementById('country').value;
  var programLevelId = document.getElementById('programLevelId').value;

  kiflo('partner', {
    name: companyName,
    status: 'Applicant',
    programLevelId: programLevelId,
    mainContact: {
      firstName: firstname,
      lastName: lastname,
      email: email
    },
    properties: {
      country: country
    }
  },
  function() {
    console.log('Partner application submitted successfully.');
    window.location.href = '/thank-you';
  },
  function(err) {
    console.error('Partner signup error:', err);
  });
}
```

After submission, the new partner appears in Kiflo under the program level you specified and is ready for your team to review.
