Function


The Customer Add API is used to add a new customer to the system.



URL


{Root URL}/API/Customer/Add/{API Key}



Parameters



ParameterDescriptionRequiredComment
1CustnoCustomer numberNMust be unique.
2CustnameCustomer nameY 
3StatusAccount statusYCan be: active, inactive, or quote.   (please note the text must be camel-cased)
4PhoneCustomer’s phone numberN 
5FaxCustomer’s faxN 
6TerritoryThe customer’s territoryNCan be: "SOUTHERN CA," "NORTHERN CA," "EAST," "WEST," "MIDWEST," "NEW ENGLAND," "SOUTH," "GREAT LAKES," "MEXICO," "CANADA," or "UNITED KINGDOM."
7TermsThe customer’s sales termsNCan be: "NET 10," "NET 15," "NET 30," "NET 30/2% 10," "NET 45," "COD," or "NONE."
8CredlimitCredit limitNThis is the customer’s credit limit. Must be Greater than or equal to "0."
9CreditokCredit statusNCan be: "OK," "HOLD," "REJECT."
10Ar_highBalAccounts receivable balanceNMust be greater than or equal to "0."
11Acct_dateDate the account was createdNUse the following date format: MM/DD/YYYY.
12SaledsctidSales discount IdN 
13AcctaxableAccount taxableN 



Example Strings


Add New Customer


URL


?CustName=CustomerName&Status=Active'


 

JSON


{

 "Custname": "CustomerName",

 "Status": "Active"

}



A successful add should result in the following:


{

"$id": "1",

"Code": "200",

"Message": "Customer added successfully.",

"SessionId": "null",

"IsValidUser": "true",

"ResponseObject": {

"$id": "2",

"CUSTNO": "0000000010",

"CUSTNAME": "CustomerName",

"PHONE": "",

"FAX": "",

"BLINKADD": "",

"SLINKADD": "",

"TERRITORY": "",

"TERMS": "",

"CREDLIMIT": "0",

"PROFILE": "",

"CUSTNOTE": "",

"ACCTSTATUS": "",

"DIVISION": "",

"SREPS": "",

"CREDITOK": "",

"RESL_NO": "",

"AR_CALDATE": "null",

"AR_CALTIME": "",

"AR_CALBY": "",

"AR_CALNOTE": "",

"AR_HIGHBAL": "0",

"CREDITNOTE": "",

"ACCT_DATE": "2014-11-19T10:09:57.041868-05:00",

"SAVEINIT": "",

"OUT_MARGIN": "0",

"TL_MARGIN": "0",

"MAT_MARGIN": "0",

"LAB_MARGIN": "0",

"MIN_ORDAMT": "0",

"SCRAP_FACT": "0",

"COMMITEM": "0",

"CUSTSPEC": "0",

"LABOR": "false",

"MATERIAL": "false",

"SPLIT1": "0",

"SPLIT2": "0",

"SPLITAMT": "0",

"SPLITPERC": "0",

"TOOLING": "false",

"SIC_CODE": "",

"SIC_DESC": "",

"DELIVTIME": "",

"STATUS": "Active",

"SERIFLAG": "false",

"OVERHEAD": "0",

"IS_EDITED": "",

"SALEDSCTID": "",

"CUSTPFX": "",

"ACTTAXABLE": "false",

"INACTDT": "null",

"INACTINIT": "",

"modifiedDate": "null",

"UserId": "null",

"LinkAddList": "null"

}

}



Common Errors


URL Error


If there is an error with the entered URL, the system will return an HTTP error:


{

"$id": "1",

"Message": "No HTTP resource was found that matches the request URI 'http://localhost/api/CustomerAdd/123456789'.",

"MessageDetail": "No type was found that matches the controller named 'CustomerAdd'."

}




Parameter Error


If a required parameter is missing or the entered value is incorrect, the system will return an object reference error message:


{

"$id": "1",

"Code": "403",

"Message": "Customer add failed.Object reference not set to an instance of an object.",

"SessionId": "null",

"IsValidUser": "true",

"ResponseObject": "null"

}




API Key Error


If there is a problem with the used API key, the system will return an error describing it:

 

{

"$id": "1",

"Code": "403",

"Message": "Invalid API Key.",

"SessionId": "null",

"IsValidUser": "false",

"ResponseObject": "null"

}