Mercedes.Agency.Orchestration.API

<back to all web services

CreateOrderRequest

Order
Requires Authentication
The following routes are available for this service:
POST/v1/orderCreates an order for a selected vehicle via the Agency APIThis endpoint is called from Online Showroom to create a vehicle order. It builds the order request object for the Agency API before calling it to create the order. The information it retrieves and builds for the Agency API request include 1.) The customer. 2.) The vehicle. 3.) Ourright purchase. 4.) Motability. 5.) Offers applicable to the vehicle Validation is performed on the input data which includes checking for mandatory items: 1.} Customer details 2.) Vehicle Vin 3.) Agent 4.) GSSN Outlet Id 5.) Source 6.) Order Type 7.) Customer Location Id 8.) Estimated Handover Date
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Mercedes.Agency.Orchestration.API.ServiceModel.Orders
Imports Mercedes.Agency.Orchestration.API.Business.Poco
Imports Mercedes.Agency.API.Shared.Enums
Imports Mercedes.Agency.API.Shared.POCO
Imports Mercedes.Agency.Orchestration.API.Clients.AgencyApi.Responses

Namespace Global

    Namespace Mercedes.Agency.API.Shared.POCO

        Public Partial Class Address
            Public Overridable Property [Property] As String
            Public Overridable Property Street As String
            Public Overridable Property Town As String
            Public Overridable Property County As String
            Public Overridable Property Locality As String
            Public Overridable Property Postcode As String
        End Class

        Public Partial Class AdvanceRentals
            Public Overridable Property Options As List(Of Option) = New List(Of Option)
        End Class

        Public Partial Class Customer
            Inherits SalesforceCustomer
            Public Overridable Property ProfileId As Guid?
            Public Overridable Property Preferences As Preferences
        End Class

        Public Partial Class Deposit
            Public Overridable Property [Default] As String
        End Class

        Public Partial Class FinanceCriteria
            Public Overridable Property Key As String
            Public Overridable Property Name As String
            Public Overridable Property Type As String
            Public Overridable Property IsDefault As Boolean
            Public Overridable Property Term As Term
            Public Overridable Property Deposit As Deposit
            Public Overridable Property Mileage As Mileage
            Public Overridable Property AdvanceRentals As AdvanceRentals
            Public Overridable Property IsPersonalised As Boolean
            Public Overridable Property RegularPayment As String
            Public Overridable Property PartExchange As String
            Public Overridable Property Settlement As String
            Public Overridable Property CustomerType As String
            Public Overridable Property VehicleType As VehicleType
        End Class

        Public Partial Class Mileage
            Public Overridable Property Options As List(Of Option) = New List(Of Option)
        End Class

        Public Partial Class Option
            Public Overridable Property IsDefault As Boolean
            Public Overridable Property Value As Integer
        End Class

        Public Partial Class OutrightPurchase
            Public Overridable Property IsOutrightPurchase As Boolean
            Public Overridable Property Reference As String
            Public Overridable Property DiscountRate As Decimal
            Public Overridable Property Bm7NST As String
            Public Overridable Property IsBackOrder As Boolean
            Public Overridable Property IsCOPConverter As Boolean
        End Class

        Public Partial Class Preferences
            Public Overridable Property OptinEmail As Boolean
            Public Overridable Property OptinPost As Boolean
            Public Overridable Property OptinSMS As Boolean
            Public Overridable Property OptinTelephone As Boolean
        End Class

        Public Partial Class SalesforceCustomer
            Implements ICustomer
            Public Overridable Property CustomerId As String Implements ICustomer.CustomerId
            Public Overridable Property IsCiam As Boolean Implements ICustomer.IsCiam
            Public Overridable Property CompanyName As String Implements ICustomer.CompanyName
            Public Overridable Property Title As String Implements ICustomer.Title
            Public Overridable Property Firstname As String Implements ICustomer.Firstname
            Public Overridable Property Surname As String Implements ICustomer.Surname
            Public Overridable Property EmailAddress As String Implements ICustomer.EmailAddress
            Public Overridable Property Telephone As String Implements ICustomer.Telephone
            Public Overridable Property Address As Address Implements ICustomer.Address
            Public Overridable Property Mode As CustomerMode Implements ICustomer.Mode
        End Class

        Public Partial Class Term
            Public Overridable Property Options As List(Of Option) = New List(Of Option)
        End Class

        Public Partial Class Vehicle
            Public Overridable Property Vin As String
        End Class
    End Namespace

    Namespace Mercedes.Agency.Orchestration.API.Business.Poco

        Public Partial Class CreateOrderBase
            Public Overridable Property Source As Source
            Public Overridable Property GssnId As String
            Public Overridable Property AdditionalInformation As String
            Public Overridable Property Cash As Boolean
            Public Overridable Property Finance As Boolean
            Public Overridable Property Customer As Customer
            Public Overridable Property Vehicle As Vehicle
            Public Overridable Property FinanceCriteria As FinanceCriteria
            Public Overridable Property BackOrderGuid As Guid?
            Public Overridable Property TagUrl As String
            Public Overridable Property OutrightPurchase As OutrightPurchase
            Public Overridable Property Motability As Boolean
            Public Overridable Property MotabilityPricingId As Integer?
            Public Overridable Property FinanceApplicationReference As String
            Public Overridable Property Specialist As Boolean
            Public Overridable Property GasId As String
            Public Overridable Property PersonalisedItemOfferIds As Integer()
            Public Overridable Property SuggestedVin As String
            Public Overridable Property NonOptimumReason As String
            Public Overridable Property MotabilityType As MotabilityType
            Public Overridable Property EstimatedHandoverDate As String
        End Class
    End Namespace

    Namespace Mercedes.Agency.Orchestration.API.Clients.AgencyApi.Responses

        Public Partial Class CreateOrderResponse
            Public Overridable Property Guid As String
            Public Overridable Property Reference As String
            Public Overridable Property ResponseStatus As ResponseStatus
            Public Overridable Property BackOrderReference As String
        End Class
    End Namespace

    Namespace Mercedes.Agency.Orchestration.API.ServiceModel.Orders

        Public Partial Class CreateOrderRequest
            Inherits CreateOrderBase
            Implements IGet
        End Class
    End Namespace
End Namespace

VB.NET CreateOrderRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/order HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CreateOrderRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.ServiceModel.Orders">
  <AdditionalInformation xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</AdditionalInformation>
  <BackOrderGuid xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">00000000-0000-0000-0000-000000000000</BackOrderGuid>
  <Cash xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">false</Cash>
  <Customer xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.Agency.API.Shared.POCO" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">
    <d2p1:Address>
      <d2p1:County>String</d2p1:County>
      <d2p1:Locality>String</d2p1:Locality>
      <d2p1:Postcode>String</d2p1:Postcode>
      <d2p1:Property>String</d2p1:Property>
      <d2p1:Street>String</d2p1:Street>
      <d2p1:Town>String</d2p1:Town>
    </d2p1:Address>
    <d2p1:CompanyName>String</d2p1:CompanyName>
    <d2p1:CustomerId>String</d2p1:CustomerId>
    <d2p1:EmailAddress>String</d2p1:EmailAddress>
    <d2p1:Firstname>String</d2p1:Firstname>
    <d2p1:IsCiam>false</d2p1:IsCiam>
    <d2p1:Mode>Private</d2p1:Mode>
    <d2p1:Surname>String</d2p1:Surname>
    <d2p1:Telephone>String</d2p1:Telephone>
    <d2p1:Title>String</d2p1:Title>
    <d2p1:Preferences>
      <d2p1:OptinEmail>false</d2p1:OptinEmail>
      <d2p1:OptinPost>false</d2p1:OptinPost>
      <d2p1:OptinSMS>false</d2p1:OptinSMS>
      <d2p1:OptinTelephone>false</d2p1:OptinTelephone>
    </d2p1:Preferences>
    <d2p1:ProfileId>00000000-0000-0000-0000-000000000000</d2p1:ProfileId>
  </Customer>
  <EstimatedHandoverDate xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</EstimatedHandoverDate>
  <Finance xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">false</Finance>
  <FinanceApplicationReference xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</FinanceApplicationReference>
  <FinanceCriteria xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.Agency.API.Shared.POCO" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">
    <d2p1:AdvanceRentals>
      <d2p1:Options>
        <d2p1:Option>
          <d2p1:IsDefault>false</d2p1:IsDefault>
          <d2p1:Value>0</d2p1:Value>
        </d2p1:Option>
      </d2p1:Options>
    </d2p1:AdvanceRentals>
    <d2p1:CustomerType>String</d2p1:CustomerType>
    <d2p1:Deposit>
      <d2p1:Default>String</d2p1:Default>
    </d2p1:Deposit>
    <d2p1:IsDefault>false</d2p1:IsDefault>
    <d2p1:IsPersonalised>false</d2p1:IsPersonalised>
    <d2p1:Key>String</d2p1:Key>
    <d2p1:Mileage>
      <d2p1:Options>
        <d2p1:Option>
          <d2p1:IsDefault>false</d2p1:IsDefault>
          <d2p1:Value>0</d2p1:Value>
        </d2p1:Option>
      </d2p1:Options>
    </d2p1:Mileage>
    <d2p1:Name>String</d2p1:Name>
    <d2p1:PartExchange>String</d2p1:PartExchange>
    <d2p1:RegularPayment>String</d2p1:RegularPayment>
    <d2p1:Settlement>String</d2p1:Settlement>
    <d2p1:Term>
      <d2p1:Options>
        <d2p1:Option>
          <d2p1:IsDefault>false</d2p1:IsDefault>
          <d2p1:Value>0</d2p1:Value>
        </d2p1:Option>
      </d2p1:Options>
    </d2p1:Term>
    <d2p1:Type>String</d2p1:Type>
    <d2p1:VehicleType>UNASSIGNED</d2p1:VehicleType>
  </FinanceCriteria>
  <GasId xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</GasId>
  <GssnId xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</GssnId>
  <Motability xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">false</Motability>
  <MotabilityPricingId xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">0</MotabilityPricingId>
  <MotabilityType xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">PIP</MotabilityType>
  <NonOptimumReason xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</NonOptimumReason>
  <OutrightPurchase xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.Agency.API.Shared.POCO" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">
    <d2p1:Bm7NST>String</d2p1:Bm7NST>
    <d2p1:DiscountRate>0</d2p1:DiscountRate>
    <d2p1:IsBackOrder>false</d2p1:IsBackOrder>
    <d2p1:IsCOPConverter>false</d2p1:IsCOPConverter>
    <d2p1:IsOutrightPurchase>false</d2p1:IsOutrightPurchase>
    <d2p1:Reference>String</d2p1:Reference>
  </OutrightPurchase>
  <PersonalisedItemOfferIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">
    <d2p1:int>0</d2p1:int>
  </PersonalisedItemOfferIds>
  <Source xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">OnlineShowroom</Source>
  <Specialist xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">false</Specialist>
  <SuggestedVin xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</SuggestedVin>
  <TagUrl xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">String</TagUrl>
  <Vehicle xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.Agency.API.Shared.POCO" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Business.Poco">
    <d2p1:Vin>String</d2p1:Vin>
  </Vehicle>
</CreateOrderRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CreateOrderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.Clients.AgencyApi.Responses">
  <BackOrderReference>String</BackOrderReference>
  <Guid>String</Guid>
  <Reference>String</Reference>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</CreateOrderResponse>