BokaMera.API.Host

<back to all web services

UpdateServicePrice

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/services/prices/{Id}Update a priceUpdate a price on a service
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos

Namespace Global

    Namespace BokaMera.API.ServiceModel.Dtos

        Public Partial Class DayOfWeekDto
            Public Overridable Property DayOfWeekId As Integer
            Public Overridable Property DotNetDayOfWeekId As Integer
            Public Overridable Property DayOfWeek As String
        End Class

        Public Partial Class GroupBookingSettings
            Public Overridable Property Active As Boolean
            Public Overridable Property Min As Integer
            Public Overridable Property Max As Integer
        End Class

        Public Partial Class MultipleResourceSettings
            Public Overridable Property Active As Boolean
            Public Overridable Property Min As Integer
            Public Overridable Property Max As Integer
        End Class

        Public Partial Class ServiceInfoResponse
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Description As String
            Public Overridable Property ImageUrl As Uri
            Public Overridable Property LengthInMinutes As Nullable(Of Integer)
            Public Overridable Property MaxNumberOfSpotsPerBooking As Integer
            Public Overridable Property MinNumberOfSpotsPerBooking As Integer
            Public Overridable Property GroupBooking As GroupBookingSettings
            Public Overridable Property MultipleResource As MultipleResourceSettings
            Public Overridable Property IsGroupBooking As Boolean
            Public Overridable Property IsPaymentEnabled As Boolean
        End Class

        Public Partial Class ServicePriceResponse
            Public Sub New()
                DaysOfWeek = New List(Of DayOfWeekDto)
            End Sub

            '''<Summary>
            '''The company id
            '''</Summary>
            <ApiMember(Description:="The company id")>
            Public Overridable Property CompanyId As Guid

            '''<Summary>
            '''The price id
            '''</Summary>
            <ApiMember(Description:="The price id")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''The service id
            '''</Summary>
            <ApiMember(Description:="The service id")>
            Public Overridable Property ServiceId As Integer

            '''<Summary>
            '''The price
            '''</Summary>
            <ApiMember(Description:="The price")>
            Public Overridable Property Price As Double

            '''<Summary>
            '''The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day
            '''</Summary>
            <ApiMember(Description:="The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day")>
            Public Overridable Property CalculationTypeId As Integer

            '''<Summary>
            '''The price currency
            '''</Summary>
            <ApiMember(Description:="The price currency")>
            Public Overridable Property CurrencyId As String

            '''<Summary>
            '''The price sign
            '''</Summary>
            <ApiMember(Description:="The price sign")>
            Public Overridable Property PriceSign As String

            '''<Summary>
            '''The price VAT in percent
            '''</Summary>
            <ApiMember(Description:="The price VAT in percent")>
            Public Overridable Property VAT As Decimal

            '''<Summary>
            '''The price category if price has a category
            '''</Summary>
            <ApiMember(Description:="The price category if price has a category")>
            Public Overridable Property Category As String

            '''<Summary>
            '''The price text to display
            '''</Summary>
            <ApiMember(Description:="The price text to display")>
            Public Overridable Property PriceText As String

            '''<Summary>
            '''The valid from date for the price.
            '''</Summary>
            <ApiMember(Description:="The valid from date for the price.")>
            Public Overridable Property From As Date

            '''<Summary>
            '''The valid to date for the price.
            '''</Summary>
            <ApiMember(Description:="The valid to date for the price.")>
            Public Overridable Property To As Date

            '''<Summary>
            '''If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")>
            Public Overridable Property DaysOfWeek As List(Of DayOfWeekDto)

            '''<Summary>
            '''If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")>
            Public Overridable Property FromTime As Nullable(Of TimeSpan)

            '''<Summary>
            '''If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")>
            Public Overridable Property ToTime As Nullable(Of TimeSpan)

            Public Overridable Property Service As ServiceInfoResponse
            '''<Summary>
            '''If the price is only valid for a specific time span
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for a specific time span")>
            Public Overridable Property IsTimeSpecific As Boolean

            '''<Summary>
            '''If the price is only valid for specific days of week
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for specific days of week")>
            Public Overridable Property IsDaysOfWeekSpecific As Boolean
        End Class

        <ValidateRequest(Validator:="IsAuthenticated")>
        Public Partial Class UpdateServicePrice
            Implements ICompany
            Public Sub New()
                DaysOfWeek = New Integer(){}
            End Sub

            '''<Summary>
            '''The company id, if empty will use the company id for the user you are logged in with.
            '''</Summary>
            <ApiMember(Description:="The company id, if empty will use the company id for the user you are logged in with.")>
            Public Overridable Property CompanyId As Nullable(Of Guid)

            '''<Summary>
            '''Id of the price
            '''</Summary>
            <ApiMember(Description:="Id of the price", IsRequired:=true, ParameterType:="path")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''The price
            '''</Summary>
            <ApiMember(Description:="The price")>
            Public Overridable Property Price As Double

            '''<Summary>
            '''The price currency
            '''</Summary>
            <ApiMember(Description:="The price currency")>
            Public Overridable Property CurrencyId As String

            '''<Summary>
            '''The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day
            '''</Summary>
            <ApiMember(Description:="The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day")>
            Public Overridable Property CalculationTypeId As Integer

            '''<Summary>
            '''The price VAT in percent
            '''</Summary>
            <ApiMember(Description:="The price VAT in percent")>
            Public Overridable Property VAT As Decimal

            '''<Summary>
            '''The price category if price has a category
            '''</Summary>
            <ApiMember(Description:="The price category if price has a category")>
            Public Overridable Property Category As String

            '''<Summary>
            '''The valid from date for the price.
            '''</Summary>
            <ApiMember(Description:="The valid from date for the price.")>
            Public Overridable Property From As Date

            '''<Summary>
            '''The valid to date for the price.
            '''</Summary>
            <ApiMember(Description:="The valid to date for the price.")>
            Public Overridable Property To As Date

            '''<Summary>
            '''If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")>
            Public Overridable Property DaysOfWeek As Integer()

            '''<Summary>
            '''If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")>
            Public Overridable Property FromTime As Nullable(Of TimeSpan)

            '''<Summary>
            '''If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
            '''</Summary>
            <ApiMember(Description:="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")>
            Public Overridable Property ToTime As Nullable(Of TimeSpan)
        End Class
    End Namespace
End Namespace

VB.NET UpdateServicePrice DTOs

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

HTTP + JSV

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

PUT /services/prices/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	Id: 0,
	Price: 0,
	CurrencyId: String,
	CalculationTypeId: 0,
	VAT: 0,
	Category: String,
	DaysOfWeek: 
	[
		0
	],
	FromTime: PT0S,
	ToTime: PT0S
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	ServiceId: 0,
	Price: 0,
	CalculationTypeId: 0,
	CurrencyId: String,
	PriceSign: String,
	VAT: 0,
	Category: String,
	PriceText: String,
	DaysOfWeek: 
	[
		{
			DayOfWeekId: 0,
			DotNetDayOfWeekId: 0,
			DayOfWeek: String
		}
	],
	FromTime: PT0S,
	ToTime: PT0S,
	Service: 
	{
		Id: 0,
		Name: String,
		Description: String,
		LengthInMinutes: 0,
		MaxNumberOfSpotsPerBooking: 0,
		MinNumberOfSpotsPerBooking: 0,
		GroupBooking: 
		{
			Active: False,
			Min: 0,
			Max: 0
		},
		MultipleResource: 
		{
			Active: False,
			Min: 0,
			Max: 0
		},
		IsGroupBooking: False,
		IsPaymentEnabled: False
	},
	IsTimeSpecific: False,
	IsDaysOfWeekSpecific: False
}