To create a customer, use the following request:
POST /customers
Request JSON Objects
Valid JSON parameters include the following.
| Parameter | Type | Required | Definition |
|---|---|---|---|
name | string | Yes | Customer name |
| street | string | No | Street |
| zip_code | string | No | Zip code |
| city | string | No | City |
| state | string | No | State/province |
| country | string | No | Country |
| phone_number | string | No | Phone number |
| fax_number | string | No | Fax Number |
| description | string | No | Description |
| Contacts | array | No | List of contacts |
| CustomTags | array | No | List of custom tags |
Example request
POST /customers HTTP/1.1
Content-Type: application/json
Authorization: Bearer f794846b7c26621688e1e06164975b4eae8ce2f6
{
"name": "Rivers Inc",
"description": "desc",
"phone_number": "779.790.4969x1425",
"fax_number": "(536)600-8229",
"street": "008 Santiago Groves Suite 651",
"city": "Shortport",
"country": "USA",
"zip_code": "62448",
"state": "South Carolina",
"Contacts": [
{
"name": "James Taylor",
"email": "nfisher@test.x-formation.com"
},
{
"name": "Victor Martinez",
"email": "ngallagher@test.x-formation.com"
}
],
"CustomTags": [
{
"tag_name": "custom_tag_1",
"value": "Gouldton"
},
{
"tag_name": "custom_tag_2",
"value": "Idaho"
}
]
}
Response
The LAC REST API returns the standard HTTP response codes described in the following table.
| Status Code | Description |
|---|---|
| 200 OK | Customer created. |
| Invalid data. | |
| 403 Forbidden | Invalid or expired token provided. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "1",
"name": "Rivers Inc",
"description": "desc",
"phone_number": "779.790.4969x1425",
"fax_number": "(536)600-8229",
"street": "008 Santiago Groves Suite 651",
"city": "Shortport",
"country": "USA",
"zip_code": "62448",
"state": "South Carolina",
"creation_time": "2019-08-14 10:57:03",
"update_time": "2019-08-14 10:57:03",
"Contacts": [
{
"id": "1",
"name": "James Taylor",
"email": "nfisher@test.x-formation.com",
"customer_id": "1",
"creation_time": "2019-08-14 10:57:03",
"update_time": "2019-08-14 10:57:03"
},
{
"id": "2",
"name": "Victor Martinez",
"email": "ngallagher@test.x-formation.com",
"customer_id": "1",
"creation_time": "2019-08-14 10:57:03",
"update_time": "2019-08-14 10:57:03"
}
],
"CustomTags": [
{
"tag_name": "custom_tag_1",
"value": "Gouldton",
"creation_time": "2019-08-14 10:57:03",
"update_time": "2019-08-14 10:57:03"
},
{
"tag_name": "custom_tag_2",
"value": "Idaho",
"creation_time": "2019-08-14 10:57:03",
"update_time": "2019-08-14 10:57:03"
}
]
}