BokaMera.API.Host

<back to all web services

CreateVossUsageTermination

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/voss/usage/{Id}/terminationCreate voss usage terminationAdd new product to company invoicing. Sends that product to VOSS System.
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.VossIntegration.ApiTools.Enums
Imports BokaMera.VossIntegration.ApiTools.Model

Namespace Global

    Namespace BokaMera.API.ServiceModel.Dtos

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

            '''<Summary>
            '''Usage Id
            '''</Summary>
            <ApiMember(Description:="Usage Id", IsRequired:=true)>
            Public Overridable Property Id As String

            Public Overridable Property InvoiceLineTexts As List(Of String) = New List(Of String)
            Public Overridable Property TerminationReasonComment As String
            Public Overridable Property TerminationReasonId As Guid
            '''<Summary>
            '''Credit behaviour:  <br /> 1. Full - usage will be credited in full  <br /> 2. None - no credit will be created
            '''</Summary>
            <ApiMember(Description:="Credit behaviour:  <br /> 1. Full - usage will be credited in full  <br /> 2. None - no credit will be created", IsRequired:=true)>
            Public Overridable Property Behaviour As UsageBehaviourEnum

            '''<Summary>
            '''Credit kind:  <br /> 1. Normal - default credit type  <br /> 2. Internal - corresponding credit will be marked as internal in invoice file line
            '''</Summary>
            <ApiMember(Description:="Credit kind:  <br /> 1. Normal - default credit type  <br /> 2. Internal - corresponding credit will be marked as internal in invoice file line", IsRequired:=true)>
            Public Overridable Property CreditKind As CreditKindEnum
        End Class
    End Namespace

    Namespace BokaMera.VossIntegration.ApiTools.Enums

        Public Enum CreditKindEnum
            Normal
            Internal
        End Enum

        Public Enum ProductTypeEnum
            Main
            Addon
            License
            Usage
        End Enum

        Public Enum UsageBehaviourEnum
            Full
            None
        End Enum
    End Namespace

    Namespace BokaMera.VossIntegration.ApiTools.Model

        <DataContract(Name:="CreateUsageTerminationResult")>
        Public Partial Class CreateUsageTerminationResult
            <DataMember(Name:="scheduledDate", IsRequired:=true)>
            Public Overridable Property ScheduledDate As Date

            <DataMember(Name:="reason")>
            Public Overridable Property Reason As SubscriptionItemTerminationReasonDto

            <DataMember(Name:="creditOptions", IsRequired:=true)>
            Public Overridable Property CreditOptions As UsageCreditOptionsDto

            <DataMember(Name:="customerBalanceChange", IsRequired:=true)>
            Public Overridable Property CustomerBalanceChange As CustomerBalanceChangeDto
        End Class

        <DataContract(Name:="CustomerBalanceChangeDto")>
        Public Partial Class CustomerBalanceChangeDto
            <DataMember(Name:="items", EmitDefaultValue:=false)>
            Public Overridable Property Items As List(Of CustomerBalanceChangeItemDto) = New List(Of CustomerBalanceChangeItemDto)

            <DataMember(Name:="totalAmount", EmitDefaultValue:=false)>
            Public Overridable Property TotalAmount As Double

            <DataMember(Name:="totalDiscountAmount", EmitDefaultValue:=false)>
            Public Overridable Property TotalDiscountAmount As Double
        End Class

        <DataContract(Name:="CustomerBalanceChangeItemDto")>
        Public Partial Class CustomerBalanceChangeItemDto
            <DataMember(Name:="type", IsRequired:=true)>
            Public Overridable Property ProductType As ProductTypeEnum

            <DataMember(Name:="id", IsRequired:=true)>
            Public Overridable Property Id As Guid

            <DataMember(Name:="name", IsRequired:=true)>
            Public Overridable Property Name As String

            <DataMember(Name:="productGroupId", IsRequired:=true)>
            Public Overridable Property ProductGroupId As Guid

            <DataMember(Name:="productGroupName", IsRequired:=true)>
            Public Overridable Property ProductGroupName As String

            <DataMember(Name:="quantity", IsRequired:=true)>
            Public Overridable Property Quantity As Double

            <DataMember(Name:="amount", IsRequired:=true)>
            Public Overridable Property Amount As Double

            <DataMember(Name:="discountAmount", IsRequired:=true)>
            Public Overridable Property DiscountAmount As Double

            <DataMember(Name:="totalAmount", EmitDefaultValue:=false)>
            Public Overridable Property TotalAmount As Double

            <DataMember(Name:="invoiceRecipientCustomerId", IsRequired:=true)>
            Public Overridable Property InvoiceRecipientCustomerId As Guid
        End Class

        <DataContract(Name:="SubscriptionItemTerminationReasonDto")>
        Public Partial Class SubscriptionItemTerminationReasonDto
            <DataMember(Name:="reasonId", IsRequired:=true)>
            Public Overridable Property ReasonId As Guid

            <DataMember(Name:="reasonName", IsRequired:=true)>
            Public Overridable Property ReasonName As String

            <DataMember(Name:="reasonExternalId")>
            Public Overridable Property ReasonExternalId As String

            <DataMember(Name:="subReasonId")>
            Public Overridable Property SubReasonId As Guid?

            <DataMember(Name:="subReasonName")>
            Public Overridable Property SubReasonName As String

            <DataMember(Name:="subReasonExternalId")>
            Public Overridable Property SubReasonExternalId As String

            <DataMember(Name:="comment", IsRequired:=true)>
            Public Overridable Property Comment As String
        End Class

        <DataContract(Name:="UsageCreditOptionsDto")>
        Public Partial Class UsageCreditOptionsDto
            <DataMember(Name:="behaviour", IsRequired:=true)>
            Public Overridable Property UsageBehaviour As UsageBehaviourEnum

            <DataMember(Name:="creditKind", IsRequired:=true)>
            Public Overridable Property CreditKind As CreditKindEnum
        End Class
    End Namespace
End Namespace

VB.NET CreateVossUsageTermination 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 /voss/usage/{Id}/termination HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Id":"String","InvoiceLineTexts":["String"],"TerminationReasonComment":"String","Behaviour":"Full","CreditKind":"Normal"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{}