Mercedes.Agency.Orchestration.API

<back to all web services

CarConfiguratorRequest

CarConfigurator
Requires Authentication
The following routes are available for this service:
POST/v1/configuratorValidate and save a car configurator code for a back orderThis endpoint calls Agency API to validate and save a car configurator code for a back order. The code is validated and saved in the database and returns a response from a third party CCS which provides car configuration details. These get saved to open search and returned to the front-end
# frozen_string_literal: true
# encoding: utf-8


require 'json'
require 'servicestack'


class KeyInformation
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :b_m7_n_s_t
    # @return [String]
    attr_accessor :configuration_date
    # @return [String]
    attr_accessor :model_year
    # @return [String]
    attr_accessor :half_year
    # @return [String]
    attr_accessor :type_class
    # @return [TrueClass]
    attr_accessor :is_private_van

    def self.properties
        {
            b_m7_n_s_t: { name: 'bM7NST' },
            configuration_date: { name: 'configurationDate' },
            model_year: { name: 'modelYear' },
            half_year: { name: 'halfYear' },
            type_class: { name: 'typeClass' },
            is_private_van: { name: 'isPrivateVan' },
        }
    end

end

class EquipmentCache
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :code
    # @return [String]
    attr_accessor :description
    # @return [String]
    attr_accessor :standard_flag
    # @return [BigDecimal]
    attr_accessor :price
    # @return [String]
    attr_accessor :category
    # @return [String]
    attr_accessor :importance

    def self.properties
        {
            code: { name: 'code' },
            description: { name: 'description' },
            standard_flag: { name: 'standardFlag' },
            price: { name: 'price' },
            category: { name: 'category' },
            importance: { name: 'importance' },
        }
    end

end

class OrderingOptions
    include ServiceStack::DTO

    # @return [List]
    attr_accessor :interior
    # @return [List]
    attr_accessor :exterior
    # @return [List]
    attr_accessor :options
    # @return [List]
    attr_accessor :wheel_options
    # @return [List]
    attr_accessor :trim_options
    # @return [List]
    attr_accessor :equipment_option_codes
    # @return [List]
    attr_accessor :option_codes

    def self.properties
        {
            interior: { name: 'interior' },
            exterior: { name: 'exterior' },
            options: { name: 'options' },
            wheel_options: { name: 'wheelOptions', type: [EquipmentCache] },
            trim_options: { name: 'trimOptions', type: [EquipmentCache] },
            equipment_option_codes: { name: 'equipmentOptionCodes', type: [EquipmentCache] },
            option_codes: { name: 'optionCodes', type: [EquipmentCache] },
        }
    end

end

class ResponseStatus
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :error_code
    # @return [String]
    attr_accessor :message

    def self.properties
        {
            error_code: { name: 'errorCode' },
            message: { name: 'message' },
        }
    end

end

class CarConfiguratorResponse
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :name
    # @return [KeyInformation]
    attr_accessor :key_information
    # @return [OrderingOptions]
    attr_accessor :ordering_options
    # @return [ResponseStatus]
    attr_accessor :response_status
    # @return [String]
    attr_accessor :configurator_code

    def self.properties
        {
            name: { name: 'name' },
            key_information: { name: 'keyInformation', type: KeyInformation },
            ordering_options: { name: 'orderingOptions', type: OrderingOptions },
            response_status: { name: 'responseStatus', type: ResponseStatus },
            configurator_code: { name: 'configuratorCode' },
        }
    end

end

class CarConfiguratorRequest
    include ServiceStack::DTO

    # @ApiMember(Description: "Configurator code", IsRequired: "true")
    # @return [String]
    attr_accessor :configurator_code

    def self.properties
        {
            configurator_code: { name: 'configuratorCode' },
        }
    end

    def response_type() = CarConfiguratorResponse
    def get_type_name() = 'CarConfiguratorRequest'
end

Ruby CarConfiguratorRequest 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/configurator HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CarConfiguratorRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.Orchestration.API.ServiceModel.BackOrders.CarConfigurator">
  <ConfiguratorCode>String</ConfiguratorCode>
</CarConfiguratorRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CarConfiguratorResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO.CarConfiguratorCodes">
  <ConfiguratorCode>String</ConfiguratorCode>
  <KeyInformation>
    <BM7NST>String</BM7NST>
    <ConfigurationDate>String</ConfigurationDate>
    <HalfYear>String</HalfYear>
    <IsPrivateVan>false</IsPrivateVan>
    <ModelYear>String</ModelYear>
    <TypeClass>String</TypeClass>
  </KeyInformation>
  <Name>String</Name>
  <OrderingOptions>
    <EquipmentOptionCodes xmlns:d3p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO">
      <d3p1:EquipmentCache>
        <d3p1:Category>String</d3p1:Category>
        <d3p1:Code>String</d3p1:Code>
        <d3p1:Description>String</d3p1:Description>
        <d3p1:Importance>String</d3p1:Importance>
        <d3p1:Price>0</d3p1:Price>
        <d3p1:StandardFlag>String</d3p1:StandardFlag>
      </d3p1:EquipmentCache>
    </EquipmentOptionCodes>
    <Exterior xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Exterior>
    <Interior xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Interior>
    <OptionCodes xmlns:d3p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO">
      <d3p1:EquipmentCache>
        <d3p1:Category>String</d3p1:Category>
        <d3p1:Code>String</d3p1:Code>
        <d3p1:Description>String</d3p1:Description>
        <d3p1:Importance>String</d3p1:Importance>
        <d3p1:Price>0</d3p1:Price>
        <d3p1:StandardFlag>String</d3p1:StandardFlag>
      </d3p1:EquipmentCache>
    </OptionCodes>
    <Options xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Options>
    <TrimOptions xmlns:d3p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO">
      <d3p1:EquipmentCache>
        <d3p1:Category>String</d3p1:Category>
        <d3p1:Code>String</d3p1:Code>
        <d3p1:Description>String</d3p1:Description>
        <d3p1:Importance>String</d3p1:Importance>
        <d3p1:Price>0</d3p1:Price>
        <d3p1:StandardFlag>String</d3p1:StandardFlag>
      </d3p1:EquipmentCache>
    </TrimOptions>
    <WheelOptions xmlns:d3p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO">
      <d3p1:EquipmentCache>
        <d3p1:Category>String</d3p1:Category>
        <d3p1:Code>String</d3p1:Code>
        <d3p1:Description>String</d3p1:Description>
        <d3p1:Importance>String</d3p1:Importance>
        <d3p1:Price>0</d3p1:Price>
        <d3p1:StandardFlag>String</d3p1:StandardFlag>
      </d3p1:EquipmentCache>
    </WheelOptions>
  </OrderingOptions>
  <ResponseStatus>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
  </ResponseStatus>
</CarConfiguratorResponse>