BokaMera.API.Host

<back to all web services

UpdateBooking

Requires Authentication
The following routes are available for this service:
PUT/bookings/{Id}Update existing bookingUpdates an existing booking if you are authorized to do so. Note. Price is not updated automatically when changing number of spots or resources.
UpdateBooking Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
Idpathint?NoId of the booking
FrombodyDateTime?No
TobodyDateTime?No
StatusbodyBookingStatusEnum?No
PaymentExpirationbodyDateTime?No
LastTimeToUnBookbodyDateTime?No
UnbookedCommentsbodystringNoIf you want to add comments when canceling a booking you can add them here, this comments are send in the confirmation to the customer
BookedCommentsbodystringNoIf you want to add comments to a booking you can add them here, this comments are never shared with the customer
CommentsToCustomerbodystringNoIf 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
CustomFieldsbodyList<AddCustomField>NoIf Custom Fields are added to the booking, here you will send the id and the value for each custom field to be updated
ResourcesbodyResourceToUpdateNoResources you want to change, leave it empty if no changes to the booked resources
AllowBookingOutsideSchedulesbodyboolNoIf 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
CommentbodystringNoAny comment to save to the log when changing the booking.
MessagebodystringNoAny comment sent to user if SendSmsConfirmation or SendEmailConfirmation
SendSmsConfirmationbodybool?NoIf you want to send SMS confirmation. If null, it will take the default value of the bookings SendSMSConfirmation.
SendEmailConfirmationbodybool?NoIf you want to send Email confirmation. If null, it will take the default value of the bookings SendEmailConfirmation.
BookingStatusEnum Enum:
NameValue
Booked1
Unbooked2
Reserved3
Canceled4
AwaitingPayment5
AwaitingPaymentNoTimeLimit6
Payed7
AwaitingPaymentRequestFromAdmin8
AwaitingPaymentFromProvider9
Invoiced10
AddCustomField Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ValueformstringNo
ResourceToUpdate Parameters:
NameParameterData TypeRequiredDescription
AutoSelectNotDefinedResourcesformboolNoSet this property to true if you want to autoselected not provided resources. If false you will need to add all resources you want to have booked
ResourcesformList<ResourceToBook>NoAll resources to be booked, if AutoSelectNotDefinedResources is true you will only need to provide the one you want to select, rest will be auto selected if avaiable.
ResourceToBook Parameters:
NameParameterData TypeRequiredDescription
ResourceTypeIdformintNo
ResourceIdformintNo
BookingQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
CompanyIdformGuidNo
FromformDateTimeNo
ToformDateTimeNo
StatusformBookingStatusEnumNo
StatusIdformintNo
StatusNameformstringNo
StatusInfoformBookingStatusQueryResponseNo
SendEmailReminderformboolNo
SendSmsReminderformboolNo
SendSmsConfirmationformboolNo
SendEmailConfirmationformboolNo
LastTimeToUnBookformDateTime?No
CustomFieldsformList<CustomFieldConfigData>No
CustomFieldValuesformList<CustomFieldDataResponse>No
BookedResourceTypesformList<BookedResourceType>No
CompanyformBookedCompanyNo
CustomerformBookedCustomerNo
QuantitiesformList<BookedQuantity>No
ServiceformServiceInfoResponseNo
PaymentExpirationformDateTime?No
LogformList<BookingLogQueryResponse>No
PaymentLogformList<BookingPaymentLogQueryResponse>No
CheckoutLogformList<BookingCheckoutQueryResponse>No
ExternalReferenceformList<ExternalReferenceResponse>No
ResponseStatusformResponseStatusNo
CalendarExportStatusformBookingCalendarExportStatusNo
LengthInMinutesformint?No
BookedByformstringNo
BookedCommentsformstringNo
UnbookedCommentsformstringNo
CommentsToCustomerformstringNo
CreatedDateformDateTimeNo
UpdatedDateformDateTimeNo
UnbookedOnformDateTime?No
CancellationCodeformstringNo
RatingCodeformstringNo
BookingStatusQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringNo
DescriptionformstringNo
IconformstringNo
ColorformstringNo
CustomFieldConfigData Parameters:
NameParameterData TypeRequiredDescription
IdformintNoCustom field id
NameformstringNoConfiguration name. Example: 'Number of persons'.
DescriptionformstringNoCustom field description. Example: 'For how many persons is this booking?'
Widthformint?NoField width. Example: 20 for 20px
DataTypeformstringNoData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
DefaultValueformstringNoDefault value of the field. Example: '3'
IsMandatoryformboolNoDetermines if the field is required to have a value or not
MandatoryErrorMessageformstringNoError message shown to the user if the field data is required but not entered
MaxLengthformintNoMax lenght of the field
MultipleLineTextformboolNoIf the field should have multiple lines
RegExformstringNoRegular expression used for validation of the field
RegExErrorMessageformstringNoError message shown if the regular expression validation failed
ValuesformList<CustomFieldValueResponse>NoThe values to select from if Datatype is DropDown for this custom field
CustomFieldValueResponse Parameters:
NameParameterData TypeRequiredDescription
ValueformstringNo
CustomFieldDataResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ColumnformstringNo
NameformstringNo
DescriptionformstringNo
ValueformstringNo
DataTypeformstringNoData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
BookedResourceType Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe resource type id
NameformstringNoThe resource type name
ResourcesformList<BookedResource>NoThe resources inside resource type
BookedResource Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringNo
ColorformstringNo
ImageUrlformUriNo
EmailformstringNo
MobilePhoneformstringNo
AccessGroupformstringNo
EmailNotificationformboolNo
SMSNotificationformboolNo
EmailReminderformboolNo
SMSReminderformboolNo
BookedCompany Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
NameformstringNo
LogoTypeformUriNo
CategoryformstringNo
Street1formstringNo
Street2formstringNo
ZipCodeformstringNo
CityformstringNo
CountryIdformstringNo
LongitudeformstringNo
LatitudeformstringNo
PhoneformstringNo
EmailformstringNo
HomePageformstringNo
SitePathformstringNo
IsFavoriteformboolNo
PaymentProviderIdformint?No
BookedCustomer Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
FirstnameformstringNo
LastnameformstringNo
EmailformstringNo
PhoneformstringNo
FacebookUserNameformstringNo
ImageUrlformstringNo
CorporateIdentityNumberformstringNo
InvoiceAddress1formstringNo
InvoiceAddress2formstringNo
InvoiceCityformstringNo
InvoicePostalCodeformstringNo
InvoiceCountryCodeformstringNo
BookedQuantity Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe quantity Id
QuantityformintNoThe quantity for booked on this price category
Priceformdouble?NoThe price
PriceBeforeRebateformdouble?NoThe price bofore rebate codes
CurrencyIdformstringNoThe price currency
PriceSignformstringNoThe price sign
CategoryformstringNoThe price category
VATformdecimal?NoThe price VAT in percent
PriceTextformstringNoThe price text to display
OccupiesSpotformboolNoIf the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.
ServiceInfoResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringNo
DescriptionformstringNo
ImageUrlformUriNo
LengthInMinutesformint?No
MaxNumberOfSpotsPerBookingformintNo
MinNumberOfSpotsPerBookingformintNo
GroupBookingformGroupBookingSettingsNo
MultipleResourceformMultipleResourceSettingsNo
IsGroupBookingformboolNo
IsPaymentEnabledformboolNo
GroupBookingSettings Parameters:
NameParameterData TypeRequiredDescription
ActiveformboolNo
MinformintNo
MaxformintNo
MultipleResourceSettings Parameters:
NameParameterData TypeRequiredDescription
ActiveformboolNo
MinformintNo
MaxformintNo
BookingLogQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe booking log id
BookingIdformintNoThe booking id
EventTypeIdformintNoThe type of event
EventTypeformBookingLogEventTypeResponseNoThe type of event
CommentsformstringNoComments that could be added to the event log item
UserNameformstringNoThe user created the event
CreatedformDateTimeNoThen date when the event occured
BookingLogEventTypeResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe event type id
NameformstringNoThe event type name
DescriptionformstringNoThe event type description
BookingPaymentLogQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe booking payment log id
BookingIdformintNoThe booking id
PaymentReferenceIdformstringNoThe payment reference id
OrderItemReferenceIdformstringNoThe payment order item reference id
PaymentProviderIdformint?NoThe payment reference id
AmountformdoubleNoThe payment amount
VATformdecimalNoThe payment VAT in percent
AmountCreditedformdoubleNoThe payment amount that is credited
CurrencyIdformstringNoThe payment currency id
CurrencyInfoformCurrencyInfoResponseNoThe payment currency info
CommentsformstringNoComments that could be added to the event log item
CreatedformDateTimeNoThe date when the payment items was created
UpdatedformDateTimeNoThe date when the payment items was update
CurrencyInfoResponse Parameters:
NameParameterData TypeRequiredDescription
IdformstringNoThe currency id
NameformstringNoThe currency id
CurrencySignformstringNoThe currency id
BookingCheckoutQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNoThe checkout id
BookingIdformintNoThe booking id
PurchaseIdformint?NoThe purchase id
ExpirationTimeformDateTime?NoThe payment checkout expiration datetime
SnippetformstringNoThe payment snippet code
StatusformstringNoThe payment status
MessageformstringNoLog message
CreatedformDateTimeNoWhen the checkout log item was created
UpdatedformDateTimeNoWhen the checkout log item was updated
ExternalReferenceResponse Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidNo
IdformGuidNo
OwnerIdformGuidNo
ReferenceTypeformstringNo
ExternalDataformstringNo
CreatedByformstringNo
UpdatedformDateTimeNo
CreatedformDateTimeNo
BookingCalendarExportStatus Parameters:
NameParameterData TypeRequiredDescription
CalendarIdformstringNo
BookingIdformintNo
Syncedformbool?No

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 /bookings/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"From":"0001-01-01T00:00:00","To":"0001-01-01T00:00:00","Status":"0","PaymentExpiration":"0001-01-01T00:00:00","LastTimeToUnBook":"0001-01-01T00:00:00","UnbookedComments":"String","BookedComments":"String","CommentsToCustomer":"String","CustomFields":[{"Id":0,"Value":"String"}],"Resources":{"AutoSelectNotDefinedResources":false,"Resources":[{"ResourceTypeId":0,"ResourceId":0}]},"AllowBookingOutsideSchedules":false,"Comment":"String","Message":"String","SendSmsConfirmation":false,"SendEmailConfirmation":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Id":0,"Status":"Booked","StatusId":0,"StatusName":"String","StatusInfo":{"Id":0,"Name":"String","Description":"String","Icon":"String","Color":"String"},"SendEmailReminder":false,"SendSmsReminder":false,"SendSmsConfirmation":false,"SendEmailConfirmation":false,"LastTimeToUnBook":"0001-01-01T00:00:00","CustomFields":[{"Id":0,"Name":"String","Description":"String","Width":0,"DataType":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegEx":"String","RegExErrorMessage":"String","Values":[{"Value":"String"}]}],"CustomFieldValues":[{"Id":0,"Column":"String","Name":"String","Description":"String","Value":"String","DataType":"String"}],"BookedResourceTypes":[{"Id":0,"Name":"String","Resources":[{"Id":0,"Name":"String","Color":"String","Email":"String","MobilePhone":"String","AccessGroup":"String","EmailNotification":false,"SMSNotification":false,"EmailReminder":false,"SMSReminder":false}]}],"Company":{"Name":"String","Category":"String","Street1":"String","Street2":"String","ZipCode":"String","City":"String","CountryId":"String","Longitude":"String","Latitude":"String","Phone":"String","Email":"String","HomePage":"String","SitePath":"String","IsFavorite":false,"PaymentProviderId":0},"Customer":{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","FacebookUserName":"String","ImageUrl":"String","CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"},"Quantities":[{"Id":0,"Quantity":0,"Price":0,"PriceBeforeRebate":0,"CurrencyId":"String","PriceSign":"String","Category":"String","VAT":0,"PriceText":"String","OccupiesSpot":false}],"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},"PaymentExpiration":"0001-01-01T00:00:00","Log":[{"Id":0,"BookingId":0,"EventTypeId":0,"EventType":{"Id":0,"Name":"String","Description":"String"},"Comments":"String","UserName":"String"}],"PaymentLog":[{"Id":0,"BookingId":0,"PaymentReferenceId":"String","OrderItemReferenceId":"String","PaymentProviderId":0,"Amount":0,"VAT":0,"AmountCredited":0,"CurrencyId":"String","CurrencyInfo":{"Id":"String","Name":"String","CurrencySign":"String"},"Comments":"String"}],"CheckoutLog":[{"BookingId":0,"PurchaseId":0,"ExpirationTime":"0001-01-01T00:00:00","Snippet":"String","Status":"String","Message":"String"}],"ExternalReference":[{"ReferenceType":"String","ExternalData":"String","CreatedBy":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"CalendarExportStatus":{"CalendarId":"String","BookingId":0,"Synced":false},"LengthInMinutes":0,"BookedBy":"String","BookedComments":"String","UnbookedComments":"String","CommentsToCustomer":"String","UnbookedOn":"0001-01-01T00:00:00","CancellationCode":"String","RatingCode":"String"}