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
import Foundation
import ServiceStack

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
public class UpdateVossSubscriptions : Codable
{
    /**
    * The company id. Subscription will be fetched of this company
    */
    // @ApiMember(Description="The company id. Subscription will be fetched of this company")
    public var companyId:String

    /**
    * Discount agreement data
    */
    // @ApiMember(Description="Discount agreement data")
    public var discountAgreements:[SubscriptionDiscountAgreementRequestDto] = []

    /**
    *     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
    */
    // @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 var discountAgreementsChangeType:DiscountAgreementsChangeTypeEnum

    /**
    * The company id. Subscription will be fetched of this company
    */
    // @ApiMember(Description="The company id. Subscription will be fetched of this company")
    public var companyOwnerId:Int

    required public init(){}
}

// @DataContract(Name="SubscriptionDiscountAgreementRequestDto")
public class SubscriptionDiscountAgreementRequestDto : Codable
{
    // @DataMember(Name="discountAgreementId", IsRequired=true)
    public var discountAgreementId:String

    // @DataMember(Name="period")
    public var period:SubscriptionDiscountPeriodRequestDto

    required public init(){}
}

// @DataContract(Name="SubscriptionDiscountPeriodRequestDto")
public class SubscriptionDiscountPeriodRequestDto : Codable
{
    // @DataMember(Name="periodKind", IsRequired=true)
    public var periodKind:PeriodKindEnum

    // @DataMember(Name="length")
    public var length:DiscountAgreementTimeLengthRequestDto

    // @DataMember(Name="periodIterationCount")
    public var periodIterationCount:Int?

    required public init(){}
}

public enum PeriodKindEnum : String, Codable
{
    case FixedTime
    case AlignedToBindingPeriod
    case AlignedToSubscriptionBillingPeriod
}

// @DataContract(Name="DiscountAgreementTimeLengthRequestDto")
public class DiscountAgreementTimeLengthRequestDto : Codable
{
    // @DataMember(Name="unit", IsRequired=true)
    public var unit:UnitEnum

    // @DataMember(Name="value", IsRequired=true)
    public var value:Int

    required public init(){}
}

public enum UnitEnum : String, Codable
{
    case Day
    case Month
    case Year
}

public enum DiscountAgreementsChangeTypeEnum : String, Codable
{
    case Prospective
    case Retrospective
}


Swift 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

{}