BokaMera.API.Host

<back to all web services

GetPricesAfterRebateCode

Requires Authentication
The following routes are available for this service:
POST/rebatecodes/pricesGet the new pricesGet the new prices after applying RebateCodes
import Foundation
import ServiceStack

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
public class GetPricesAfterRebateCode : Codable
{
    /**
    * 
    */
    // @ApiMember(Description="", IsRequired=true)
    public var companyId:String

    /**
    * The service you want to get the prices with rebates on
    */
    // @ApiMember(Description="The service you want to get the prices with rebates on")
    public var serviceId:Int?

    /**
    * Provide this if you like to the prices with rebate code ids
    */
    // @ApiMember(Description="Provide this if you like to the prices with rebate code ids")
    public var rebateCodeIds:[Int] = []

    /**
    * Provide this if you like to the prices with rebate code signs instead of ids
    */
    // @ApiMember(Description="Provide this if you like to the prices with rebate code signs instead of ids")
    public var rebateCodeSigns:[String] = []

    /**
    * Provide this if you like to calculate the prices with the provided datetime
    */
    // @ApiMember(Description="Provide this if you like to calculate the prices with the provided datetime", IsRequired=true)
    public var dateFrom:Date

    required public init(){}
}

public class RebateCodePriceResponse : Codable
{
    public var rebateCodePrices:[RebateCodePrice] = []
    public var responseStatus:ResponseStatus

    required public init(){}
}

public class RebateCodePrice : Codable
{
    /**
    * Price Id
    */
    // @ApiMember(Description="Price Id")
    public var priceId:Int?

    public var priceText:String
    public var priceBeforeRebate:Double?
    public var price:Double?
    public var vat:Double?
    public var appliedCodes:[AppliedRebateCodesResponse] = []

    required public init(){}
}

public class AppliedRebateCodesResponse : Codable
{
    public var rebateCodeSign:String
    public var rebateCodeValue:Int
    public var rebateCodeType:RebateCodeTypeResponse
    public var rebateCodeId:Int
    public var rebateAmount:Double

    required public init(){}
}

public class RebateCodeTypeResponse : Codable
{
    public var id:Int
    public var name:String
    public var Description:String

    required public init(){}
}


Swift GetPricesAfterRebateCode DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /rebatecodes/prices HTTP/1.1 
Host: api.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"ServiceId":0,"RebateCodeIds":[0],"RebateCodeSigns":["String"]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"RebateCodePrices":[{"PriceId":0,"PriceText":"String","PriceBeforeRebate":0,"Price":0,"VAT":0,"AppliedCodes":[{"RebateCodeSign":"String","RebateCodeValue":0,"RebateCodeType":{"Id":0,"Name":"String","Description":"String"},"RebateCodeId":0,"RebateAmount":0}]}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}