POST api/customer
To save customer in system against company, if mobile number is provided with any already existing customer it will return the Id of already added customer
Request Information
URI Parameters
None.
Body Parameters
CustomerDto| Name | Description | Type | Additional information |
|---|---|---|---|
| CustomerID |
Primary Key |
integer |
None. |
| FullName |
Full name of customer |
string |
None. |
| EmpCode |
Employee code of customer if any restaurant offers any discount to any company |
string |
None. |
|
Email address of customer it can be null |
string |
None. |
|
| CarDetails |
Detail of customer car, can be null |
string |
None. |
| Country |
Country Name |
string |
None. |
| City |
City Name |
string |
None. |
| Area |
Area name in city |
string |
None. |
| Address |
Full Address detail of customer |
string |
Max length: 400 |
| ZipCode |
Zip code of the area |
string |
None. |
| DOB |
Date of Birth with mentioned format : 2020-06-25 |
string |
Matching regular expression pattern: ^\d{4}-\d{2}-\d{2}$ |
| Gender |
Gender Male or Female |
string |
None. |
| TelePhone |
Any Landline contact number |
string |
None. |
| Mobile |
Mobile phone contact number |
string |
Required Matching regular expression pattern: ^[+]\d{10,15}$ |
| Notes |
Any notes related to customer |
string |
None. |
| AddedAt | string |
Matching regular expression pattern: ^\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}$ |
|
| VatID | string |
None. |
|
| SyncStatus | RStatus |
None. |
|
| StatusID | DStatus |
None. |
|
| NationalID | string |
Matching regular expression pattern: (^$)|(^[0-9]{10}$) |
Request Formats
application/json
{
"FullName": "Muhammad Saad Khan",
"EmpCode": "EP-003",
"Country": "Saudi Arabia",
"City": "Riyadh",
"Area": "Al Salam",
"Address": "Az Zubair bin Awaz Street",
"ZipCode": "14213",
"DOB": "1989-08-31-00-00-00",
"Gender": "Male",
"Mobile": "+966594150299",
"Notes": "This is the note for instruction"
}
text/json
{
"CustomerID": 1,
"FullName": "sample string 2",
"EmpCode": "sample string 3",
"Email": "sample string 4",
"CarDetails": "sample string 5",
"Country": "sample string 6",
"City": "sample string 7",
"Area": "sample string 8",
"Address": "sample string 9",
"ZipCode": "sample string 10",
"DOB": "sample string 11",
"Gender": "sample string 12",
"TelePhone": "sample string 13",
"Mobile": "sample string 14",
"Notes": "sample string 15",
"AddedAt": "sample string 16",
"VatID": "sample string 17",
"SyncStatus": 1,
"StatusID": 1,
"NationalID": "sample string 18"
}
text/xml
<CustomerDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BusinessEntities.Order"> <AddedAt>sample string 16</AddedAt> <Address>sample string 9</Address> <Area>sample string 8</Area> <CarDetails>sample string 5</CarDetails> <City>sample string 7</City> <Country>sample string 6</Country> <CustomerID>1</CustomerID> <DOB>sample string 11</DOB> <Email>sample string 4</Email> <EmpCode>sample string 3</EmpCode> <FullName>sample string 2</FullName> <Gender>sample string 12</Gender> <Mobile>sample string 14</Mobile> <NationalID>sample string 18</NationalID> <Notes>sample string 15</Notes> <StatusID>Active</StatusID> <SyncStatus>Success</SyncStatus> <TelePhone>sample string 13</TelePhone> <VatID>sample string 17</VatID> <ZipCode>sample string 10</ZipCode> </CustomerDto>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
CustomerResponse| Name | Description | Type | Additional information |
|---|---|---|---|
| Customer | CustomerDto |
None. |
|
| Status |
Status for response |
RStatus |
None. |
| Desc |
description of response |
string |
None. |
Response Formats
application/json
{
"Status": 1,
"Desc": "Success",
"Customer": {
"CustomerID": 5,
"FullName": "Muhammad Saad Khan",
"EmpCode": "EP-003",
"Email": null,
"CarDetails": null,
"Country": "Saudi Arabia",
"City": "Riyadh",
"Area": "Al Salam",
"Address": "Az Zubair bin Awaz Street",
"ZipCode": "14213",
"DOB": "1989-08-31-00-00-00",
"Gender": "Male",
"TelePhone": null,
"Mobile": "+966594150299",
"Notes": "This is the note for instruction"
}
}
text/json
{
"Status": 1,
"Desc": "sample string 1",
"Customer": {
"CustomerID": 1,
"FullName": "sample string 2",
"EmpCode": "sample string 3",
"Email": "sample string 4",
"CarDetails": "sample string 5",
"Country": "sample string 6",
"City": "sample string 7",
"Area": "sample string 8",
"Address": "sample string 9",
"ZipCode": "sample string 10",
"DOB": "sample string 11",
"Gender": "sample string 12",
"TelePhone": "sample string 13",
"Mobile": "sample string 14",
"Notes": "sample string 15",
"AddedAt": "sample string 16",
"VatID": "sample string 17",
"SyncStatus": 1,
"StatusID": 1,
"NationalID": "sample string 18"
}
}
text/xml
<CustomerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BusinessEntities.Response">
<Desc>sample string 1</Desc>
<Status>Success</Status>
<Customer xmlns:d2p1="http://schemas.datacontract.org/2004/07/BusinessEntities.Order">
<d2p1:AddedAt>sample string 16</d2p1:AddedAt>
<d2p1:Address>sample string 9</d2p1:Address>
<d2p1:Area>sample string 8</d2p1:Area>
<d2p1:CarDetails>sample string 5</d2p1:CarDetails>
<d2p1:City>sample string 7</d2p1:City>
<d2p1:Country>sample string 6</d2p1:Country>
<d2p1:CustomerID>1</d2p1:CustomerID>
<d2p1:DOB>sample string 11</d2p1:DOB>
<d2p1:Email>sample string 4</d2p1:Email>
<d2p1:EmpCode>sample string 3</d2p1:EmpCode>
<d2p1:FullName>sample string 2</d2p1:FullName>
<d2p1:Gender>sample string 12</d2p1:Gender>
<d2p1:Mobile>sample string 14</d2p1:Mobile>
<d2p1:NationalID>sample string 18</d2p1:NationalID>
<d2p1:Notes>sample string 15</d2p1:Notes>
<d2p1:StatusID>Active</d2p1:StatusID>
<d2p1:SyncStatus>Success</d2p1:SyncStatus>
<d2p1:TelePhone>sample string 13</d2p1:TelePhone>
<d2p1:VatID>sample string 17</d2p1:VatID>
<d2p1:ZipCode>sample string 10</d2p1:ZipCode>
</Customer>
</CustomerResponse>