POST api/Supplier

Adds an supplier

Request Information

URI Parameters

None.

Body Parameters

SupplierPostRequest
NameDescriptionTypeAdditional information
Name

Name of the supplier

string

Max length: 50

CSID

Compilator supplier id

integer

None.

SupplierNumber

Supplier number

integer

None.

SupplierCategoryId1

Category 1 for supplier

globally unique identifier

None.

SupplierCategoryId2

Category 2 for supplier

globally unique identifier

None.

Phone

Phone number to the supplier

string

Max length: 50

Mobile

Mobile number to the supplier

string

Max length: 50

OrganisationNumber

Organisation number to the supplier

string

Max length: 30

Town

Town

string

Max length: 50

SearchCode

Search code for supplier

string

Max length: 10

Email

Email to supplier

string

Max length: 50

Fax

Fax number to the supplier

string

Max length: 50

Address1

Address

string

Max length: 100

Address2

Additional address line

string

Max length: 100

Address3

Additional address line

string

Max length: 100

PostalCode

Postal code

string

Max length: 10

CountryId

Id for the country
Use api/countries to get all countries

string

Max length: 2

Url

Url

string

Max length: 100

VatRegistrationNumber

VAT identification number

string

Max length: 50

Remarks

None.

Example

None.

Request Formats

application/json, text/json

Sample:
{
  "Name": "sample string 1",
  "CSID": 1,
  "SupplierNumber": 1,
  "SupplierCategoryId1": "e8067ff5-4dbf-4621-8082-2711143274a9",
  "SupplierCategoryId2": "25fd7bbe-a3bd-4156-afa3-2dce7ed2705e",
  "Phone": "sample string 2",
  "Mobile": "sample string 3",
  "OrganisationNumber": "sample string 4",
  "Town": "sample string 5",
  "SearchCode": "sample string 6",
  "Email": "sample string 7",
  "Fax": "sample string 8",
  "Address1": "sample string 9",
  "Address2": "sample string 10",
  "Address3": "sample string 11",
  "PostalCode": "sample string 12",
  "CountryId": "sample string 13",
  "Url": "sample string 14",
  "VatRegistrationNumber": "sample string 15"
}

application/xml, text/xml

Sample:
<SupplierPostRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Supplier">
  <Address1>sample string 9</Address1>
  <Address2>sample string 10</Address2>
  <Address3>sample string 11</Address3>
  <CSID>1</CSID>
  <CountryId>sample string 13</CountryId>
  <Email>sample string 7</Email>
  <Fax>sample string 8</Fax>
  <Mobile>sample string 3</Mobile>
  <Name>sample string 1</Name>
  <OrganisationNumber>sample string 4</OrganisationNumber>
  <Phone>sample string 2</Phone>
  <PostalCode>sample string 12</PostalCode>
  <SearchCode>sample string 6</SearchCode>
  <SupplierCategoryId1>e8067ff5-4dbf-4621-8082-2711143274a9</SupplierCategoryId1>
  <SupplierCategoryId2>25fd7bbe-a3bd-4156-afa3-2dce7ed2705e</SupplierCategoryId2>
  <SupplierNumber>1</SupplierNumber>
  <Town>sample string 5</Town>
  <Url>sample string 14</Url>
  <VatRegistrationNumber>sample string 15</VatRegistrationNumber>
</SupplierPostRequest>

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 'SupplierPostRequest'.

Response Information

Resource Description

SupplierPostResponse
NameDescriptionTypeAdditional information
Errors

List of errors when adding supplier

Collection of PostSupplierError

None.

Success

Returns true if supplier is added

boolean

None.

Id

Id of the created supplier

globally unique identifier

None.

Response Formats

application/json, text/json

Sample:
{
  "Errors": [
    {
      "ErrorCode": 1,
      "ErrorMessage": "sample string 1"
    },
    {
      "ErrorCode": 1,
      "ErrorMessage": "sample string 1"
    }
  ],
  "Success": true,
  "Id": "2df81d9d-cb0b-4ea7-bb7f-2d45bb5dd8eb"
}

application/xml, text/xml

Sample:
<SupplierPostResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Supplier">
  <Errors>
    <PostSupplierError>
      <ErrorCode>InternalServerError</ErrorCode>
      <ErrorMessage>sample string 1</ErrorMessage>
    </PostSupplierError>
    <PostSupplierError>
      <ErrorCode>InternalServerError</ErrorCode>
      <ErrorMessage>sample string 1</ErrorMessage>
    </PostSupplierError>
  </Errors>
  <Id>2df81d9d-cb0b-4ea7-bb7f-2d45bb5dd8eb</Id>
  <Success>true</Success>
</SupplierPostResponse>