To create a customer, use the following request:

POST /customers

Request JSON Objects

Valid JSON parameters include the following.

ParameterTypeRequiredDefinition

name 

stringYesCustomer name
street stringNoStreet 
zip_codestringNoZip code
city stringNoCity
state stringNoState/province
country stringNoCountry
phone_numberstringNoPhone number
fax_number stringNoFax Number
description stringNoDescription
Contacts arrayNoList of contacts
CustomTags arrayNoList 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 CodeDescription
200 OKCustomer created.

400 Bad Request

Invalid data.
403 ForbiddenInvalid 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"
		}
	]
}
  • No labels