Posting a New Company
This wiki includes steps with example for posting a new company to the database using WAPIC.
Warning - These steps will add a new company to the database. Use caution when testing this on a Live Database.
Data can be lost if not done properly.
Important Notes:1) The CustomerNumber must be unique.2) There must be one contact on when posting a new company.
This query can be used to determine the most recent CustomerNumber that was used in the database. Then increment that by 1:
https://localhost:5321/wapic/Companies?$orderby=CustomerNumber desc&$top=1
This code below is a Company with one contact in JSON format. This can be used as an example:
{
"Name": "Test Company",
"Division": "Test Division",
"Industry": "Entertainment",
"IsActive": true,
"IsCustomer": false,
"IsPrivate": false,
"IsVendor": false,
"Origin": "Referral",
"Region": null,
"URL": null,
"CustomerCreditBalance": 0,
"CustomerCreditLimit": 1,
"CustomerDiscountLevel": 0,
"CustomerHasCreditAccount": true,
"CustomerIsPORequired": false,
"CustomerIsTaxExempt": false,
"CustomerNumber": 12361,
"CustomerPricingLevel": 1,
"VendorCreditBalance": 0,
"VendorIs1099": false,
"Contacts": [
{
"DateModified": "2012-03-13T14:26:21",
"Birthday": "1899-12-30T00:00:00",
"Division": "Test Division",
"FirstName": "Steve",
"MiddleName": null,
"LastName": "Smith",
"Gender": null,
"IsActive": true,
"IsBilling": true,
"IsPrimary": true,
"Position": "Owner",
"Email": "steve.smith@noemail.com",
"CalendarActivities": null,
"Addresses": [],
"Phones": [],
"UDF": {
"UDFValues": [
{
"Name": "IsActive",
"Value": false
},
{
"Name": "How_Many_Referred_",
"Value": 0
}
],
"Id": "1001c3001",
"ETag": 0
},
"DisplayName": "Steve Smith",
"ETag": 0
}
],
"UDF": {
"UDFValues": [
{
"Name": "IsActive",
"Value": false
},
{
"Name": "___Size_of_Fleet",
"Value": 0
},
{
"Name": "Number_of_Employees",
"Value": 0
},
{
"Name": "Expected_Amount",
"Value": 0
},
{
"Name": "VIP_Customers",
"Value": "0"
},
{
"Name": "Current_Provider_Size_of_Fleet",
"Value": 0
},
{
"Name": "Invoice_Method",
"Value": "Email and Mail"
}
],
"ETag": 0
},
"ETag": 0
}
Contributor: SHendrix, Cyrious Software, Inc.
Updated: 2/12/2014
Version: Control 5.xx