POST v1/Customer/CustomerInsert

Adds a new customer

This is secure method and requires below attributes in header

Authorization: Midnight Authorize Token

Request Information

URI Parameters

None.

Body Parameters

CustomerInsertRequest
NameDescriptionTypeAdditional information
CustomerCode

Required. Must be unique and not already exist in Midnight.

string

Required

CustomerName

Required.

string

Required

AccountingCode

string

None.

Phone

Must be a numeric value and not be greater than ten digits.

integer

None.

PhoneExtension

string

None.

Fax

Must be a numeric value and not be greater than ten digits.

integer

None.

Email

Must be a valid email adddress.

string

None.

Website

string

None.

Terms

Must match a valid Midnight Terms name.

string

None.

Company

Must match a valid Midnight Company name.

string

None.

CustomerNotes

string

None.

CustomerType

Must match a valid Midnight Customer Type name.

string

None.

ParentCustomerCode

Must match a valid Midnight Customer Code.

string

None.

SalesRep

Must match a valid Midnight Sales Rep name.

string

None.

CSR

Must match a valid Midnight CSR name.

string

None.

PermitNumber

string

None.

AccountStatus

Must match a valid Midnight Account Status.

string

None.

Notification

boolean

None.

NotificationText

string

None.

Taxable

boolean

None.

TaxJurisdictionName

Must match a valid Midnight Tax Jurisdiction name.

string

None.

TaxExemptionName

Must match a valid Midnight Tax Exemption name.

string

None.

UDF1

string

None.

UDF2

string

None.

UDF3

string

None.

UDF4

string

None.

UDF5

string

None.

UDF6

string

None.

UDF7

string

None.

UDF8

string

None.

UDF9

string

None.

UDF10

string

None.

UDF11

string

None.

UDF12

string

None.

UDF13

string

None.

UDF14

string

None.

UDF15

string

None.

UDF16

string

None.

UDF17

string

None.

UDF18

string

None.

UDF19

string

None.

UDF20

string

None.

UDF21

string

None.

UDF22

string

None.

UDF23

string

None.

UDF24

string

None.

UDF25

string

None.

UDF26

string

None.

UDF27

string

None.

UDF28

string

None.

UDF29

string

None.

UDF30

string

None.

CustomerAddress

CustomerAddress

None.

ShippingAddress

ShippingAddress

None.

BillingAddress

BillingAddress

None.

PostageMarkupType

PostageMarkupType

string

None.

PostageMarkupValue

PostageMarkupValue

decimal number

None.

UnpaidBalanceLimit

UnpaidBalanceLimit

decimal number

None.

Request Formats

application/json, text/json

Sample:
{
  "CustomerCode": "sample string 1",
  "CustomerName": "sample string 2",
  "AccountingCode": "sample string 3",
  "Phone": 1,
  "PhoneExtension": "sample string 4",
  "Fax": 1,
  "Email": "sample string 5",
  "Website": "sample string 6",
  "Terms": "sample string 7",
  "Company": "sample string 8",
  "CustomerNotes": "sample string 9",
  "CustomerType": "sample string 10",
  "ParentCustomerCode": "sample string 11",
  "SalesRep": "sample string 12",
  "CSR": "sample string 13",
  "PermitNumber": "sample string 14",
  "AccountStatus": "sample string 15",
  "Notification": true,
  "NotificationText": "sample string 16",
  "Taxable": true,
  "TaxJurisdictionName": "sample string 17",
  "TaxExemptionName": "sample string 18",
  "UDF1": "sample string 19",
  "UDF2": "sample string 20",
  "UDF3": "sample string 21",
  "UDF4": "sample string 22",
  "UDF5": "sample string 23",
  "UDF6": "sample string 24",
  "UDF7": "sample string 25",
  "UDF8": "sample string 26",
  "UDF9": "sample string 27",
  "UDF10": "sample string 28",
  "UDF11": "sample string 29",
  "UDF12": "sample string 30",
  "UDF13": "sample string 31",
  "UDF14": "sample string 32",
  "UDF15": "sample string 33",
  "UDF16": "sample string 34",
  "UDF17": "sample string 35",
  "UDF18": "sample string 36",
  "UDF19": "sample string 37",
  "UDF20": "sample string 38",
  "UDF21": "sample string 39",
  "UDF22": "sample string 40",
  "UDF23": "sample string 41",
  "UDF24": "sample string 42",
  "UDF25": "sample string 43",
  "UDF26": "sample string 44",
  "UDF27": "sample string 45",
  "UDF28": "sample string 46",
  "UDF29": "sample string 47",
  "UDF30": "sample string 48",
  "CustomerAddress": {
    "CustomerAddressLine1": "sample string 1",
    "CustomerAddressLine2": "sample string 2",
    "CustomerAddressLine3": "sample string 3",
    "CustomerAddressCity": "sample string 4",
    "CustomerAddressState": "sample string 5",
    "CustomerAddressZip": "sample string 6",
    "CustomerAddressCountry": "sample string 7"
  },
  "ShippingAddress": {
    "ShippingAddressName": "sample string 1",
    "ShippingAddressLine1": "sample string 2",
    "ShippingAddressLine2": "sample string 3",
    "ShippingAddressLine3": "sample string 4",
    "ShippingAddressCity": "sample string 5",
    "ShippingAddressState": "sample string 6",
    "ShippingAddressZip": "sample string 7",
    "ShippingAddressCountry": "sample string 8",
    "ShippingMethod": "sample string 9"
  },
  "BillingAddress": {
    "BillingAddressName": "sample string 1",
    "BillingAddressLine1": "sample string 2",
    "BillingAddressLine2": "sample string 3",
    "BillingAddressLine3": "sample string 4",
    "BillingAddressCity": "sample string 5",
    "BillingAddressState": "sample string 6",
    "BillingAddressZip": "sample string 7",
    "BillingAddressCountry": "sample string 8"
  },
  "PostageMarkupType": "sample string 50",
  "PostageMarkupValue": 51.0,
  "UnpaidBalanceLimit": 1.0
}

application/xml, text/xml

Sample:
<CustomerInsertRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CustomerCode>sample string 1</CustomerCode>
  <CustomerName>sample string 2</CustomerName>
  <AccountingCode>sample string 3</AccountingCode>
  <Phone>1</Phone>
  <PhoneExtension>sample string 4</PhoneExtension>
  <Fax>1</Fax>
  <Email>sample string 5</Email>
  <Website>sample string 6</Website>
  <Terms>sample string 7</Terms>
  <Company>sample string 8</Company>
  <CustomerNotes>sample string 9</CustomerNotes>
  <CustomerType>sample string 10</CustomerType>
  <ParentCustomerCode>sample string 11</ParentCustomerCode>
  <SalesRep>sample string 12</SalesRep>
  <CSR>sample string 13</CSR>
  <PermitNumber>sample string 14</PermitNumber>
  <AccountStatus>sample string 15</AccountStatus>
  <Notification>true</Notification>
  <NotificationText>sample string 16</NotificationText>
  <Taxable>true</Taxable>
  <TaxJurisdictionName>sample string 17</TaxJurisdictionName>
  <TaxExemptionName>sample string 18</TaxExemptionName>
  <UDF1>sample string 19</UDF1>
  <UDF2>sample string 20</UDF2>
  <UDF3>sample string 21</UDF3>
  <UDF4>sample string 22</UDF4>
  <UDF5>sample string 23</UDF5>
  <UDF6>sample string 24</UDF6>
  <UDF7>sample string 25</UDF7>
  <UDF8>sample string 26</UDF8>
  <UDF9>sample string 27</UDF9>
  <UDF10>sample string 28</UDF10>
  <UDF11>sample string 29</UDF11>
  <UDF12>sample string 30</UDF12>
  <UDF13>sample string 31</UDF13>
  <UDF14>sample string 32</UDF14>
  <UDF15>sample string 33</UDF15>
  <UDF16>sample string 34</UDF16>
  <UDF17>sample string 35</UDF17>
  <UDF18>sample string 36</UDF18>
  <UDF19>sample string 37</UDF19>
  <UDF20>sample string 38</UDF20>
  <UDF21>sample string 39</UDF21>
  <UDF22>sample string 40</UDF22>
  <UDF23>sample string 41</UDF23>
  <UDF24>sample string 42</UDF24>
  <UDF25>sample string 43</UDF25>
  <UDF26>sample string 44</UDF26>
  <UDF27>sample string 45</UDF27>
  <UDF28>sample string 46</UDF28>
  <UDF29>sample string 47</UDF29>
  <UDF30>sample string 48</UDF30>
  <CustomerAddress>
    <CustomerAddressLine1>sample string 1</CustomerAddressLine1>
    <CustomerAddressLine2>sample string 2</CustomerAddressLine2>
    <CustomerAddressLine3>sample string 3</CustomerAddressLine3>
    <CustomerAddressCity>sample string 4</CustomerAddressCity>
    <CustomerAddressState>sample string 5</CustomerAddressState>
    <CustomerAddressZip>sample string 6</CustomerAddressZip>
    <CustomerAddressCountry>sample string 7</CustomerAddressCountry>
  </CustomerAddress>
  <ShippingAddress>
    <ShippingAddressName>sample string 1</ShippingAddressName>
    <ShippingAddressLine1>sample string 2</ShippingAddressLine1>
    <ShippingAddressLine2>sample string 3</ShippingAddressLine2>
    <ShippingAddressLine3>sample string 4</ShippingAddressLine3>
    <ShippingAddressCity>sample string 5</ShippingAddressCity>
    <ShippingAddressState>sample string 6</ShippingAddressState>
    <ShippingAddressZip>sample string 7</ShippingAddressZip>
    <ShippingAddressCountry>sample string 8</ShippingAddressCountry>
    <ShippingMethod>sample string 9</ShippingMethod>
  </ShippingAddress>
  <BillingAddress>
    <BillingAddressName>sample string 1</BillingAddressName>
    <BillingAddressLine1>sample string 2</BillingAddressLine1>
    <BillingAddressLine2>sample string 3</BillingAddressLine2>
    <BillingAddressLine3>sample string 4</BillingAddressLine3>
    <BillingAddressCity>sample string 5</BillingAddressCity>
    <BillingAddressState>sample string 6</BillingAddressState>
    <BillingAddressZip>sample string 7</BillingAddressZip>
    <BillingAddressCountry>sample string 8</BillingAddressCountry>
  </BillingAddress>
  <AddressList>
    <Address>
      <AddressId>1</AddressId>
      <Attention>sample string 2</Attention>
      <StreetAddress>sample string 3</StreetAddress>
      <Address1>sample string 4</Address1>
      <Address2>sample string 5</Address2>
      <Address3>sample string 6</Address3>
      <City>sample string 7</City>
      <State>sample string 8</State>
      <CountryCode>sample string 9</CountryCode>
      <ZipCode>sample string 10</ZipCode>
      <Region>sample string 11</Region>
      <Active>true</Active>
      <Primary>true</Primary>
      <StateId>14</StateId>
      <AddressTypeId>15</AddressTypeId>
      <OwnerId>16</OwnerId>
      <Country>sample string 17</Country>
      <StateCode>sample string 18</StateCode>
      <Owner>sample string 19</Owner>
      <Company>sample string 20</Company>
      <Remove>true</Remove>
    </Address>
    <Address>
      <AddressId>1</AddressId>
      <Attention>sample string 2</Attention>
      <StreetAddress>sample string 3</StreetAddress>
      <Address1>sample string 4</Address1>
      <Address2>sample string 5</Address2>
      <Address3>sample string 6</Address3>
      <City>sample string 7</City>
      <State>sample string 8</State>
      <CountryCode>sample string 9</CountryCode>
      <ZipCode>sample string 10</ZipCode>
      <Region>sample string 11</Region>
      <Active>true</Active>
      <Primary>true</Primary>
      <StateId>14</StateId>
      <AddressTypeId>15</AddressTypeId>
      <OwnerId>16</OwnerId>
      <Country>sample string 17</Country>
      <StateCode>sample string 18</StateCode>
      <Owner>sample string 19</Owner>
      <Company>sample string 20</Company>
      <Remove>true</Remove>
    </Address>
  </AddressList>
  <PhoneList>
    <Phone>
      <PhoneId>1</PhoneId>
      <PhoneNumber>sample string 2</PhoneNumber>
      <Extension>sample string 3</Extension>
      <PhoneTypeId>4</PhoneTypeId>
      <Active>true</Active>
      <Primary>true</Primary>
      <OwnerId>7</OwnerId>
      <Owner>sample string 8</Owner>
      <Remove>true</Remove>
    </Phone>
    <Phone>
      <PhoneId>1</PhoneId>
      <PhoneNumber>sample string 2</PhoneNumber>
      <Extension>sample string 3</Extension>
      <PhoneTypeId>4</PhoneTypeId>
      <Active>true</Active>
      <Primary>true</Primary>
      <OwnerId>7</OwnerId>
      <Owner>sample string 8</Owner>
      <Remove>true</Remove>
    </Phone>
  </PhoneList>
  <EmailList>
    <EmailAddress>
      <AddressId>1</AddressId>
      <Address>sample string 2</Address>
      <EmailAddressTypeId>3</EmailAddressTypeId>
      <Active>true</Active>
      <Primary>true</Primary>
      <OwnerId>6</OwnerId>
      <Owner>sample string 7</Owner>
      <Remove>true</Remove>
    </EmailAddress>
    <EmailAddress>
      <AddressId>1</AddressId>
      <Address>sample string 2</Address>
      <EmailAddressTypeId>3</EmailAddressTypeId>
      <Active>true</Active>
      <Primary>true</Primary>
      <OwnerId>6</OwnerId>
      <Owner>sample string 7</Owner>
      <Remove>true</Remove>
    </EmailAddress>
  </EmailList>
  <CommentList>
    <Comment>
      <CommentId>1</CommentId>
      <Description>sample string 2</Description>
      <Comments>sample string 3</Comments>
      <ObjectId>4</ObjectId>
      <DynamicId>5</DynamicId>
      <ObjectTable>sample string 6</ObjectTable>
      <CommentType>Other</CommentType>
      <Remove>true</Remove>
    </Comment>
    <Comment>
      <CommentId>1</CommentId>
      <Description>sample string 2</Description>
      <Comments>sample string 3</Comments>
      <ObjectId>4</ObjectId>
      <DynamicId>5</DynamicId>
      <ObjectTable>sample string 6</ObjectTable>
      <CommentType>Other</CommentType>
      <Remove>true</Remove>
    </Comment>
  </CommentList>
  <UDFList>
    <UDFKeyValueProvider>
      <key>sample string 1</key>
      <value>sample string 2</value>
    </UDFKeyValueProvider>
    <UDFKeyValueProvider>
      <key>sample string 1</key>
      <value>sample string 2</value>
    </UDFKeyValueProvider>
  </UDFList>
  <MODProviderID>sample string 49</MODProviderID>
  <PostageMarkupType>sample string 50</PostageMarkupType>
  <PostageMarkupValue>51</PostageMarkupValue>
  <UnpaidBalanceLimit>1</UnpaidBalanceLimit>
</CustomerInsertRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'CustomerInsertRequest'.

Response Information

Response Formats

application/json, text/json

Sample:
{
  "CustomerID": 1
}

application/xml, text/xml

Sample:
<CustomerInsertResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CustomerID>1</CustomerID>
</CustomerInsertResponse>