BokaMera.API.Host

<back to all web services

UpdateBookingReservation

The following routes are available for this service:
PUT/bookingreservations/{SessionKey}Update a booking reservationUpdates an existing reservation identified by its session key. If the slot (From/To) changes the availability is re-checked for the new slot and the hold expiration is recomputed.
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.API.ServiceModel.Dtos.Commons
Imports BokaMera.API.ServiceModel.Enums

Namespace Global

    Namespace BokaMera.API.ServiceModel.Dtos

        Public Partial Class AddCustomField
            Public Overridable Property Id As Integer
            Public Overridable Property Value As String
        End Class

        Public Partial Class ArticleToCreateBase
            Public Overridable Property ArticleId As Integer
            Public Overridable Property Quantity As Integer
        End Class

        Public Partial Class BookingReservationResponse
            '''<Summary>
            '''The opaque session key that identifies the reservation.
            '''</Summary>
            <ApiMember(Description:="The opaque session key that identifies the reservation.")>
            Public Overridable Property SessionKey As Guid

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

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

            '''<Summary>
            '''The reservation start.
            '''</Summary>
            <ApiMember(Description:="The reservation start.")>
            Public Overridable Property From As Date

            '''<Summary>
            '''The reservation end.
            '''</Summary>
            <ApiMember(Description:="The reservation end.")>
            Public Overridable Property [To] As Date

            '''<Summary>
            '''The BookingReservationStatus value.
            '''</Summary>
            <ApiMember(Description:="The BookingReservationStatus value.")>
            Public Overridable Property StatusCode As Integer

            '''<Summary>
            '''The BookingReservationStatus name.
            '''</Summary>
            <ApiMember(Description:="The BookingReservationStatus name.")>
            Public Overridable Property StatusName As String

            '''<Summary>
            '''When the hold expires (company-local time).
            '''</Summary>
            <ApiMember(Description:="When the hold expires (company-local time).")>
            Public Overridable Property ExpirationDatetime As Date

            '''<Summary>
            '''Number of reserved spots.
            '''</Summary>
            <ApiMember(Description:="Number of reserved spots.")>
            Public Overridable Property NumberOfBookedSpots As Integer

            '''<Summary>
            '''The computed price of the reservation, if any.
            '''</Summary>
            <ApiMember(Description:="The computed price of the reservation, if any.")>
            Public Overridable Property Price As Decimal?

            '''<Summary>
            '''The currency of the price, if any.
            '''</Summary>
            <ApiMember(Description:="The currency of the price, if any.")>
            Public Overridable Property CurrencyId As String

            '''<Summary>
            '''Ids of the resources held by the reservation.
            '''</Summary>
            <ApiMember(Description:="Ids of the resources held by the reservation.")>
            Public Overridable Property ResourceIds As List(Of Integer) = New List(Of Integer)

            '''<Summary>
            '''The full in-progress selection payload (wizard/session state) as JSON.
            '''</Summary>
            <ApiMember(Description:="The full in-progress selection payload (wizard/session state) as JSON.")>
            Public Overridable Property SelectionPayload As String

            Public Overridable Property ResponseStatus As ResponseStatus
        End Class

        Public Partial Class CustomerToHandle
            Inherits CustomerBase
        End Class

        Public Partial Class InvoiceAddressToHandle
            Implements IInvoiceAddress
            Public Overridable Property CorporateIdentityNumber As String Implements IInvoiceAddress.CorporateIdentityNumber
            Public Overridable Property InvoiceAddress1 As String Implements IInvoiceAddress.InvoiceAddress1
            Public Overridable Property InvoiceAddress2 As String Implements IInvoiceAddress.InvoiceAddress2
            Public Overridable Property InvoiceCity As String Implements IInvoiceAddress.InvoiceCity
            Public Overridable Property InvoicePostalCode As String Implements IInvoiceAddress.InvoicePostalCode
            Public Overridable Property InvoiceCountryCode As String Implements IInvoiceAddress.InvoiceCountryCode
        End Class

        Public Partial Class QuantityToBook
            '''<Summary>
            '''If service has a price, enter the price id for that price. If no price exists for the service set 0 as PriceId. If you put 0 and a price exists, it will use that price (only works if just one price exists for the current selected date to book)
            '''</Summary>
            <ApiMember(Description:="If service has a price, enter the price id for that price. If no price exists for the service set 0 as PriceId. If you put 0 and a price exists, it will use that price (only works if just one price exists for the current selected date to book)", IsRequired:=true)>
            Public Overridable Property PriceId As Integer

            '''<Summary>
            '''Set the number of spots or resources you want to book on the specific price category
            '''</Summary>
            <ApiMember(Description:="Set the number of spots or resources you want to book on the specific price category", IsRequired:=true)>
            Public Overridable Property Quantity As Integer

            '''<Summary>
            '''If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.
            '''</Summary>
            <ApiMember(Description:="If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.")>
            Public Overridable Property OccupiesSpot As Boolean
        End Class

        Public Partial Class ResourceToBook
            Public Overridable Property ResourceTypeId As Integer
            Public Overridable Property ResourceId As Integer
        End Class

        <ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
        <ApiResponse(Description:="No reservation found for the given session key", StatusCode:=404)>
        <ApiResponse(Description:="The selected slot is no longer available", StatusCode:=409)>
        Public Partial Class UpdateBookingReservation
            Inherits CreateBookingBase
            Implements IInterval
            '''<Summary>
            '''The opaque session key that identifies the reservation.
            '''</Summary>
            <ApiMember(Description:="The opaque session key that identifies the reservation.", IsRequired:=true, ParameterType:="path")>
            Public Overridable Property SessionKey As Guid

            '''<Summary>
            '''The datetime you want to start the reservation.
            '''</Summary>
            <ApiMember(Description:="The datetime you want to start the reservation.", IsRequired:=true)>
            Public Overridable Property From As Date Implements IInterval.From

            '''<Summary>
            '''The datetime you want to end the reservation.
            '''</Summary>
            <ApiMember(Description:="The datetime you want to end the reservation.", IsRequired:=true)>
            Public Overridable Property [To] As Date Implements IInterval.To

            '''<Summary>
            '''Set the number of spots you want to reserve. You add number of spots per price category. Multiple spots require that the service has GroupBooking enabled. Default is one spot.
            '''</Summary>
            <ApiMember(Description:="Set the number of spots you want to reserve. You add number of spots per price category. Multiple spots require that the service has GroupBooking enabled. Default is one spot.")>
            Public Overridable Property Quantities As QuantityToBook() = New QuantityToBook(){}
        End Class
    End Namespace

    Namespace BokaMera.API.ServiceModel.Dtos.Commons

        Public Partial Class CreateBookingBase
            Implements ICreateBookingBase
            '''<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 Guid? Implements ICreateBookingBase.CompanyId

            '''<Summary>
            '''If you want to book on an existing customer instead of CustomerToBook info set the CustomerId here. Set Empty Guid (00000000-0000-0000-0000-000000000000) if you want to book without any customer, this is only allowed by admin. The customer id is shown in the customer list named as id. When booking as customer (no admin) leave this field blank.
            '''</Summary>
            <ApiMember(Description:="If you want to book on an existing customer instead of CustomerToBook info set the CustomerId here. Set Empty Guid (00000000-0000-0000-0000-000000000000) if you want to book without any customer, this is only allowed by admin. The customer id is shown in the customer list named as id. When booking as customer (no admin) leave this field blank.")>
            Public Overridable Property CustomerId As Guid? Implements ICreateBookingBase.CustomerId

            '''<Summary>
            '''If company requires to be authenticated or a pin code entered to book on a specific customer, enter it here.
            '''</Summary>
            <ApiMember(Description:="If company requires to be authenticated or a pin code entered to book on a specific customer, enter it here.")>
            Public Overridable Property PinCode As String Implements ICreateBookingBase.PinCode

            '''<Summary>
            '''If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinary profile. 
            '''</Summary>
            <ApiMember(Description:="If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinary profile. ")>
            Public Overridable Property Customer As CustomerToHandle Implements ICreateBookingBase.Customer

            '''<Summary>
            '''If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinary profile. 
            '''</Summary>
            <ApiMember(Description:="If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinary profile. ")>
            Public Overridable Property InvoiceAddress As InvoiceAddressToHandle Implements ICreateBookingBase.InvoiceAddress

            '''<Summary>
            '''The service to be booked
            '''</Summary>
            <ApiMember(Description:="The service to be booked", IsRequired:=true)>
            Public Overridable Property ServiceId As Integer Implements ICreateBookingBase.ServiceId

            '''<Summary>
            '''If you want to add comments to a booking you can add them here, this comments are never shared with the customer
            '''</Summary>
            <ApiMember(Description:="If you want to add comments to a booking you can add them here, this comments are never shared with the customer")>
            Public Overridable Property BookedComments As String Implements ICreateBookingBase.BookedComments

            '''<Summary>
            '''If you want to add comments to the booking that is sent to the customer, you can add them here. Comments will be sent in the booking confirmation
            '''</Summary>
            <ApiMember(Description:="If you want to add comments to the booking that is sent to the customer, you can add them here. Comments will be sent in the booking confirmation")>
            Public Overridable Property CommentsToCustomer As String Implements ICreateBookingBase.CommentsToCustomer

            Public Overridable Property Resources As List(Of ResourceToBook) Implements ICreateBookingBase.Resources = New List(Of ResourceToBook)
            '''<Summary>
            '''Rebate codes applied to booking
            '''</Summary>
            <ApiMember(Description:="Rebate codes applied to booking")>
            Public Overridable Property RebateCodeIds As List(Of Integer) Implements ICreateBookingBase.RebateCodeIds

            '''<Summary>
            '''Article ids that should be booked with the service. The articles must be of type ServiceAddonArticle and connected to the service.
            '''</Summary>
            <ApiMember(Description:="Article ids that should be booked with the service. The articles must be of type ServiceAddonArticle and connected to the service.", IsRequired:=true)>
            Public Overridable Property Articles As ArticleToCreateBase() = New ArticleToCreateBase(){}

            '''<Summary>
            '''If you want to send Email reminder
            '''</Summary>
            <ApiMember(Description:="If you want to send Email reminder")>
            Public Overridable Property SendEmailReminder As Boolean? Implements ICreateBookingBase.SendEmailReminder

            '''<Summary>
            '''If you want to send SMS reminder
            '''</Summary>
            <ApiMember(Description:="If you want to send SMS reminder")>
            Public Overridable Property SendSmsReminder As Boolean? Implements ICreateBookingBase.SendSmsReminder

            '''<Summary>
            '''If you want to send SMS confirmation
            '''</Summary>
            <ApiMember(Description:="If you want to send SMS confirmation")>
            Public Overridable Property SendSmsConfirmation As Boolean? Implements ICreateBookingBase.SendSmsConfirmation

            '''<Summary>
            '''Only admins are allowed to not send an email confirmation. Default is true
            '''</Summary>
            <ApiMember(Description:="Only admins are allowed to not send an email confirmation. Default is true")>
            Public Overridable Property SendEmailConfirmation As Boolean? Implements ICreateBookingBase.SendEmailConfirmation

            '''<Summary>
            '''If payment is enabled and you're an administrator, optional to choose payment option, if empty then the default settings will be used. Following payment options exists. DefaultSetting = 0, BookWithoutPayment = 1 (will be direcyly booked without payment), BookWithPaymentMessageToCustomer = 2 (will set status AwaitingPayment and send payment instructions to customer), BookWithManualPayment = 3 (Will set status AwaitingPaymentNoTimeLimit and Admin will need to manually mark the booking as payed when recieved payment).
            '''</Summary>
            <ApiMember(Description:="If payment is enabled and you're an administrator, optional to choose payment option, if empty then the default settings will be used. Following payment options exists. DefaultSetting = 0, BookWithoutPayment = 1 (will be direcyly booked without payment), BookWithPaymentMessageToCustomer = 2 (will set status AwaitingPayment and send payment instructions to customer), BookWithManualPayment = 3 (Will set status AwaitingPaymentNoTimeLimit and Admin will need to manually mark the booking as payed when recieved payment).")>
            Public Overridable Property PaymentOption As PaymentOptions Implements ICreateBookingBase.PaymentOption

            '''<Summary>
            '''If Custom Fields are added to the booking, here you will send the id and the value for each custom field to be saved
            '''</Summary>
            <ApiMember(Description:="If Custom Fields are added to the booking, here you will send the id and the value for each custom field to be saved")>
            Public Overridable Property CustomFields As List(Of AddCustomField) Implements ICreateBookingBase.CustomFields = New List(Of AddCustomField)

            '''<Summary>
            '''If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated
            '''</Summary>
            <ApiMember(Description:="If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated")>
            Public Overridable Property CustomerCustomFields As List(Of AddCustomField) Implements ICreateBookingBase.CustomerCustomFields = New List(Of AddCustomField)

            '''<Summary>
            '''If want to allow to book outside the service schedules. This means you can book a time after the schedule opening hours as long as the resource are available. This is only allowed by administrators
            '''</Summary>
            <ApiMember(Description:="If want to allow to book outside the service schedules. This means you can book a time after the schedule opening hours as long as the resource are available. This is only allowed by administrators")>
            Public Overridable Property AllowBookingOutsideSchedules As Boolean Implements ICreateBookingBase.AllowBookingOutsideSchedules

            '''<Summary>
            '''Ids of tags to attach to the booking at creation time. Tags must have Scope = Booking and belong to the company.
            '''</Summary>
            <ApiMember(Description:="Ids of tags to attach to the booking at creation time. Tags must have Scope = Booking and belong to the company.")>
            Public Overridable Property TagIds As List(Of Integer) = New List(Of Integer)
        End Class

        Public Partial Class CustomerBase
            Implements ICustomerBase
            Public Overridable Property CustomerId As Guid? Implements ICustomerBase.CustomerId
            Public Overridable Property Firstname As String Implements ICustomerBase.Firstname
            Public Overridable Property Lastname As String Implements ICustomerBase.Lastname
            Public Overridable Property Email As String Implements ICustomerBase.Email
            Public Overridable Property Phone As String Implements ICustomerBase.Phone
            Public Overridable Property SubscribedToNewsletter As Boolean Implements ICustomerBase.SubscribedToNewsletter
            Public Overridable Property PersonalIdentityNumber As String Implements ICustomerBase.PersonalIdentityNumber
        End Class
    End Namespace

    Namespace BokaMera.API.ServiceModel.Enums

        Public Enum PaymentOptions
            DefaultSetting
            BookWithoutPayment
            BookWithPaymentMessageToCustomer
            BookWithManualPayment
        End Enum
    End Namespace
End Namespace

VB.NET UpdateBookingReservation 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

HTTP + JSON

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

PUT /bookingreservations/{SessionKey} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Quantities":[{"PriceId":0,"Quantity":0,"OccupiesSpot":false}],"CompanyId":"00000000-0000-0000-0000-000000000000","CustomerId":"00000000-0000-0000-0000-000000000000","PinCode":"String","Customer":{"CustomerId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Email":"String","Phone":"String","SubscribedToNewsletter":false,"PersonalIdentityNumber":"String"},"InvoiceAddress":{"CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"},"ServiceId":0,"BookedComments":"String","CommentsToCustomer":"String","Resources":[{"ResourceTypeId":0,"ResourceId":0}],"RebateCodeIds":[0],"Articles":[{"ArticleId":0,"Quantity":0}],"SendEmailReminder":false,"SendSmsReminder":false,"SendSmsConfirmation":false,"SendEmailConfirmation":false,"PaymentOption":"DefaultSetting","CustomFields":[{"Id":0,"Value":"String"}],"CustomerCustomFields":[{"Id":0,"Value":"String"}],"AllowBookingOutsideSchedules":false,"TagIds":[0]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ServiceId":0,"StatusCode":0,"StatusName":"String","NumberOfBookedSpots":0,"Price":0,"CurrencyId":"String","ResourceIds":[0],"SelectionPayload":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}