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 java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*


@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
open class UpdateVossSubscriptions
{
    /**
    * The company id. Subscription will be fetched of this company
    */
    @ApiMember(Description="The company id. Subscription will be fetched of this company")
    var CompanyId:UUID? = null

    /**
    * Discount agreement data
    */
    @ApiMember(Description="Discount agreement data")
    var DiscountAgreements:ArrayList<SubscriptionDiscountAgreementRequestDto> = ArrayList<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")
    var DiscountAgreementsChangeType:DiscountAgreementsChangeTypeEnum? = null

    /**
    * The company id. Subscription will be fetched of this company
    */
    @ApiMember(Description="The company id. Subscription will be fetched of this company")
    var CompanyOwnerId:Int? = null
}

@DataContract(Name="SubscriptionDiscountAgreementRequestDto")
open class SubscriptionDiscountAgreementRequestDto
{
    @DataMember(Name="discountAgreementId", IsRequired=true)
    @SerializedName("discountAgreementId")
    var DiscountAgreementId:UUID? = null

    @DataMember(Name="period")
    @SerializedName("period")
    var Period:SubscriptionDiscountPeriodRequestDto? = null
}

@DataContract(Name="SubscriptionDiscountPeriodRequestDto")
open class SubscriptionDiscountPeriodRequestDto
{
    @DataMember(Name="periodKind", IsRequired=true)
    @SerializedName("periodKind")
    var PeriodKind:PeriodKindEnum? = null

    @DataMember(Name="length")
    @SerializedName("length")
    var Length:DiscountAgreementTimeLengthRequestDto? = null

    @DataMember(Name="periodIterationCount")
    @SerializedName("periodIterationCount")
    var PeriodIterationCount:Int? = null
}

enum class PeriodKindEnum
{
    FixedTime,
    AlignedToBindingPeriod,
    AlignedToSubscriptionBillingPeriod,
}

@DataContract(Name="DiscountAgreementTimeLengthRequestDto")
open class DiscountAgreementTimeLengthRequestDto
{
    @DataMember(Name="unit", IsRequired=true)
    @SerializedName("unit")
    var Unit:UnitEnum? = null

    @DataMember(Name="value", IsRequired=true)
    @SerializedName("value")
    var Value:Int? = null
}

enum class UnitEnum
{
    Day,
    Month,
    Year,
}

enum class DiscountAgreementsChangeTypeEnum
{
    Prospective,
    Retrospective,
}

Kotlin 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

{}