POST api/Clients

Method to add a new client to the system

Request Information

URI Parameters

None.

URI Example

api/Clients

Body Parameters

The client data

Oresto.API.Models.POST.Clients.Client
NameDescriptionTypeAdditional information
Active

Active or not

boolean

Required

ClientNumber

The number of the client defined by the wholesaler

string

Primary key field

Required

Max length: 50

Email

E-mail address

string

Required

Max length: 100

HasPromos

Wether or not the client has access to promotion prices

boolean

Required

Location

Client location information

Oresto.API.Models.POST.Clients.Location

Required

MayViewPromoLabels

If the client may view promotion labels (webshop)

boolean

Required

Name

Name of the client

string

Required

Max length: 50

OrdersMayBeDeliveredToClient

If orders may be delivered to a client address

boolean

Required

PhoneNumber

Phone number

string

Max length: 100

Remarks

Additional remarks for the client

string

None.

SegmentId

Client segment Id

integer

Foreign key field

Request Formats

application/json, text/json

Sample:
{
  "ClientNumber": "sample string 1",
  "Name": "sample string 2",
  "Email": "sample string 3",
  "MayViewPromoLabels": true,
  "PhoneNumber": "sample string 5",
  "SegmentId": 1,
  "Remarks": "sample string 6",
  "Active": true,
  "HasPromos": true,
  "OrdersMayBeDeliveredToClient": true,
  "Location": {
    "StreetName": "sample string 1",
    "ExtraAddressLine": "sample string 2",
    "StreetNumber": "sample string 3",
    "PostalCode": "sample string 4",
    "Province": "sample string 5",
    "Municipality": "sample string 6",
    "CountryCode": "sample string 7"
  }
}

application/xml, text/xml

Sample:
<Client xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.POST.Clients">
  <Active>true</Active>
  <ClientNumber>sample string 1</ClientNumber>
  <Email>sample string 3</Email>
  <HasPromos>true</HasPromos>
  <Location>
    <CountryCode>sample string 7</CountryCode>
    <ExtraAddressLine>sample string 2</ExtraAddressLine>
    <Municipality>sample string 6</Municipality>
    <PostalCode>sample string 4</PostalCode>
    <Province>sample string 5</Province>
    <StreetName>sample string 1</StreetName>
    <StreetNumber>sample string 3</StreetNumber>
  </Location>
  <MayViewPromoLabels>true</MayViewPromoLabels>
  <Name>sample string 2</Name>
  <OrdersMayBeDeliveredToClient>true</OrdersMayBeDeliveredToClient>
  <PhoneNumber>sample string 5</PhoneNumber>
  <Remarks>sample string 6</Remarks>
  <SegmentId>1</SegmentId>
</Client>

application/x-www-form-urlencoded

Sample:
ClientNumber=value&Name=value&Email=value&MayViewPromoLabels=value&PhoneNumber=value&SegmentId=value&Remarks=value&Active=value&HasPromos=value&OrdersMayBeDeliveredToClient=value&Location=value

Response Information

Resource Description

A wrapper class with information about the new entity

Oresto.API.Models.POST.Clients.ClientData
NameDescriptionTypeAdditional information
ClientId

Newly created client id

integer

None.

Errors

Possible errors that were experienced when processing the request

Collection of string

None.

ModelStateErrors

Possible model errors that were experienced when validating the data

Collection of Oresto.API.Models.Shared.ModelStateError

None.

RequestInformation

Additional information about the request

Oresto.API.Models.Shared.RequestInformation

None.

Response Formats

application/json, text/json

Sample:
{
  "ClientId": 1,
  "RequestInformation": {
    "RequestDuration": 1,
    "WholesalerId": 2,
    "UserId": 3
  },
  "ModelStateErrors": [
    {
      "Key": "sample string 1",
      "Message": "sample string 2",
      "Exception": "sample string 3"
    },
    {
      "Key": "sample string 1",
      "Message": "sample string 2",
      "Exception": "sample string 3"
    }
  ],
  "Errors": [
    "sample string 1",
    "sample string 2"
  ]
}

application/xml, text/xml

Sample:
<ClientData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.POST.Clients">
  <Errors xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.Shared">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Errors>
  <ModelStateErrors xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.Shared">
    <ModelStateError>
      <Exception>sample string 3</Exception>
      <Key>sample string 1</Key>
      <Message>sample string 2</Message>
    </ModelStateError>
    <ModelStateError>
      <Exception>sample string 3</Exception>
      <Key>sample string 1</Key>
      <Message>sample string 2</Message>
    </ModelStateError>
  </ModelStateErrors>
  <RequestInformation xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.Shared">
    <RequestDuration>1</RequestDuration>
    <UserId>3</UserId>
    <WholesalerId>2</WholesalerId>
  </RequestInformation>
  <ClientId>1</ClientId>
</ClientData>