| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| PUT | /voss/subscriptions | PUT voss subscription |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
using BokaMera.VossIntegration.ApiTools.Model;
using BokaMera.VossIntegration.ApiTools.Enums;
namespace BokaMera.API.ServiceModel.Dtos
{
[ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
public partial class UpdateVossSubscriptions
{
///<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 BokaMera.VossIntegration.ApiTools.Enums
{
public enum PeriodKindEnum
{
FixedTime,
AlignedToBindingPeriod,
AlignedToSubscriptionBillingPeriod,
}
}
namespace BokaMera.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 .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.
PUT /voss/subscriptions HTTP/1.1
Host: api.bokamera.se
Accept: application/json
Content-Type: application/json
Content-Length: length
{"DiscountAgreements":[{}],"DiscountAgreementsChangeType":"Prospective","CompanyOwnerId":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{}