BokaMera.API.Host

<back to all web services

UpdateVossSubscriptions

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/voss/subscriptionsPUT voss subscription
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
using VossIntegration.ApiTools.Model;
using VossIntegration.ApiTools.Enums;

namespace BokaMera.API.ServiceModel.Dtos
{
    [ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
    public partial class UpdateVossSubscriptions
    {
        public UpdateVossSubscriptions()
        {
            DiscountAgreements = new List<SubscriptionDiscountAgreementRequestDto>{};
        }

        ///<summary>
        ///The company id. Subscription will be fetched of this company
        ///</summary>
        [ApiMember(Description="The company id. Subscription will be fetched of this company")]
        public virtual Guid CompanyId { get; set; }

        ///<summary>
        ///Discount agreement data
        ///</summary>
        [ApiMember(Description="Discount agreement data")]
        public virtual List<SubscriptionDiscountAgreementRequestDto> DiscountAgreements { get; set; }

        ///<summary>
        ///    Discount agreements change type controls how already occured transactions are treated <br />Retrospective - all future and past not invoiced transactions will be recalculated with new discount agreements  <br />Prospective - discounts will apply only for future transactions
        ///</summary>
        [ApiMember(Description="    Discount agreements change type controls how already occured transactions are treated <br />Retrospective - all future and past not invoiced transactions will be recalculated with new discount agreements  <br />Prospective - discounts will apply only for future transactions\n")]
        public virtual DiscountAgreementsChangeTypeEnum DiscountAgreementsChangeType { get; set; }

        ///<summary>
        ///The company id. Subscription will be fetched of this company
        ///</summary>
        [ApiMember(Description="The company id. Subscription will be fetched of this company")]
        public virtual int CompanyOwnerId { get; set; }
    }

}

namespace VossIntegration.ApiTools.Enums
{
    public enum PeriodKindEnum
    {
        FixedTime,
        AlignedToBindingPeriod,
        AlignedToSubscriptionBillingPeriod,
    }

}

namespace VossIntegration.ApiTools.Model
{
    [DataContract(Name="DiscountAgreementTimeLengthRequestDto")]
    public partial class DiscountAgreementTimeLengthRequestDto
    {
        [DataMember(Name="unit", IsRequired=true)]
        public virtual UnitEnum Unit { get; set; }

        [DataMember(Name="value", IsRequired=true)]
        public virtual int Value { get; set; }
        public enum UnitEnum
        {
            Day,
            Month,
            Year,
        }

    }

    [DataContract(Name="SubscriptionDiscountAgreementRequestDto")]
    public partial class SubscriptionDiscountAgreementRequestDto
    {
        [DataMember(Name="discountAgreementId", IsRequired=true)]
        public virtual Guid DiscountAgreementId { get; set; }

        [DataMember(Name="period")]
        public virtual SubscriptionDiscountPeriodRequestDto Period { get; set; }
    }

    [DataContract(Name="SubscriptionDiscountPeriodRequestDto")]
    public partial class SubscriptionDiscountPeriodRequestDto
    {
        [DataMember(Name="periodKind", IsRequired=true)]
        public virtual PeriodKindEnum PeriodKind { get; set; }

        [DataMember(Name="length")]
        public virtual DiscountAgreementTimeLengthRequestDto Length { get; set; }

        [DataMember(Name="periodIterationCount")]
        public virtual int? PeriodIterationCount { get; set; }
    }

}

C# UpdateVossSubscriptions 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.

PUT /voss/subscriptions HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"DiscountAgreements":[{}],"DiscountAgreementsChangeType":"Prospective","CompanyOwnerId":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{}