BokaMera.API.Host

<back to all web services

CreateBooking

The following routes are available for this service:
POST/bookingsCreate a new bookingCreate a new booking if you are authorized to do so.
CreateBooking Parameters:
NameParameterData TypeRequiredDescription
FrombodyDateTimeYesThe datetime you want to start the booking.
TobodyDateTimeYesThe datetime you want to end the booking.
QuantitiesbodyQuantityToBook[]YesSet the number of spots you want to book. You add number of spots per price category. Multiple spots require that the service has GroupBooking enabled. Default is one spot.
CreateBookingBase Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
CustomerIdformGuid?NoIf 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.
PinCodeformstringYesIf company requires to be authenticated or a pin code entered to book on a specific customer, enter it here.
CustomerformCustomerToHandleYesIf 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.
InvoiceAddressformInvoiceAddressToHandleYesIf 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.
ServiceIdformintYesThe service to be booked
BookedCommentsformstringYesIf you want to add comments to a booking you can add them here, this comments are never shared with the customer
CommentsToCustomerformstringYesIf 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
ResourcesformList<ResourceToBook>Yes
RebateCodeIdsformList<int>YesRebate codes applied to booking
SendEmailReminderformbool?NoIf you want to send Email reminder
SendSmsReminderformbool?NoIf you want to send SMS reminder
SendSmsConfirmationformbool?NoIf you want to send SMS confirmation
SendEmailConfirmationformbool?NoOnly admins are allowed to not send an email confirmation. Default is true
PaymentOptionformPaymentOptionsNoIf 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).
CustomFieldsformList<AddCustomField>YesIf Custom Fields are added to the booking, here you will send the id and the value for each custom field to be saved
CustomerCustomFieldsformList<AddCustomField>YesIf Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated
AllowBookingOutsideSchedulesformboolNoIf 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
CustomerBase Parameters:
NameParameterData TypeRequiredDescription
CustomerIdformGuid?No
FirstnameformstringYes
LastnameformstringYes
EmailformstringYes
PhoneformstringYes
SubscribedToNewsletterformboolNo
InvoiceAddressToHandle Parameters:
NameParameterData TypeRequiredDescription
CorporateIdentityNumberformstringYes
InvoiceAddress1formstringYes
InvoiceAddress2formstringYes
InvoiceCityformstringYes
InvoicePostalCodeformstringYes
InvoiceCountryCodeformstringYes
ResourceToBook Parameters:
NameParameterData TypeRequiredDescription
ResourceTypeIdformintNo
ResourceIdformintNo
PaymentOptions Enum:
DefaultSetting
BookWithoutPayment
BookWithPaymentMessageToCustomer
BookWithManualPayment
AddCustomField Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ValueformstringYes
QuantityToBook Parameters:
NameParameterData TypeRequiredDescription
PriceIdformintYesIf 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)
QuantityformintYesSet the number of spots or resources you want to book on the specific price category
OccupiesSpotformboolNoIf the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.
BookingQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
CompanyIdformGuidNo
FromformDateTimeNo
ToformDateTimeNo
StatusformBookingStatusEnumNo
StatusIdformintNo
StatusNameformstringYes
StatusInfoformBookingStatusQueryResponseYes
SendEmailReminderformboolNo
SendSmsReminderformboolNo
SendSmsConfirmationformboolNo
SendEmailConfirmationformboolNo
LastTimeToUnBookformDateTime?No
CustomFieldsformList<CustomFieldConfigData>Yes
CustomFieldValuesformList<CustomFieldDataResponse>Yes
BookedResourceTypesformList<BookedResourceType>Yes
CompanyformBookedCompanyYes
CustomerformBookedCustomerYes
QuantitiesformList<BookedQuantity>Yes
ServiceformServiceInfoResponseYes
InvoiceAddressformInvoiceAddressResponseYes
PaymentExpirationformDateTime?No
LogformList<BookingLogQueryResponse>Yes
PaymentLogformList<BookingPaymentLogQueryResponse>Yes
CheckoutLogformList<BookingCheckoutQueryResponse>Yes
ExternalReferenceformList<ExternalReferenceResponse>Yes
ResponseStatusformResponseStatusYes
LengthInMinutesformint?No
BookedByformstringYes
BookedCommentsformstringYes
UnbookedCommentsformstringYes
CommentsToCustomerformstringYes
CreatedDateformDateTimeNo
UpdatedDateformDateTimeNo
UnbookedOnformDateTime?No
CancellationCodeformstringYes
RatingCodeformstringYes
BookingStatusEnum Enum:
NameValue
Booked1
Unbooked2
Reserved3
Canceled4
AwaitingPayment5
AwaitingPaymentNoTimeLimit6
Payed7
AwaitingPaymentRequestFromAdmin8
AwaitingPaymentFromProvider9
Invoiced10
BookingStatusQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringYes
DescriptionformstringYes
IconformstringYes
ColorformstringYes
CustomFieldConfigData Parameters:
NameParameterData TypeRequiredDescription
IdformintNoCustom field id
NameformstringYesConfiguration name. Example: 'Number of persons'.
DescriptionformstringYesCustom field description. Example: 'For how many persons is this booking?'
Widthformint?NoField width. Example: 20 for 20px
DataTypeformstringYesData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
DefaultValueformstringYesDefault value of the field. Example: '3'
IsMandatoryformboolNoDetermines if the field is required to have a value or not
MandatoryErrorMessageformstringYesError 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
RegExformstringYesRegular expression used for validation of the field
RegExErrorMessageformstringYesError message shown if the regular expression validation failed
ValuesformList<CustomFieldValueResponse>YesThe values to select from if Datatype is DropDown for this custom field
CustomFieldValueResponse Parameters:
NameParameterData TypeRequiredDescription
ValueformstringYes
CustomFieldDataResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ColumnformstringYes
NameformstringYes
DescriptionformstringYes
ValueformstringYes
DataTypeformstringYesData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
BookedResourceType Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe resource type id
NameformstringYesThe resource type name
ResourcesformList<BookedResource>YesThe resources inside resource type
BookedResource Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringYes
ColorformstringYes
ImageUrlformUriYes
EmailformstringYes
MobilePhoneformstringYes
AccessGroupformstringYes
EmailNotificationformboolNo
SMSNotificationformboolNo
EmailReminderformboolNo
SMSReminderformboolNo
BookedCompany Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
NameformstringYes
LogoTypeformUriYes
CategoryformstringYes
Street1formstringYes
Street2formstringYes
ZipCodeformstringYes
CityformstringYes
CountryIdformstringYes
LongitudeformstringYes
LatitudeformstringYes
PhoneformstringYes
EmailformstringYes
HomePageformstringYes
SitePathformstringYes
IsFavoriteformboolNo
PaymentProviderIdformint?No
BookedCustomer Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
FirstnameformstringYes
LastnameformstringYes
EmailformstringYes
PhoneformstringYes
FacebookUserNameformstringYes
ImageUrlformstringYes
CorporateIdentityNumberformstringYes
InvoiceAddress1formstringYes
InvoiceAddress2formstringYes
InvoiceCityformstringYes
InvoicePostalCodeformstringYes
InvoiceCountryCodeformstringYes
BookedQuantity Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe quantity Id
QuantityformintNoThe quantity for booked on this price category
Priceformdouble?NoThe price
PriceBeforeRebateformdouble?NoThe price bofore rebate codes
CurrencyIdformstringYesThe price currency
PriceSignformstringYesThe price sign
CategoryformstringYesThe price category
VATformdecimal?NoThe price VAT in percent
PriceTextformstringYesThe 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
NameformstringYes
DescriptionformstringYes
ImageUrlformUriYes
LengthInMinutesformint?No
MaxNumberOfSpotsPerBookingformintNo
MinNumberOfSpotsPerBookingformintNo
GroupBookingformGroupBookingSettingsYes
MultipleResourceformMultipleResourceSettingsYes
IsGroupBookingformboolNo
IsPaymentEnabledformboolNo
GroupBookingSettings Parameters:
NameParameterData TypeRequiredDescription
ActiveformboolNo
MinformintNo
MaxformintNo
MultipleResourceSettings Parameters:
NameParameterData TypeRequiredDescription
ActiveformboolNo
MinformintNo
MaxformintNo
InvoiceAddressResponse Parameters:
NameParameterData TypeRequiredDescription
InvoiceAddressIdformGuidNo
UserIdformGuid?No
CorporateIdentityNumberformstringYes
InvoiceAddress1formstringYes
InvoiceAddress2formstringYes
InvoiceCityformstringYes
InvoicePostalCodeformstringYes
InvoiceCountryCodeformstringYes
BookingLogQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe booking log id
BookingIdformintNoThe booking id
EventTypeIdformintNoThe type of event
EventTypeformBookingLogEventTypeResponseYesThe type of event
CommentsformstringYesComments that could be added to the event log item
UserNameformstringYesThe user created the event
CreatedformDateTimeNoThe date when the event occurred
BookingLogEventTypeResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe event type id
NameformstringYesThe event type name
DescriptionformstringYesThe event type description
BookingPaymentLogQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe booking payment log id
BookingIdformintNoThe booking id
PaymentReferenceIdformstringYesThe payment reference id
OrderItemReferenceIdformstringYesThe payment order item reference id
PaymentProviderIdformint?NoThe payment reference id
AmountformdoubleNoThe payment amount
VATformdecimalNoThe payment VAT in percent
AmountCreditedformdoubleNoThe payment amount that is credited
CurrencyIdformstringYesThe payment currency id
CurrencyInfoformCurrencyInfoResponseYesThe payment currency info
CommentsformstringYesComments that could be added to the event log item
CreatedformDateTimeNoThe date when the payment items was created
UpdatedformDateTimeNoThe date when the payment items were updated.
CurrencyInfoResponse Parameters:
NameParameterData TypeRequiredDescription
IdformstringYesThe currency id
NameformstringYesThe currency id
CurrencySignformstringYesThe currency id
BookingCheckoutQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNoThe checkout id
BookingIdformintNoThe booking id
PurchaseIdformint?NoThe purchase id
ExpirationTimeformDateTime?NoThe payment checkout expiration datetime
SnippetformstringYesThe payment snippet code
StatusformstringYesThe payment status
MessageformstringYesLog message
CreatedformDateTimeNoWhen the checkout log item was created
UpdatedformDateTimeNoWhen the checkout log item was updated
ExternalReferenceResponse Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidNo
IdformGuidNo
OwnerIdformGuidNo
ReferenceTypeformstringYes
ExternalDataformstringYes
CreatedByformstringYes
UpdatedformDateTimeNo
CreatedformDateTimeNo

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.

POST /bookings HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
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},"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],"SendEmailReminder":false,"SendSmsReminder":false,"SendSmsConfirmation":false,"SendEmailConfirmation":false,"PaymentOption":"DefaultSetting","CustomFields":[{"Id":0,"Value":"String"}],"CustomerCustomFields":[{"Id":0,"Value":"String"}],"AllowBookingOutsideSchedules":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},"InvoiceAddress":{"UserId":"00000000-0000-0000-0000-000000000000","CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"},"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"}},"LengthInMinutes":0,"BookedBy":"String","BookedComments":"String","UnbookedComments":"String","CommentsToCustomer":"String","UnbookedOn":"0001-01-01T00:00:00","CancellationCode":"String","RatingCode":"String"}