BokaMera.API.Host

<back to all web services

CreateBookingReservation

The following routes are available for this service:
POST/bookingreservationsCreate a booking reservation (hold a slot)Creates a reservation that holds the selected slot while the customer completes the booking flow. No booking is created yet. Only ServiceId, From and To are required so a bare "clicked a time" call works.
CreateBookingReservation Parameters:
NameParameterData TypeRequiredDescription
FrombodyDateTimeYesThe datetime you want to start the reservation.
TobodyDateTimeYesThe datetime you want to end the reservation.
QuantitiesbodyQuantityToBook[]YesSet 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.
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>NoRebate codes applied to booking
ArticlesformArticleToCreateBase[]YesArticle ids that should be booked with the service. The articles must be of type ServiceAddonArticle and connected to the service.
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
TagIdsformList<int>YesIds of tags to attach to the booking at creation time. Tags must have Scope = Booking and belong to the company.
CustomerBase Parameters:
NameParameterData TypeRequiredDescription
CustomerIdformGuid?No
FirstnameformstringYes
LastnameformstringYes
EmailformstringYes
PhoneformstringYes
SubscribedToNewsletterformboolNo
PersonalIdentityNumberformstringYes
InvoiceAddressToHandle Parameters:
NameParameterData TypeRequiredDescription
CorporateIdentityNumberformstringYes
InvoiceAddress1formstringYes
InvoiceAddress2formstringYes
InvoiceCityformstringYes
InvoicePostalCodeformstringYes
InvoiceCountryCodeformstringYes
ResourceToBook Parameters:
NameParameterData TypeRequiredDescription
ResourceTypeIdformintNo
ResourceIdformintNo
ArticleToCreateBase Parameters:
NameParameterData TypeRequiredDescription
ArticleIdformintNo
QuantityformintNo
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.
BookingReservationResponse Parameters:
NameParameterData TypeRequiredDescription
SessionKeyformGuidNoThe opaque session key that identifies the reservation.
CompanyIdformGuidNoThe company id.
ServiceIdformintNoThe reserved service id.
FromformDateTimeNoThe reservation start.
ToformDateTimeNoThe reservation end.
StatusCodeformintNoThe BookingReservationStatus value.
StatusNameformstringYesThe BookingReservationStatus name.
ExpirationDatetimeformDateTimeNoWhen the hold expires (company-local time).
NumberOfBookedSpotsformintNoNumber of reserved spots.
Priceformdecimal?NoThe computed price of the reservation, if any.
CurrencyIdformstringYesThe currency of the price, if any.
ResourceIdsformList<int>YesIds of the resources held by the reservation.
SelectionPayloadformstringYesThe full in-progress selection payload (wizard/session state) as JSON.
ResponseStatusformResponseStatusYes

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.

POST /bookingreservations 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"}}}