| GET | /price/{brand} | Get the list of prices of the requested items |
|---|
import Foundation
import ServiceStack
public class GetPrice : Codable
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
public var brand:String
/**
* POS Legacy
*/
// @ApiMember(Description="POS Legacy", IsRequired=true)
public var posCode:String
/**
* List of Article Codes
*/
// @ApiMember(Description="List of Article Codes", IsRequired=true)
public var articleCodes:[String] = []
/**
* Include Dealer Cost Price in the response
*/
// @ApiMember(Description="Include Dealer Cost Price in the response", IsRequired=true)
public var includeDealerCostPrice:Bool
required public init(){}
}
public class GetPriceResponse : List<Price>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class Price : Codable
{
/**
* Reference Code of the item
*/
// @ApiMember(Description="Reference Code of the item", IsRequired=true)
public var articleCode:String
/**
* Currency of the price
*/
// @ApiMember(Description="Currency of the price", IsRequired=true)
public var currency:String
/**
* Retail price of the item
*/
// @ApiMember(Description="Retail price of the item")
public var retailSalePrice:Double
/**
* Code of currency applied
*/
// @ApiMember(Description="Code of currency applied", IsRequired=true)
public var priceListCode:String
/**
* Dealer Cost Price
*/
// @ApiMember(Description="Dealer Cost Price")
public var dealerCostPrice:DealerCostPrice
required public init(){}
}
public class DealerCostPrice : Codable
{
/**
* Currency of the Dealer Cost Price
*/
// @ApiMember(Description="Currency of the Dealer Cost Price", IsRequired=true)
public var currency:String
/**
* Dealer Cost Price of the item
*/
// @ApiMember(Description="Dealer Cost Price of the item", IsRequired=true)
public var price:Double?
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /price/{brand} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ArrayOfPrice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.MasterFile.ServiceModel" />