# addPartnerLead

Creates a new partner lead with the given lead information and returns a link where the lead can complete their Avalara MyLodgeTax account creation. Or, in the case of an existing My Lodge Tax customer, returns a link that will allow the customer to log in to the My Lodge Tax Admin Application and link their existing locations to listings in the partner's system.

`POST /v2/partnerleads`

**API:** Avalara MyLodgeTax API
**Tag:** Onboarding
**API Version:** v1.2
**Base URL:** https://mylodgetaxapi-sbx.avalara.net
**Content-Type:** `application/json`
**Authentication:** API Key (`Authorization` in header)

Source: https://developer.avalara.com/products/mylodge/api/methods/Onboarding/addPartnerLead/

## Description

The partnerleads endpoint receives information about the potential customer and one or more locations, and securely stores information received in this request.  **Unique** customer and location identifiers must be provided by the calling system in the request body. For leads with an email address not already associated with an account in the Avalara MyLodgeTax system, the response will contain a hyperlink that uniquely identifies the given request.  The hyperlink can be used by the lead or calling application to display a webpage where the user can complete the Avalara MyLodgeTax account creation process.
>
For leads that already exist in the Avalara MyLodgeTax system (based on email address) a link that will allow the existing customer to link their existing locations to their listings in the partner's system will be returned.
>
For leads that already exist in the Avalara MyLodgeTax system (based on email address), and that have already linked at least one location to their listings in the partner's system, a link to launch the property-linking-wizard in the MyLodgeTax system will be returned.

## Request Body

**Schema:** `PostPartnerLeadsRequest`

Request body definition for call to POST /v1/partnerleads

| Property | Type | Required | Description |
|---|---|---|---|
| `customer` | Customer | No |  |
| `locations` | ArrayOfOnboardingLocations | No |  |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | OK | `PostPartnerLeadsResponse` |
| 400 | Bad request: check response body message for details | `ErrorResponse` |
| 401 | Unauthorized | `ErrorResponse` |
| 409 | CustomerId or LocationId(s) for calling partner has already been created. | `PostPartnerLeadsResponseErrorDataExists` |
| 422 | Invalid message body contents: check response body message for details | `ErrorResponse` |
| 429 | Exceeded API Rate Limits | `ErrorResponse` |

### 200 Response: `PostPartnerLeadsResponse`

Representation of a successful response from a POST /v1/partnerleads operation

| Property | Type | Required | Description |
|---|---|---|---|
| `registerLink` | string | No |  |

## Example Request

```bash
curl -X POST "https://mylodgetaxapi-sbx.avalara.net/v2/partnerleads" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "customer": {
    "customerId": "",
    "firstName": "",
    "lastName": "",
    "email": "",
    "phoneNumber": "",
    "billingAddress": {
      "addressLine1": "",
      "addressLine2": "",
      "city": "",
      "state": "",
      "country": "",
      "postalCode": ""
    }
  },
  "locations": [
    {
      "locationId": "",
      "nickname": "",
      "address": {
        "addressLine1": "",
        "addressLine2": "",
        "city": "",
        "state": "",
        "country": "",
        "postalCode": ""
      },
      "personOwners": [
        {
          "firstName": "",
          "lastName": "",
          "ssn": "",
          "percentageOwned": "",
          "phone": ""
        }
      ],
      "licenseInfo": {
        "numBedrooms": "",
        "maxOccupancy": "",
        "estimatedAnnualGrossReceipts": "",
        "hasExistingLicenses": "",
        "localContact": {
          "firstName": "",
          "lastName": "",
          "addressLine1": "",
          "addressLine2": "",
          "city": "",
          "state": "",
          "postalCode": "",
          "phone": "",
          "email": ""
        }
      }
    }
  ]
}'
```