Mercedes.VehicleManagement.API

<back to all web services

MotabilityVehiclesRequest

Vehicle
Requires Authentication
The following routes are available for this service:
GET/v1/{VehicleType}/Vehicle/MotabilityGet motability vehicle data
# frozen_string_literal: true
# encoding: utf-8


require 'json'
require 'servicestack'


class VehicleDataBase
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :vin
    # @return [String]
    attr_accessor :description
    # @return [String]
    attr_accessor :model
    # @return [String]
    attr_accessor :otr
    # @return [String]
    attr_accessor :retail_price_ex_v_a_t
    # @return [String]
    attr_accessor :actual_price
    # @return [String]
    attr_accessor :p11_d
    # @return [String]
    attr_accessor :fuel_type
    # @return [String]
    attr_accessor :transmission
    # @return [String]
    attr_accessor :transmission_type
    # @return [String]
    attr_accessor :colour
    # @return [String]
    attr_accessor :colour_code
    # @return [String]
    attr_accessor :colour_description
    # @return [String]
    attr_accessor :commission_number
    # @return [TrueClass]
    attr_accessor :offer_available
    # @return [Integer]
    attr_accessor :campaign_discount_offer_total
    # @return [Integer]
    attr_accessor :campaign_discount_offer_total_current
    # @return [Integer]
    attr_accessor :campaign_discount_offer_total_pending
    # @return [Integer]
    attr_accessor :campaign_service_offer_total
    # @return [Integer]
    attr_accessor :campaign_service_offer_total_current
    # @return [Integer]
    attr_accessor :campaign_service_offer_total_pending
    # @return [Integer]
    attr_accessor :campaign_custom_offer_total
    # @return [Integer]
    attr_accessor :campaign_personalised_offer_total_current
    # @return [Integer]
    attr_accessor :campaign_personalised_offer_total_pending
    # @return [Integer]
    attr_accessor :campaign_personalised_offer_total
    # @return [Integer]
    attr_accessor :campaign_custom_offer_total_current
    # @return [Integer]
    attr_accessor :campaign_custom_offer_total_pending
    # @return [Integer]
    attr_accessor :campaign_other_offer_total
    # @return [Integer]
    attr_accessor :campaign_other_offer_total_current
    # @return [Integer]
    attr_accessor :campaign_other_offer_total_pending
    # @return [Integer]
    attr_accessor :retailer_discount_offer_total
    # @return [Integer]
    attr_accessor :retailer_discount_offer_total_current
    # @return [Integer]
    attr_accessor :retailer_discount_offer_total_pending
    # @return [Integer]
    attr_accessor :retailer_service_offer_total
    # @return [Integer]
    attr_accessor :retailer_service_offer_total_current
    # @return [Integer]
    attr_accessor :retailer_service_offer_total_pending
    # @return [Integer]
    attr_accessor :retailer_custom_offer_total
    # @return [Integer]
    attr_accessor :retailer_custom_offer_total_current
    # @return [Integer]
    attr_accessor :retailer_custom_offer_total_pending
    # @return [Integer]
    attr_accessor :retailer_warranty_offer_total
    # @return [Integer]
    attr_accessor :retailer_warranty_offer_total_current
    # @return [Integer]
    attr_accessor :retailer_warranty_offer_total_pending
    # @return [Integer]
    attr_accessor :retailer_offer_total
    # @return [Integer]
    attr_accessor :retailer_offer_total_current
    # @return [Integer]
    attr_accessor :retailer_offer_total_pending
    # @return [Integer]
    attr_accessor :campaign_offer_total
    # @return [Integer]
    attr_accessor :campaign_offer_total_current
    # @return [Integer]
    attr_accessor :campaign_offer_total_pending
    # @return [Integer]
    attr_accessor :campaign_and_offer_total
    # @return [Integer]
    attr_accessor :campaign_and_offer_total_current
    # @return [Integer]
    attr_accessor :campaign_and_offer_total_pending
    # @return [Integer]
    attr_accessor :offer_total
    # @return [Integer]
    attr_accessor :offer_total_current
    # @return [Integer]
    attr_accessor :offer_total_pending
    # @return [String]
    attr_accessor :creation
    # @return [String]
    attr_accessor :modified
    # @return [Integer]
    attr_accessor :electric_range
    # @return [Integer]
    attr_accessor :electric_consumption
    # @return [DateTime]
    attr_accessor :port_arrival_date
    # @return [Integer]
    attr_accessor :days_since_port_arrival
    # @return [BigDecimal]
    attr_accessor :retail_price_inc_v_a_t
    # @return [String]
    attr_accessor :body_style
    # @return [String]
    attr_accessor :upholstery
    # @return [String]
    attr_accessor :upholstery_code
    # @return [String]
    attr_accessor :upholstery_type
    # @return [List]
    attr_accessor :package_names
    # @return [String]
    attr_accessor :line
    # @return [String]
    attr_accessor :mapped_line
    # @return [BigDecimal]
    attr_accessor :current_retailer_offer_price
    # @return [String]
    attr_accessor :retail_price
    # @return [TrueClass]
    attr_accessor :vat_qualifying
    # @return [Integer]
    attr_accessor :retailer_id
    # @return [String]
    attr_accessor :gssn_id
    # @return [TrueClass]
    attr_accessor :no_image
    # @return [String]
    attr_accessor :image_url
    # @return [TrueClass]
    attr_accessor :is_available_online
    # @return [TrueClass]
    attr_accessor :is_back_ordered
    # @return [String]
    attr_accessor :creation_date
    # @return [String]
    attr_accessor :maintenance_date
    # @return [String]
    attr_accessor :registration_number
    # @return [DateTime]
    attr_accessor :registration_date
    # @return [Integer]
    attr_accessor :mileage
    # @return [DateTime]
    attr_accessor :trade_in_date
    # @return [String]
    attr_accessor :source
    # @return [String]
    attr_accessor :vehicle_type
    # @return [String]
    attr_accessor :offer_amount
    # @return [String]
    attr_accessor :offer_expiry
    # @return [Array]
    attr_accessor :active_offers
    # @return [Integer]
    attr_accessor :campaign_messages_total
    # @return [TrueClass]
    attr_accessor :under_offer
    # @return [TrueClass]
    attr_accessor :is_display_stock
    # @return [String]
    attr_accessor :display_retailer
    # @return [String]
    attr_accessor :display_retailer_gssn_id
    # @return [String]
    attr_accessor :location
    # @return [String]
    attr_accessor :account
    # @return [String]
    attr_accessor :account_type
    # @return [String]
    attr_accessor :usage_code
    # @return [String]
    attr_accessor :bm7_n_s_t
    # @return [TrueClass]
    attr_accessor :is_sellable
    # @return [TrueClass]
    attr_accessor :secured
    # @return [TrueClass]
    attr_accessor :specialist
    # @return [TrueClass]
    attr_accessor :is_motability_retailer
    # @return [String]
    attr_accessor :upholstery_description
    # @return [TrueClass]
    attr_accessor :in_back_order_account
    # @return [String]
    attr_accessor :full_model_year_code
    # @return [String]
    attr_accessor :baumuster
    # @return [TrueClass]
    attr_accessor :is_motability
    # @return [BigDecimal]
    attr_accessor :pip_advance_rental_gross
    # @return [BigDecimal]
    attr_accessor :wpms_advance_rental_gross
    # @return [List]
    attr_accessor :isp_vehicle_customer_descriptions
    # @return [TrueClass]
    attr_accessor :eligible_for_ma_transfer
    # @return [String]
    attr_accessor :confirmed_production_date
    # @return [String]
    attr_accessor :forecasted_arrival_date

    def self.properties
        {
            vin: { name: 'vin' },
            description: { name: 'description' },
            model: { name: 'model' },
            otr: { name: 'otr' },
            retail_price_ex_v_a_t: { name: 'retailPriceExVAT' },
            actual_price: { name: 'actualPrice' },
            p11_d: { name: 'p11D' },
            fuel_type: { name: 'fuelType' },
            transmission: { name: 'transmission' },
            transmission_type: { name: 'transmissionType' },
            colour: { name: 'colour' },
            colour_code: { name: 'colourCode' },
            colour_description: { name: 'colourDescription' },
            commission_number: { name: 'commissionNumber' },
            offer_available: { name: 'offerAvailable' },
            campaign_discount_offer_total: { name: 'campaignDiscountOfferTotal' },
            campaign_discount_offer_total_current: { name: 'campaignDiscountOfferTotalCurrent' },
            campaign_discount_offer_total_pending: { name: 'campaignDiscountOfferTotalPending' },
            campaign_service_offer_total: { name: 'campaignServiceOfferTotal' },
            campaign_service_offer_total_current: { name: 'campaignServiceOfferTotalCurrent' },
            campaign_service_offer_total_pending: { name: 'campaignServiceOfferTotalPending' },
            campaign_custom_offer_total: { name: 'campaignCustomOfferTotal' },
            campaign_personalised_offer_total_current: { name: 'campaignPersonalisedOfferTotalCurrent' },
            campaign_personalised_offer_total_pending: { name: 'campaignPersonalisedOfferTotalPending' },
            campaign_personalised_offer_total: { name: 'campaignPersonalisedOfferTotal' },
            campaign_custom_offer_total_current: { name: 'campaignCustomOfferTotalCurrent' },
            campaign_custom_offer_total_pending: { name: 'campaignCustomOfferTotalPending' },
            campaign_other_offer_total: { name: 'campaignOtherOfferTotal' },
            campaign_other_offer_total_current: { name: 'campaignOtherOfferTotalCurrent' },
            campaign_other_offer_total_pending: { name: 'campaignOtherOfferTotalPending' },
            retailer_discount_offer_total: { name: 'retailerDiscountOfferTotal' },
            retailer_discount_offer_total_current: { name: 'retailerDiscountOfferTotalCurrent' },
            retailer_discount_offer_total_pending: { name: 'retailerDiscountOfferTotalPending' },
            retailer_service_offer_total: { name: 'retailerServiceOfferTotal' },
            retailer_service_offer_total_current: { name: 'retailerServiceOfferTotalCurrent' },
            retailer_service_offer_total_pending: { name: 'retailerServiceOfferTotalPending' },
            retailer_custom_offer_total: { name: 'retailerCustomOfferTotal' },
            retailer_custom_offer_total_current: { name: 'retailerCustomOfferTotalCurrent' },
            retailer_custom_offer_total_pending: { name: 'retailerCustomOfferTotalPending' },
            retailer_warranty_offer_total: { name: 'retailerWarrantyOfferTotal' },
            retailer_warranty_offer_total_current: { name: 'retailerWarrantyOfferTotalCurrent' },
            retailer_warranty_offer_total_pending: { name: 'retailerWarrantyOfferTotalPending' },
            retailer_offer_total: { name: 'retailerOfferTotal' },
            retailer_offer_total_current: { name: 'retailerOfferTotalCurrent' },
            retailer_offer_total_pending: { name: 'retailerOfferTotalPending' },
            campaign_offer_total: { name: 'campaignOfferTotal' },
            campaign_offer_total_current: { name: 'campaignOfferTotalCurrent' },
            campaign_offer_total_pending: { name: 'campaignOfferTotalPending' },
            campaign_and_offer_total: { name: 'campaignAndOfferTotal' },
            campaign_and_offer_total_current: { name: 'campaignAndOfferTotalCurrent' },
            campaign_and_offer_total_pending: { name: 'campaignAndOfferTotalPending' },
            offer_total: { name: 'offerTotal' },
            offer_total_current: { name: 'offerTotalCurrent' },
            offer_total_pending: { name: 'offerTotalPending' },
            creation: { name: 'creation' },
            modified: { name: 'modified' },
            electric_range: { name: 'electricRange' },
            electric_consumption: { name: 'electricConsumption' },
            port_arrival_date: { name: 'portArrivalDate', type: DateTime },
            days_since_port_arrival: { name: 'daysSincePortArrival' },
            retail_price_inc_v_a_t: { name: 'retailPriceIncVAT' },
            body_style: { name: 'bodyStyle' },
            upholstery: { name: 'upholstery' },
            upholstery_code: { name: 'upholsteryCode' },
            upholstery_type: { name: 'upholsteryType' },
            package_names: { name: 'packageNames' },
            line: { name: 'line' },
            mapped_line: { name: 'mappedLine' },
            current_retailer_offer_price: { name: 'currentRetailerOfferPrice' },
            retail_price: { name: 'retailPrice' },
            vat_qualifying: { name: 'vatQualifying' },
            retailer_id: { name: 'retailerId' },
            gssn_id: { name: 'gssnId' },
            no_image: { name: 'noImage' },
            image_url: { name: 'imageUrl' },
            is_available_online: { name: 'isAvailableOnline' },
            is_back_ordered: { name: 'isBackOrdered' },
            creation_date: { name: 'creationDate' },
            maintenance_date: { name: 'maintenanceDate' },
            registration_number: { name: 'registrationNumber' },
            registration_date: { name: 'registrationDate', type: DateTime },
            mileage: { name: 'mileage' },
            trade_in_date: { name: 'tradeInDate', type: DateTime },
            source: { name: 'source' },
            vehicle_type: { name: 'vehicleType' },
            offer_amount: { name: 'offerAmount' },
            offer_expiry: { name: 'offerExpiry' },
            active_offers: { name: 'activeOffers' },
            campaign_messages_total: { name: 'campaignMessagesTotal' },
            under_offer: { name: 'underOffer' },
            is_display_stock: { name: 'isDisplayStock' },
            display_retailer: { name: 'displayRetailer' },
            display_retailer_gssn_id: { name: 'displayRetailerGssnId' },
            location: { name: 'location' },
            account: { name: 'account' },
            account_type: { name: 'accountType' },
            usage_code: { name: 'usageCode' },
            bm7_n_s_t: { name: 'bm7NST' },
            is_sellable: { name: 'isSellable' },
            secured: { name: 'secured' },
            specialist: { name: 'specialist' },
            is_motability_retailer: { name: 'isMotabilityRetailer' },
            upholstery_description: { name: 'upholsteryDescription' },
            in_back_order_account: { name: 'inBackOrderAccount' },
            full_model_year_code: { name: 'fullModelYearCode' },
            baumuster: { name: 'baumuster' },
            is_motability: { name: 'isMotability' },
            pip_advance_rental_gross: { name: 'pipAdvanceRentalGross' },
            wpms_advance_rental_gross: { name: 'wpmsAdvanceRentalGross' },
            isp_vehicle_customer_descriptions: { name: 'ispVehicleCustomerDescriptions' },
            eligible_for_ma_transfer: { name: 'eligibleForMaTransfer' },
            confirmed_production_date: { name: 'confirmedProductionDate' },
            forecasted_arrival_date: { name: 'forecastedArrivalDate' },
        }
    end

end

class VehicleData < VehicleDataBase
    # @return [String]
    attr_accessor :engine

    def self.properties
        {
            engine: { name: 'engine' },
        }
    end

end

class Equipment
    include ServiceStack::DTO

    # @return [Integer]
    attr_accessor :id
    # @return [String]
    attr_accessor :code
    # @return [String]
    attr_accessor :description

    def self.properties
        {
            id: { name: 'id' },
            code: { name: 'code' },
            description: { name: 'description' },
        }
    end

end

class VehicleIdentifierData < VehicleData
    # @return [String]
    attr_accessor :retailer
    # @return [TrueClass]
    attr_accessor :has_motability_error
    # @return [List]
    attr_accessor :equipment
    # @return [String]
    attr_accessor :vehicle_class

    def self.properties
        {
            retailer: { name: 'retailer' },
            has_motability_error: { name: 'hasMotabilityError' },
            equipment: { name: 'equipment', type: [Equipment] },
            vehicle_class: { name: 'vehicleClass' },
        }
    end

end

class VehiclesByRetailerResponse
    include ServiceStack::DTO

    # @return [List]
    attr_accessor :vehicles

    def self.properties
        {
            vehicles: { name: 'vehicles', type: [VehicleIdentifierData] },
        }
    end

end

class MotabilityVehiclesRequest
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :vehicle_type

    def self.properties
        {
            vehicle_type: { name: 'vehicleType' },
        }
    end

    def response_type() = VehiclesByRetailerResponse
    def get_type_name() = 'MotabilityVehiclesRequest'
end

Ruby MotabilityVehiclesRequest DTOs

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

HTTP + JSV

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

GET /v1/{VehicleType}/Vehicle/Motability HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	vehicles: 
	[
		{
			retailer: String,
			hasMotabilityError: False,
			equipment: 
			[
				{
					id: 0,
					code: String,
					description: String
				}
			],
			vehicleClass: String,
			engine: String,
			vin: String,
			description: String,
			model: String,
			otr: String,
			retailPriceExVAT: String,
			actualPrice: String,
			p11D: String,
			fuelType: String,
			transmission: String,
			transmissionType: String,
			colour: String,
			colourCode: String,
			colourDescription: String,
			commissionNumber: String,
			offerAvailable: False,
			campaignDiscountOfferTotal: 0,
			campaignDiscountOfferTotalCurrent: 0,
			campaignDiscountOfferTotalPending: 0,
			campaignServiceOfferTotal: 0,
			campaignServiceOfferTotalCurrent: 0,
			campaignServiceOfferTotalPending: 0,
			campaignCustomOfferTotal: 0,
			campaignPersonalisedOfferTotalCurrent: 0,
			campaignPersonalisedOfferTotalPending: 0,
			campaignPersonalisedOfferTotal: 0,
			campaignCustomOfferTotalCurrent: 0,
			campaignCustomOfferTotalPending: 0,
			campaignOtherOfferTotal: 0,
			campaignOtherOfferTotalCurrent: 0,
			campaignOtherOfferTotalPending: 0,
			retailerDiscountOfferTotal: 0,
			retailerDiscountOfferTotalCurrent: 0,
			retailerDiscountOfferTotalPending: 0,
			retailerServiceOfferTotal: 0,
			retailerServiceOfferTotalCurrent: 0,
			retailerServiceOfferTotalPending: 0,
			retailerCustomOfferTotal: 0,
			retailerCustomOfferTotalCurrent: 0,
			retailerCustomOfferTotalPending: 0,
			retailerWarrantyOfferTotal: 0,
			retailerWarrantyOfferTotalCurrent: 0,
			retailerWarrantyOfferTotalPending: 0,
			retailerOfferTotal: 0,
			retailerOfferTotalCurrent: 0,
			retailerOfferTotalPending: 0,
			campaignOfferTotal: 0,
			campaignOfferTotalCurrent: 0,
			campaignOfferTotalPending: 0,
			campaignAndOfferTotal: 0,
			campaignAndOfferTotalCurrent: 0,
			campaignAndOfferTotalPending: 0,
			offerTotal: 0,
			offerTotalCurrent: 0,
			offerTotalPending: 0,
			creation: String,
			modified: String,
			electricRange: 0,
			electricConsumption: 0,
			portArrivalDate: 0001-01-01,
			daysSincePortArrival: 0,
			retailPriceIncVAT: 0,
			bodyStyle: String,
			upholstery: String,
			upholsteryCode: String,
			upholsteryType: String,
			packageNames: 
			[
				String
			],
			line: String,
			mappedLine: String,
			currentRetailerOfferPrice: 0,
			retailPrice: String,
			vatQualifying: False,
			retailerId: 0,
			gssnId: String,
			noImage: False,
			imageUrl: String,
			isAvailableOnline: False,
			isBackOrdered: False,
			creationDate: String,
			maintenanceDate: String,
			registrationNumber: String,
			registrationDate: 0001-01-01,
			mileage: 0,
			tradeInDate: 0001-01-01,
			source: String,
			vehicleType: String,
			offerAmount: String,
			offerExpiry: String,
			activeOffers: 
			[
				0
			],
			campaignMessagesTotal: 0,
			underOffer: False,
			isDisplayStock: False,
			displayRetailer: String,
			displayRetailerGssnId: String,
			location: String,
			account: String,
			accountType: String,
			usageCode: String,
			bm7NST: String,
			isSellable: False,
			secured: False,
			specialist: False,
			isMotabilityRetailer: False,
			upholsteryDescription: String,
			inBackOrderAccount: False,
			fullModelYearCode: String,
			baumuster: String,
			isMotability: False,
			pipAdvanceRentalGross: 0,
			wpmsAdvanceRentalGross: 0,
			ispVehicleCustomerDescriptions: 
			[
				String
			],
			eligibleForMaTransfer: False,
			confirmedProductionDate: String,
			forecastedArrivalDate: String
		}
	]
}