| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| POST | /voss/usage/{Id}/termination | Create voss usage termination | Add new product to company invoicing. Sends that product to VOSS System. |
|---|
namespace BokaMera.API.ServiceModel.Dtos
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<DataContract(Name="SubscriptionItemTerminationReasonDto")>]
[<AllowNullLiteral>]
type SubscriptionItemTerminationReasonDto() =
[<DataMember(Name="reasonId", IsRequired=true)>]
member val ReasonId:Guid = new Guid() with get,set
[<DataMember(Name="reasonName", IsRequired=true)>]
member val ReasonName:String = null with get,set
[<DataMember(Name="reasonExternalId")>]
member val ReasonExternalId:String = null with get,set
[<DataMember(Name="subReasonId")>]
member val SubReasonId:Nullable<Guid> = new Nullable<Guid>() with get,set
[<DataMember(Name="subReasonName")>]
member val SubReasonName:String = null with get,set
[<DataMember(Name="subReasonExternalId")>]
member val SubReasonExternalId:String = null with get,set
[<DataMember(Name="comment", IsRequired=true)>]
member val Comment:String = null with get,set
type UsageBehaviourEnum =
| Full = 0
| None = 1
type CreditKindEnum =
| Normal = 0
| Internal = 1
[<DataContract(Name="UsageCreditOptionsDto")>]
[<AllowNullLiteral>]
type UsageCreditOptionsDto() =
[<DataMember(Name="behaviour", IsRequired=true)>]
member val UsageBehaviour:UsageBehaviourEnum = new UsageBehaviourEnum() with get,set
[<DataMember(Name="creditKind", IsRequired=true)>]
member val CreditKind:CreditKindEnum = new CreditKindEnum() with get,set
type ProductTypeEnum =
| Main = 0
| Addon = 1
| License = 2
| Usage = 3
[<DataContract(Name="CustomerBalanceChangeItemDto")>]
[<AllowNullLiteral>]
type CustomerBalanceChangeItemDto() =
[<DataMember(Name="type", IsRequired=true)>]
member val ProductType:ProductTypeEnum = new ProductTypeEnum() with get,set
[<DataMember(Name="id", IsRequired=true)>]
member val Id:Guid = new Guid() with get,set
[<DataMember(Name="name", IsRequired=true)>]
member val Name:String = null with get,set
[<DataMember(Name="productGroupId", IsRequired=true)>]
member val ProductGroupId:Guid = new Guid() with get,set
[<DataMember(Name="productGroupName", IsRequired=true)>]
member val ProductGroupName:String = null with get,set
[<DataMember(Name="quantity", IsRequired=true)>]
member val Quantity:Double = new Double() with get,set
[<DataMember(Name="amount", IsRequired=true)>]
member val Amount:Double = new Double() with get,set
[<DataMember(Name="discountAmount", IsRequired=true)>]
member val DiscountAmount:Double = new Double() with get,set
[<DataMember(Name="totalAmount", EmitDefaultValue=false)>]
member val TotalAmount:Double = new Double() with get,set
[<DataMember(Name="invoiceRecipientCustomerId", IsRequired=true)>]
member val InvoiceRecipientCustomerId:Guid = new Guid() with get,set
[<DataContract(Name="CustomerBalanceChangeDto")>]
[<AllowNullLiteral>]
type CustomerBalanceChangeDto() =
[<DataMember(Name="items", EmitDefaultValue=false)>]
member val Items:ResizeArray<CustomerBalanceChangeItemDto> = null with get,set
[<DataMember(Name="totalAmount", EmitDefaultValue=false)>]
member val TotalAmount:Double = new Double() with get,set
[<DataMember(Name="totalDiscountAmount", EmitDefaultValue=false)>]
member val TotalDiscountAmount:Double = new Double() with get,set
[<DataContract(Name="CreateUsageTerminationResult")>]
[<AllowNullLiteral>]
type CreateUsageTerminationResult() =
[<DataMember(Name="scheduledDate", IsRequired=true)>]
member val ScheduledDate:DateTime = new DateTime() with get,set
[<DataMember(Name="reason")>]
member val Reason:SubscriptionItemTerminationReasonDto = null with get,set
[<DataMember(Name="creditOptions", IsRequired=true)>]
member val CreditOptions:UsageCreditOptionsDto = null with get,set
[<DataMember(Name="customerBalanceChange", IsRequired=true)>]
member val CustomerBalanceChange:CustomerBalanceChangeDto = null with get,set
[<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
[<ValidateRequest(Validator="IsAuthenticated")>]
[<AllowNullLiteral>]
type CreateVossUsageTermination() =
///<summary>
///The company id
///</summary>
[<ApiMember(Description="The company id", IsRequired=true)>]
member val CompanyId:Guid = new Guid() with get,set
///<summary>
///Usage Id
///</summary>
[<ApiMember(Description="Usage Id", IsRequired=true)>]
member val Id:String = null with get,set
member val InvoiceLineTexts:ResizeArray<String> = null with get,set
member val TerminationReasonComment:String = null with get,set
member val TerminationReasonId:Guid = new Guid() with get,set
///<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)>]
member val Behaviour:UsageBehaviourEnum = new UsageBehaviourEnum() with get,set
///<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)>]
member val CreditKind:CreditKindEnum = new CreditKindEnum() with get,set
F# CreateVossUsageTermination 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
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: application/json
Content-Type: application/json
Content-Length: length
{"Id":"String","InvoiceLineTexts":["String"],"TerminationReasonComment":"String","Behaviour":"Full","CreditKind":"Normal"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{}