# RequestNewAccount

Request a new Avalara account

`POST /api/v2/accounts/request`

**API:** AvaTax API
**Tag:** Provisioning
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/crossborder/api/methods/Provisioning/RequestNewAccount/

## Description

This API is for use by partner provisioning services customers only.
            
Avalara invites select partners to refer new customers to the AvaTax service using the onboarding features
of AvaTax.  These partners can create accounts for new customers using this API.
            
Calling this API creates an account with the specified product subscriptions, but does not configure billing.
The customer will receive information from Avalara about how to configure billing for their account.
You should call this API when a customer has requested to begin using Avalara services.
            
If the newly created account owner wishes, they can confirm that they have read and agree to the Avalara
terms and conditions.  If they do so, they can receive a license key as part of this API and their
API will be created in `Active` status.  If the customer has not yet read and accepted these terms and
conditions, the account will be created in `New` status and they can receive a license key by logging
onto the AvaTax website and reviewing terms and conditions online.
            
In Sandbox environment, the account will always be created as a test account regardless of the IsTest
parameter in the request.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, AvaTaxOnlyCompanyAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
* This API is available by invitation only.
* This API is available by invitation only.  To request access to this feature, please speak to a business development manager and request access to [Provisioning:RequestNewAccount].

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `NewAccountRequestModel`

Represents a request for a new account with Avalara for a new subscriber.
Contains information about the account requested and the rate plan selected.

| Property | Type | Required | Description |
|---|---|---|---|
| `offer` | string | **Yes** | The offer code provided to you by your Avalara business development contact.
            
This code controls what services and rates the customer will be provisioned with upon creation.
            
If you do not know your offer code, please contact your Avalara business development representative. Example: `DeveloperDotAvalaraFreeTrial`. |
| `connectorId` | string | No | The id associated with the connector Example: `a0n4000000ChMwPAAV`. |
| `campaign` | string | No | If your Avalara business development representative requests, please provide the campaign ID associated with your
signup process.  This campaign identifier helps Avalara match users to the context in which they learned about the product
to help improve the accuracy of our messaging.
            
The `campaign` field must be either null or a value provided to you by an Avalara business development representative.
If you provide an unexpected value in this field, your API call will fail. Example: `70140000000TsVb`. |
| `leadSource` | string | No | If your Avalara business development representative requests, please provide the lead source value associated with your
signup process.  This lead source identifier helps Avalara match users to the context in which they learned about the product
to help improve the accuracy of our messaging.
            
The `leadSource` field must be either null or a value provided to you by an Avalara business development representative.
If you provide an unexpected value in this field, your API call will fail. Example: `Direct Visitor`. |
| `effectiveDate` | string | No | The date on which the account should take effect.  If null, defaults to today.
            
You should leave this value `null` unless specifically requested by your Avalara business development manager. |
| `endDate` | string | No | The date on which the account should expire.
            
You should leave this value `null` unless specifically requested by your Avalara business development manager. |
| `accountName` | string | **Yes** | The name of the account to create Example: `BizTech Company Inc.`. |
| `website` | string | No | Website of the new customer whose account is being created.
            
It is strongly recommended to provide the customer's website URL, as this will help our support representatives better
assist customers. Example: `https://biztech.com`. |
| `paymentMethodId` | string | No | Payment Method to be associated with the account.
            
This is strictly to be used internally unless your Avalara business development manager specifically asks you to provide this value
while attempting to create an account. Example: `701abc-def`. |
| `firstName` | string | **Yes** | First name of the primary contact person for this account Example: `Bob`. |
| `lastName` | string | **Yes** | Last name of the primary contact person for this account Example: `Example`. |
| `title` | string | No | Title of the primary contact person for this account |
| `phoneNumber` | string | No | Phone number of the primary contact person for this account |
| `email` | string | **Yes** | Email of the primary contact person for this account Example: `bob@example.org`. |
| `username` | string | No | The username to be associated with the user created.
If this is not provided, email address will be used as the username. Example: `bob`. |
| `userPassword` | string | No | If instructed by your Avalara business development manager, set this value to a temporary password to permit the user to continue their onboarding process.
            
If this value is null, a temporary password is generated by the system and emailed to the user.
            
The user will then be asked to choose a permanent password when they first log on to the AvaTax website. |
| `welcomeEmail` | string | No | This option controls what type of a welcome email is sent when the account is created.
            
* `Normal` - A standard welcome email will be sent.
* `Suppressed` - No email will be sent.
* `Custom` - If your Avalara business development representative provides you with a customized welcome email for your customers, please select this option. Example: `Normal`. |
| `companyAddress` | CompanyAddress | **Yes** | Address information of the account being created. |
| `companyCode` | string | No | Company code to be assigned to the company created for this account.
            
If no company code is provided, this will be defaulted to "DEFAULT" company code. |
| `properties` | string[] | No | Properties of the primary contact person for this account |
| `acceptAvalaraTermsAndConditions` | boolean | No | Set this to true if and only if the owner of the newly created account accepts Avalara's terms and conditions for your account.
            
Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. Example: `true`. |
| `haveReadAvalaraTermsAndConditions` | boolean | No | Set this to true if and only if the owner of the newly created account has fully read Avalara's terms and conditions for your account.
            
Reading and accepting Avalara's terms and conditions is necessary in order for the account to receive a license key. Example: `true`. |
| `marketingContext` | object | No | A dynamic key-value pair for the marketing context information |
| `accountType` | string | No | Type of the account to be created. Regular, Firm or FirmClient Values: `Regular`, `Firm`, `FirmClient`. Example: `Regular`. |
| `isTest` | boolean | No | Set this to true if this is a test account Example: `false`. |
| `taxPayerIdNumber` | string | No | United States Taxpayer ID number, usually your Employer Identification Number if you are a business or your
Social Security Number if you are an individual.
This value is required if the address provided is inside the US and if you subscribed to the Avalara Managed Returns or SST Certified Service Provider service. Otherwise it is optional. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `NewAccountModel` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |

### 200 Response: `NewAccountModel`

Represents information about a newly created account

| Property | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | No | This is the ID number of the account that was created Example: `123456789`. |
| `accountDetailsEmailedTo` | string | No | This is the email address to which credentials were mailed Example: `bob@example.org`. |
| `createdDate` | string | No | The date and time when this account was created Example: `0001-01-01T00:00:00`. |
| `emailedDate` | string | No | The date and time when account information was emailed to the user Example: `0001-01-01T00:00:00`. |
| `limitations` | string | No | If this account includes any limitations, specify them here |
| `licenseKey` | string | No | The license key of the account that was created |
| `paymentUrl` | string | No | The payment url where the payment method can be set up |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/accounts/request" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "offer": "DeveloperDotAvalaraFreeTrial",
  "connectorId": "a0n4000000ChMwPAAV",
  "campaign": "70140000000TsVb",
  "leadSource": "Direct Visitor",
  "accountName": "BizTech Company Inc.",
  "website": "https://biztech.com",
  "paymentMethodId": "701abc-def",
  "firstName": "Bob",
  "lastName": "Example",
  "email": "bob@example.org",
  "username": "bob",
  "welcomeEmail": "Normal",
  "companyAddress": {
    "line": "100 Ravine Ln",
    "region": "WA",
    "country": "US",
    "postalCode": "98010"
  },
  "acceptAvalaraTermsAndConditions": true,
  "haveReadAvalaraTermsAndConditions": true,
  "marketingContext": {
    "campaignId": "70140000000TsVb",
    "leadSource": "Direct Visitor"
  },
  "accountType": "Regular",
  "isTest": false
}'
```