BokaMera.API.Host

<back to all web services

CreateRebateCodeTransaction

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/rebatecodes/transactionsCreate transaction for the rebate codeCreate transaction for the rebate code
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.API.ServiceModel.Enums

Namespace Global

    Namespace BokaMera.API.ServiceModel.Dtos

        <ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
        <ValidateRequest(Validator:="IsAuthenticated")>
        Public Partial Class CreateRebateCodeTransaction
            '''<Summary>
            '''
            '''</Summary>
            <ApiMember(Description:="", IsRequired:=true)>
            Public Overridable Property CompanyId As Nullable(Of Guid)

            '''<Summary>
            '''Rebate code id to which you wish to add transaction
            '''</Summary>
            <ApiMember(Description:="Rebate code id to which you wish to add transaction", IsRequired:=true)>
            Public Overridable Property RebateCodeId As Integer

            <ApiMember(IsRequired:=true)>
            Public Overridable Property Amount As Double

            <ApiMember(IsRequired:=true)>
            Public Overridable Property Usage As Integer

            <ApiMember>
            Public Overridable Property BookingId As Nullable(Of Integer)

            '''<Summary>
            '''If you want to Increase = 0 or Decrease = 1 the value
            '''</Summary>
            <ApiMember(Description:="If you want to Increase = 0 or Decrease = 1 the value", IsRequired:=true)>
            Public Overridable Property ChangeType As AmountChangeType
        End Class

        Public Partial Class RebateCodeCustomerResponse
            Public Overridable Property Id As Guid
            Public Overridable Property Firstname As String
            Public Overridable Property Lastname As String
            Public Overridable Property Email As String
            Public Overridable Property Phone As String
            Public Overridable Property ImageUrl As String
        End Class

        Public Partial Class RebateCodeServiceResponse
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Description As String
            Public Overridable Property Active As Boolean
        End Class

        Public Partial Class RebateCodeTransactionQueryResponse
            Public Overridable Property Id As Integer
            Public Overridable Property CompanyId As Guid
            Public Overridable Property Note As String
            Public Overridable Property RebateCodeId As Integer
            Public Overridable Property RebateCodeSign As String
            Public Overridable Property RebateCodeTypeId As Nullable(Of Integer)
            Public Overridable Property RebateCodeTypeName As String
            Public Overridable Property Amount As Double
            Public Overridable Property BookingId As Nullable(Of Integer)
            Public Overridable Property UpdatedDate As Date
            Public Overridable Property CreatedDate As Date
            Public Overridable Property Service As RebateCodeServiceResponse
            Public Overridable Property Customer As RebateCodeCustomerResponse
            Public Overridable Property PriceSign As String
        End Class

        Public Partial Class RebateCodeTransactionResponse
            Public Overridable Property ResponseStatus As ResponseStatus
            Public Overridable Property RebateCodeTransactionItem As RebateCodeTransactionQueryResponse
        End Class
    End Namespace

    Namespace BokaMera.API.ServiceModel.Enums

        Public Enum AmountChangeType
            Increase
            Decrease
        End Enum
    End Namespace
End Namespace

VB.NET CreateRebateCodeTransaction DTOs

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

HTTP + CSV

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

POST /rebatecodes/transactions HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","RebateCodeId":0,"Amount":0,"Usage":0,"BookingId":0,"ChangeType":"Increase"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"RebateCodeTransactionItem":{"Id":0,"Note":"String","RebateCodeId":0,"RebateCodeSign":"String","RebateCodeTypeId":0,"RebateCodeTypeName":"String","Amount":0,"BookingId":0,"Service":{"Id":0,"Name":"String","Description":"String","Active":false},"Customer":{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","ImageUrl":"String"},"PriceSign":"String"}}