BokaMera.API.Host

<back to all web services

CreateVossUsage

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/voss/usageAdd product to company invoicingAdd 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

    type ProductGroupTypeEnum =
        | Optional = 0
        | Included = 1

    type StatusEnum =
        | Active = 0
        | Terminated = 1

    [<DataContract(Name="SubscriptionProductGroupProductResultDto")>]
    [<AllowNullLiteral>]
    type SubscriptionProductGroupProductResultDto() = 
        [<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="externalId")>]
        member val ExternalId:String = null with get,set

        [<DataMember(Name="articleNumber", IsRequired=true)>]
        member val ArticleNumber:String = null with get,set

    type TypeEnum =
        | AtSubscriptionBillingPeriodEnd = 0
        | AtBindingPeriodEnd = 1
        | Immediately = 2

    type SourceEnum =
        | Direct = 0
        | Plan = 1
        | CustomerExpiration = 2
        | Update = 3
        | Unpaid = 4

    [<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 SubscriptionBehaviourEnum =
        | Prorate = 0
        | Full = 1
        | None = 2

    type CreditKindEnum =
        | Normal = 0
        | Internal = 1

    [<DataContract(Name="CreditOptionsDto")>]
    [<AllowNullLiteral>]
    type CreditOptionsDto() = 
        [<DataMember(Name="behaviour", IsRequired=true)>]
        member val SubscriptionBehaviour:SubscriptionBehaviourEnum = new SubscriptionBehaviourEnum() with get,set

        [<DataMember(Name="creditKind", IsRequired=true)>]
        member val CreditKind:CreditKindEnum = new CreditKindEnum() with get,set

        [<DataMember(Name="prorateTimeAnchor")>]
        member val ProrateTimeAnchor:Nullable<DateTime> = new Nullable<DateTime>() with get,set

    [<DataContract(Name="SubscriptionItemTerminationDto")>]
    [<AllowNullLiteral>]
    type SubscriptionItemTerminationDto() = 
        [<DataMember(Name="type")>]
        member val Type:TypeEnum = new TypeEnum() with get,set

        [<DataMember(Name="source", IsRequired=true)>]
        member val Source:SourceEnum = new SourceEnum() with get,set

        [<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:CreditOptionsDto = null 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="CreateSubscriptionProductGroupResult")>]
    [<AllowNullLiteral>]
    type CreateSubscriptionProductGroupResult() = 
        [<DataMember(Name="productGroupType", IsRequired=true)>]
        member val ProductGroupType:ProductGroupTypeEnum = new ProductGroupTypeEnum() with get,set

        [<DataMember(Name="status", IsRequired=true)>]
        member val Status:StatusEnum = new StatusEnum() 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="products", EmitDefaultValue=false)>]
        member val Products:ResizeArray<SubscriptionProductGroupProductResultDto> = null with get,set

        [<DataMember(Name="termination")>]
        member val Termination:SubscriptionItemTerminationDto = null with get,set

        [<DataMember(Name="created", IsRequired=true)>]
        member val Created:DateTime = new DateTime() 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 CreateVossUsage() = 
        ///<summary>
        ///The company id
        ///</summary>
        [<ApiMember(Description="The company id", IsRequired=true)>]
        member val CompanyId:Guid = new Guid() with get,set

        ///<summary>
        ///Article number. Can be fetched from products
        ///</summary>
        [<ApiMember(Description="Article number. Can be fetched from products", IsRequired=true)>]
        member val ArticleNumber:String = null with get,set

        ///<summary>
        ///Example: developer worked 6 hours
        ///</summary>
        [<ApiMember(Description="Example: developer worked 6 hours", IsRequired=true)>]
        member val Quantity:Int32 = new Int32() with get,set

F# CreateVossUsage DTOs

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

HTTP + OTHER

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

POST /voss/usage HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"ArticleNumber":"String","Quantity":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"productGroupType":"Optional","status":"Active","name":"String","products":[{}]}