# Create_Customer

Upsert a customer.

`PUT /v2/customers`

**API:** Avalara CertCapture RESTful APIs
**Tag:** Customers
**API Version:** v2
**Base URL:** https://sbx-api.certcapture.com/v2/
**Content-Type:** `application/x-www-form-urlencoded`
**Accepts:** `application/json`
**Authentication:** Basic (username + license key) or API Key (`Authorization` in header)

Source: https://developer.avalara.com/products/ecm/api/certcapture/methods/Customers/Create_Customer/

## Description

Rather than checking to see if a customer record exists before creating, you can make an upsert call instead.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `x-client-id` | integer | header | Yes | To access a client ID, it is available from Company Settings -> Company Details -> Company ID |
| `customer_number` | string | formData | No | The customer number is a unique number, per company, for a customer. |
| `alternate_id` | string | formData | No | An alternate id for a customer. |
| `name` | string | formData | No | The name of the Customer. |
| `attn_name` | string | formData | No | An optional attention name field for your customer. |
| `address_line1` | string | formData | No | The first line of the customers address. |
| `address_line2` | string | formData | No | The second line of the customers address. |
| `city` | string | formData | No | The city field of the customers address. |
| `zip` | string | formData | No | The zip field of the customers address. |
| `phone_number` | string | formData | No | The phone number for the customer. |
| `fax_number` | string | formData | No | The fax number for the customer. |
| `email_address` | string | formData | No | The email_address of the customer. |
| `contact_name` | string | formData | No | The contact name of the customer. |
| `state` | array | formData | No | The state where the customer resides. |
| `country` | array | formData | No | The country where the customer resides. |

## Responses

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

### 200 Response: `CustomerResponse`

Customer Response Model

| Property | Type | Required | Description |
|---|---|---|---|
| `address_line1` | string | No | The first line of the customers address. Example: `123 Mocking Bird Lane`. |
| `address_line2` | string | No | The second line of the customers address. Example: `Apt 2B`. |
| `alternate_id` | string | No | An alternate id for a customer. Example: `WA-00012`. |
| `attn_name` | string | No | An optional attention name field for your customer. Example: `Nick Diaz`. |
| `city` | string | No | The city field of the customers address. Example: `Seattle`. |
| `client_id` | integer | No | The system generated company id. Example: `10327`. |
| `contact_name` | string | No | The contact name of the customer. Example: `Bob Fetherman`. |
| `country` | Country | No |  |
| `created` | string | No | DateTime of when the record was created. Example: `2017-10-26 12:41:48.377959`. |
| `customer_number` | string | No | The customer number is a unique number, per company, for a customer. Example: `CC000012302`. |
| `email_address` | string | No | The email_address of the customer. Example: `customers@email.com`. |
| `fax_number` | string | No | The fax number for the customer. Example: `800-555-5555`. |
| `fein_number` | string | No | The customers fein number. Example: `012345678`. |
| `id` | integer | No | System Generated Customer id Example: `1`. |
| `is_bill` | boolean | No | Designates if the customer is a bill to customer or not. Example: `false`. |
| `is_ship` | boolean | No | Designates if the customer is a ship to customer or not. Example: `true`. |
| `is_vendor` | boolean | No | States whether or not the customer record is a vendor record. Example: `false`. |
| `last_transaction` | string | No | An optional field for adding the date of your last transaction with this customer.  This is NOT tied to AvaTax. Example: `2020-12-12`. |
| `location_id` | integer | No | The location id of the customer.  Only generated when customer is created via Retail, with a location setup. Example: `1`. |
| `modified` | string | No | DateTime of when the record was modified. Example: `2017-10-26 12:41:48.377959`. |
| `name` | string | No | The name of the Customer. Example: `Bobs House of Fondue`. |
| `phone_number` | string | No | The phone number for the customer. Example: `800-555-5555`. |
| `state` | State | No |  |
| `welcome_letter_status` | string | No | The status on the Welcome Letter (option not enabled by default.) Example: `C`. |
| `zip` | string | No | The zip field of the customers address. Example: `98104`. |

## Example Request

```bash
curl -X PUT "https://sbx-api.certcapture.com/v2/v2/customers" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Accept: application/json"
```