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
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos

Namespace Global

    Namespace BokaMera.API.ServiceModel.Dtos

        Public Partial Class AppliedRebateCodesResponse
            Public Overridable Property RebateCodeSign As String
            Public Overridable Property RebateCodeValue As Integer
            Public Overridable Property RebateCodeType As RebateCodeTypeResponse
            Public Overridable Property RebateCodeId As Integer
            Public Overridable Property RebateAmount As Double
        End Class

        <ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
        <ValidateRequest(Validator:="IsAuthenticated")>
        Public Partial Class GetPricesAfterRebateCode
            Public Sub New()
                RebateCodeIds = New List(Of Integer)
                RebateCodeSigns = New List(Of String)
            End Sub

            '''<Summary>
            '''
            '''</Summary>
            <ApiMember(Description:="", IsRequired:=true)>
            Public Overridable Property CompanyId As Guid

            '''<Summary>
            '''The service you want to get the prices with rebates on
            '''</Summary>
            <ApiMember(Description:="The service you want to get the prices with rebates on")>
            Public Overridable Property ServiceId As Nullable(Of Integer)

            '''<Summary>
            '''Provide this if you like to the prices with rebate code ids
            '''</Summary>
            <ApiMember(Description:="Provide this if you like to the prices with rebate code ids")>
            Public Overridable Property RebateCodeIds As List(Of Integer)

            '''<Summary>
            '''Provide this if you like to the prices with rebate code signs instead of ids
            '''</Summary>
            <ApiMember(Description:="Provide this if you like to the prices with rebate code signs instead of ids")>
            Public Overridable Property RebateCodeSigns As List(Of String)

            '''<Summary>
            '''Provide this if you like to calculate the prices with the provided datetime
            '''</Summary>
            <ApiMember(Description:="Provide this if you like to calculate the prices with the provided datetime", IsRequired:=true)>
            Public Overridable Property DateFrom As Date
        End Class

        Public Partial Class RebateCodePrice
            Public Sub New()
                AppliedCodes = New List(Of AppliedRebateCodesResponse)
            End Sub

            '''<Summary>
            '''Price Id
            '''</Summary>
            <ApiMember(Description:="Price Id")>
            Public Overridable Property PriceId As Nullable(Of Integer)

            Public Overridable Property PriceText As String
            Public Overridable Property PriceBeforeRebate As Nullable(Of Double)
            Public Overridable Property Price As Nullable(Of Double)
            Public Overridable Property VAT As Nullable(Of Decimal)
            Public Overridable Property AppliedCodes As List(Of AppliedRebateCodesResponse)
        End Class

        Public Partial Class RebateCodePriceResponse
            Public Sub New()
                RebateCodePrices = New List(Of RebateCodePrice)
            End Sub

            Public Overridable Property RebateCodePrices As List(Of RebateCodePrice)
            Public Overridable Property ResponseStatus As ResponseStatus
        End Class

        Public Partial Class RebateCodeTypeResponse
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Description As String
        End Class
    End Namespace
End Namespace

VB.NET 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"}}}