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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateServicePrice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <CalculationTypeId>0</CalculationTypeId>
  <Category>String</Category>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CurrencyId>String</CurrencyId>
  <DaysOfWeek xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </DaysOfWeek>
  <From>0001-01-01T00:00:00</From>
  <FromTime>PT0S</FromTime>
  <Id>0</Id>
  <Price>0</Price>
  <To>0001-01-01T00:00:00</To>
  <ToTime>PT0S</ToTime>
  <VAT>0</VAT>
</UpdateServicePrice>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ServicePriceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <CalculationTypeId>0</CalculationTypeId>
  <Category>String</Category>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CurrencyId>String</CurrencyId>
  <DaysOfWeek>
    <DayOfWeekDto>
      <DayOfWeek>String</DayOfWeek>
      <DayOfWeekId>0</DayOfWeekId>
      <DotNetDayOfWeekId>0</DotNetDayOfWeekId>
    </DayOfWeekDto>
  </DaysOfWeek>
  <From>0001-01-01T00:00:00</From>
  <FromTime>PT0S</FromTime>
  <Id>0</Id>
  <IsDaysOfWeekSpecific>false</IsDaysOfWeekSpecific>
  <IsTimeSpecific>false</IsTimeSpecific>
  <Price>0</Price>
  <PriceSign>String</PriceSign>
  <PriceText>String</PriceText>
  <Service>
    <Description>String</Description>
    <GroupBooking>
      <Active>false</Active>
      <Max>0</Max>
      <Min>0</Min>
    </GroupBooking>
    <Id>0</Id>
    <ImageUrl i:nil="true" />
    <IsGroupBooking>false</IsGroupBooking>
    <IsPaymentEnabled>false</IsPaymentEnabled>
    <LengthInMinutes>0</LengthInMinutes>
    <MaxNumberOfSpotsPerBooking>0</MaxNumberOfSpotsPerBooking>
    <MinNumberOfSpotsPerBooking>0</MinNumberOfSpotsPerBooking>
    <MultipleResource>
      <Active>false</Active>
      <Max>0</Max>
      <Min>0</Min>
    </MultipleResource>
    <Name>String</Name>
  </Service>
  <ServiceId>0</ServiceId>
  <To>0001-01-01T00:00:00</To>
  <ToTime>PT0S</ToTime>
  <VAT>0</VAT>
</ServicePriceResponse>