POST | /v1/motabilityinflightpricing | Motability Pricing Inflight Pricing for supplied Order Guids | This endpoint is used for fetch motability orders only for inflight pricing. The original request is being made on Agency API and a list of orders from database is passed to agency orch. This is to fetch addditional information such as the vehicles details e.g Prices and Offers data |
---|
"use strict";
export class OrderOffer {
/** @param {{Id?:number,OfferTypeId?:number,OfferTypeDescription?:string,OfferId?:string,OfferDescription?:string,Net?:number,VAT?:number,Gross?:number,GovernmentGrant?:boolean,PromoCode?:string,Expiry?:string,AffectsPrice?:boolean,Product?:number,ParentId?:string,CreationDate?:string,ProductTypeDescription?:string,ProductTypeNegativeDescription?:string,CertificateRequired?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {number} */
OfferTypeId;
/** @type {string} */
OfferTypeDescription;
/** @type {string} */
OfferId;
/** @type {string} */
OfferDescription;
/** @type {number} */
Net;
/** @type {number} */
VAT;
/** @type {number} */
Gross;
/** @type {boolean} */
GovernmentGrant;
/** @type {?string} */
PromoCode;
/** @type {?string} */
Expiry;
/** @type {boolean} */
AffectsPrice;
/** @type {?number} */
Product;
/** @type {?string} */
ParentId;
/** @type {string} */
CreationDate;
/** @type {?string} */
ProductTypeDescription;
/** @type {?string} */
ProductTypeNegativeDescription;
/** @type {?boolean} */
CertificateRequired;
}
export class OutrightPurchase {
/** @param {{IsOutrightPurchase?:boolean,Reference?:string,DiscountRate?:number,Bm7NST?:string,IsBackOrder?:boolean,IsCOPConverter?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
IsOutrightPurchase;
/** @type {string} */
Reference;
/** @type {number} */
DiscountRate;
/** @type {string} */
Bm7NST;
/** @type {boolean} */
IsBackOrder;
/** @type {boolean} */
IsCOPConverter;
}
export class MotabilityAdvancePayment {
/** @param {{AdvancePaymentRentalType?:string,AdvancePaymentValueGross?:number,AdvancePaymentValueVAT?:number,AdvancePaymentValueNet?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
AdvancePaymentRentalType;
/** @type {number} */
AdvancePaymentValueGross;
/** @type {number} */
AdvancePaymentValueVAT;
/** @type {number} */
AdvancePaymentValueNet;
}
export class InflightPricingOrder {
/** @param {{Guid?:string,Vin?:string,AdvanceRentalPaymentType?:number,Offer?:OrderOffer[],OutrightPurchase?:OutrightPurchase,MotabilityAdvancePayment?:MotabilityAdvancePayment}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Guid;
/** @type {string} */
Vin;
/** @type {number} */
AdvanceRentalPaymentType;
/** @type {OrderOffer[]} */
Offer = [];
/** @type {?OutrightPurchase} */
OutrightPurchase;
/** @type {?MotabilityAdvancePayment} */
MotabilityAdvancePayment;
}
export class InflightPricingOrderRequest {
/** @param {{InvalidFormatGuids?:string[],OrderNotFoundGuids?:string[],InflightPricingOrders?:InflightPricingOrder[],IsMotability?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string[]} */
InvalidFormatGuids = [];
/** @type {string[]} */
OrderNotFoundGuids = [];
/** @type {InflightPricingOrder[]} */
InflightPricingOrders = [];
/** @type {boolean} */
IsMotability;
}
export class MotabilityInflightPricingOrderRequest extends InflightPricingOrderRequest {
/** @param {{OrderVehicleWithNoMotabilityDiscount?:string[],InvalidFormatGuids?:string[],OrderNotFoundGuids?:string[],InflightPricingOrders?:InflightPricingOrder[],IsMotability?:boolean}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {string[]} */
OrderVehicleWithNoMotabilityDiscount = [];
}
export class SalesforcePrice {
/** @param {{Id?:string,Description?:string,Net?:number,VAT?:number,Gross?:number,Product?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Description;
/** @type {number} */
Net;
/** @type {number} */
VAT;
/** @type {number} */
Gross;
/** @type {string} */
Product;
}
export class SalesforceTotalPrice {
/** @param {{Net?:number,VAT?:number,Gross?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Net;
/** @type {number} */
VAT;
/** @type {number} */
Gross;
}
export class SalesforceOffer {
/** @param {{Id?:string,Description?:string,Net?:number,VAT?:number,Gross?:number,Expiry?:string,Product?:string,RequiresCertification?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Description;
/** @type {number} */
Net;
/** @type {number} */
VAT;
/** @type {number} */
Gross;
/** @type {?string} */
Expiry;
/** @type {string} */
Product;
/** @type {?boolean} */
RequiresCertification;
}
export class SalesforceOffers {
/** @param {{Personalised?:SalesforceOffer[],NonDiscretionary?:SalesforceOffer[],NonCampaign?:SalesforceOffer[],OutrightPurchaseDiscount?:SalesforceOffer[],MotabilityDiscount?:SalesforceOffer[],IntegratedProducts?:SalesforceOffer[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {SalesforceOffer[]} */
Personalised = [];
/** @type {SalesforceOffer[]} */
NonDiscretionary = [];
/** @type {SalesforceOffer[]} */
NonCampaign = [];
/** @type {SalesforceOffer[]} */
OutrightPurchaseDiscount = [];
/** @type {SalesforceOffer[]} */
MotabilityDiscount = [];
/** @type {SalesforceOffer[]} */
IntegratedProducts = [];
}
export class SalesforceOutrightPurchase {
/** @param {{IsOutrightPurchase?:boolean,Reference?:string,DiscountPercentage?:number,ModelId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
IsOutrightPurchase;
/** @type {string} */
Reference;
/** @type {number} */
DiscountPercentage;
/** @type {string} */
ModelId;
}
export class VehicleInflightPrice {
/** @param {{Guid?:string,Status?:string,Success?:boolean,Prices?:SalesforcePrice[],TotalOTRFees?:SalesforceTotalPrice,TotalOTRPrice?:SalesforceTotalPrice,TotalActualPrice?:SalesforceTotalPrice,Offers?:SalesforceOffers,OutrightPurchase?:SalesforceOutrightPurchase,Motability?:MotabilityAdvancePayment}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Guid;
/** @type {string} */
Status;
/** @type {boolean} */
Success;
/** @type {SalesforcePrice[]} */
Prices = [];
/** @type {SalesforceTotalPrice} */
TotalOTRFees;
/** @type {SalesforceTotalPrice} */
TotalOTRPrice;
/** @type {SalesforceTotalPrice} */
TotalActualPrice;
/** @type {SalesforceOffers} */
Offers;
/** @type {?SalesforceOutrightPurchase} */
OutrightPurchase;
/** @type {MotabilityAdvancePayment} */
Motability;
}
export class InflightPricingResponse {
/** @param {{VehiclesInflightPrices?:VehicleInflightPrice[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {VehicleInflightPrice[]} */
VehiclesInflightPrices = [];
}
export class MotabilityInflightPricingRequest extends MotabilityInflightPricingOrderRequest {
/** @param {{OrderVehicleWithNoMotabilityDiscount?:string[],InvalidFormatGuids?:string[],OrderNotFoundGuids?:string[],InflightPricingOrders?:InflightPricingOrder[],IsMotability?:boolean}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
JavaScript MotabilityInflightPricingRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/motabilityinflightpricing HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
OrderVehicleWithNoMotabilityDiscount:
[
00000000000000000000000000000000
],
InvalidFormatGuids:
[
String
],
OrderNotFoundGuids:
[
00000000000000000000000000000000
],
InflightPricingOrders:
[
{
Guid: 00000000000000000000000000000000,
Vin: String,
AdvanceRentalPaymentType: 0,
Offer:
[
{
Id: 0,
OfferTypeId: 0,
OfferTypeDescription: String,
OfferId: String,
OfferDescription: String,
Net: 0,
VAT: 0,
Gross: 0,
GovernmentGrant: False,
PromoCode: String,
Expiry: String,
AffectsPrice: False,
Product: 0,
ParentId: String,
CreationDate: 0001-01-01,
ProductTypeDescription: String,
ProductTypeNegativeDescription: String,
CertificateRequired: False
}
],
OutrightPurchase:
{
IsOutrightPurchase: False,
Reference: String,
DiscountRate: 0,
Bm7NST: String,
IsBackOrder: False,
IsCOPConverter: False
},
MotabilityAdvancePayment:
{
AdvancePaymentRentalType: String,
AdvancePaymentValueGross: 0,
AdvancePaymentValueVAT: 0,
AdvancePaymentValueNet: 0
}
}
],
IsMotability: False
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { VehiclesInflightPrices: [ { Guid: String, Status: String, Success: False, Prices: [ { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Product: String } ], TotalOTRFees: { Net: 0, VAT: 0, Gross: 0 }, TotalOTRPrice: { Net: 0, VAT: 0, Gross: 0 }, TotalActualPrice: { Net: 0, VAT: 0, Gross: 0 }, Offers: { Personalised: [ { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Expiry: String, Product: String, RequiresCertification: False } ], NonDiscretionary: [ { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Expiry: String, Product: String, RequiresCertification: False } ], NonCampaign: [ { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Expiry: String, Product: String, RequiresCertification: False } ], OutrightPurchaseDiscount: [ { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Expiry: String, Product: String, RequiresCertification: False } ], MotabilityDiscount: [ { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Expiry: String, Product: String, RequiresCertification: False } ], IntegratedProducts: [ { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Expiry: String, Product: String, RequiresCertification: False } ] }, OutrightPurchase: { IsOutrightPurchase: False, Reference: String, DiscountPercentage: 0, ModelId: String }, Motability: { AdvancePaymentRentalType: String, AdvancePaymentValueGross: 0, AdvancePaymentValueVAT: 0, AdvancePaymentValueNet: 0 } } ] }