POST v1/Customer/CustomerInsert

Adds a new customer

This is secure method and requires below attributes in header

Authorization: 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:i="http://www.w3.org/2001/XMLSchema-instance">
  <AccountStatus>sample string 15</AccountStatus>
  <AccountingCode>sample string 3</AccountingCode>
  <BillingAddress>
    <BillingAddressCity>sample string 5</BillingAddressCity>
    <BillingAddressCountry>sample string 8</BillingAddressCountry>
    <BillingAddressLine1>sample string 2</BillingAddressLine1>
    <BillingAddressLine2>sample string 3</BillingAddressLine2>
    <BillingAddressLine3>sample string 4</BillingAddressLine3>
    <BillingAddressName>sample string 1</BillingAddressName>
    <BillingAddressState>sample string 6</BillingAddressState>
    <BillingAddressZip>sample string 7</BillingAddressZip>
  </BillingAddress>
  <CSR>sample string 13</CSR>
  <Company>sample string 8</Company>
  <CustomerAddress>
    <CustomerAddressCity>sample string 4</CustomerAddressCity>
    <CustomerAddressCountry>sample string 7</CustomerAddressCountry>
    <CustomerAddressLine1>sample string 1</CustomerAddressLine1>
    <CustomerAddressLine2>sample string 2</CustomerAddressLine2>
    <CustomerAddressLine3>sample string 3</CustomerAddressLine3>
    <CustomerAddressState>sample string 5</CustomerAddressState>
    <CustomerAddressZip>sample string 6</CustomerAddressZip>
  </CustomerAddress>
  <CustomerCode>sample string 1</CustomerCode>
  <CustomerName>sample string 2</CustomerName>
  <CustomerNotes>sample string 9</CustomerNotes>
  <CustomerType>sample string 10</CustomerType>
  <Email>sample string 5</Email>
  <Fax>1</Fax>
  <Notification>true</Notification>
  <NotificationText>sample string 16</NotificationText>
  <ParentCustomerCode>sample string 11</ParentCustomerCode>
  <PermitNumber>sample string 14</PermitNumber>
  <Phone>1</Phone>
  <PhoneExtension>sample string 4</PhoneExtension>
  <PostageMarkupType>sample string 50</PostageMarkupType>
  <PostageMarkupValue>51</PostageMarkupValue>
  <SalesRep>sample string 12</SalesRep>
  <ShippingAddress>
    <ShippingAddressCity>sample string 5</ShippingAddressCity>
    <ShippingAddressCountry>sample string 8</ShippingAddressCountry>
    <ShippingAddressLine1>sample string 2</ShippingAddressLine1>
    <ShippingAddressLine2>sample string 3</ShippingAddressLine2>
    <ShippingAddressLine3>sample string 4</ShippingAddressLine3>
    <ShippingAddressName>sample string 1</ShippingAddressName>
    <ShippingAddressState>sample string 6</ShippingAddressState>
    <ShippingAddressZip>sample string 7</ShippingAddressZip>
    <ShippingMethod>sample string 9</ShippingMethod>
  </ShippingAddress>
  <TaxExemptionName>sample string 18</TaxExemptionName>
  <TaxJurisdictionName>sample string 17</TaxJurisdictionName>
  <Taxable>true</Taxable>
  <Terms>sample string 7</Terms>
  <UDF1>sample string 19</UDF1>
  <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>
  <UDF2>sample string 20</UDF2>
  <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>
  <UDF3>sample string 21</UDF3>
  <UDF30>sample string 48</UDF30>
  <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>
  <UnpaidBalanceLimit>1</UnpaidBalanceLimit>
  <Website>sample string 6</Website>
</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:i="http://www.w3.org/2001/XMLSchema-instance">
  <CustomerID>1</CustomerID>
</CustomerInsertResponse>