Richemont.Booster2.PublicApi

<back to all web services

ExportStock

Requires Authentication
The following routes are available for this service:
POST/stock/{brand}/exportExport Stock Data
import Foundation
import ServiceStack

public class ExportStock : StockRequest
{
    /**
    * Product Categories
    */
    // @ApiMember(Description="Product Categories")
    public var productCategories:[ProductCategory] = []

    /**
    * Export Request ID of the API Consumers
    */
    // @ApiMember(Description="Export Request ID of the API Consumers", IsRequired=true)
    public var downloadRequestId:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case productCategories
        case downloadRequestId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        productCategories = try container.decodeIfPresent([ProductCategory].self, forKey: .productCategories) ?? []
        downloadRequestId = try container.decodeIfPresent(String.self, forKey: .downloadRequestId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if productCategories.count > 0 { try container.encode(productCategories, forKey: .productCategories) }
        if downloadRequestId != nil { try container.encode(downloadRequestId, forKey: .downloadRequestId) }
    }
}

public class StockRequest : Codable
{
    /**
    * Brand
    */
    // @ApiMember(Description="Brand", IsRequired=true)
    public var brand:String

    /**
    * POS Legacy
    */
    // @ApiMember(Description="POS Legacy")
    public var posCodes:[String] = []

    /**
    * Article Codes
    */
    // @ApiMember(Description="Article Codes")
    public var articleCodes:[String] = []

    /**
    * Include Extra Info
    */
    // @ApiMember(Description="Include Extra Info")
    public var includeExtraInfo:Bool

    /**
    * Cluster Id
    */
    // @ApiMember(Description="Cluster Id")
    public var clusterIds:[String] = []

    /**
    * Include Consignment NotAuthorized POS
    */
    // @ApiMember(Description="Include Consignment NotAuthorized POS")
    public var includeConsignmentNotAuthorizedPOS:Bool

    /**
    * Include Retail Sales Price in the Output, by default: false
    */
    // @ApiMember(Description="Include Retail Sales Price in the Output, by default: false")
    public var includeRSP:Bool

    /**
    * In Stock Since date from 
    */
    // @ApiMember(Description="In Stock Since date from ")
    public var dateFrom:Date?

    /**
    * In Stock Since date to
    */
    // @ApiMember(Description="In Stock Since date to")
    public var dateTo:Date?

    /**
    * Item type, 'standard' OR 'consigned'. By default, all are coming
    */
    // @ApiMember(Description="Item type, 'standard' OR 'consigned'. By default, all are coming")
    public var type:String

    required public init(){}
}

public class ProductCategory : Codable
{
    /**
    * Brand Category ID
    */
    // @ApiMember(Description="Brand Category ID")
    public var brandCategoryId:String

    /**
    * Grand Category ID
    */
    // @ApiMember(Description="Grand Category ID", IsRequired=true)
    public var grandCategoryId:String

    /**
    * Master Category ID
    */
    // @ApiMember(Description="Master Category ID")
    public var masterCategoryId:String

    /**
    * Category ID
    */
    // @ApiMember(Description="Category ID")
    public var categoryId:String

    /**
    * Sub Category ID
    */
    // @ApiMember(Description="Sub Category ID")
    public var subCategoryId:String

    required public init(){}
}

public class ExportStockResponse : Codable
{
    /**
    * Unique Identifier of the Export Request created
    */
    // @ApiMember(Description="Unique Identifier of the Export Request created", IsRequired=true)
    public var asyncTaskId:String

    required public init(){}
}


Swift ExportStock DTOs

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

HTTP + OTHER

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

POST /stock/{brand}/export HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"productCategories":[{"brandCategoryId":"String","grandCategoryId":"String","masterCategoryId":"String","categoryId":"String","subCategoryId":"String"}],"downloadRequestId":"String","brand":"String","posCodes":["String"],"articleCodes":["String"],"includeExtraInfo":false,"clusterIds":["String"],"includeConsignmentNotAuthorizedPOS":false,"includeRSP":false,"dateFrom":"\/Date(-62135596800000-0000)\/","dateTo":"\/Date(-62135596800000-0000)\/","type":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"asyncTaskId":"00000000000000000000000000000000"}