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.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
using BokaMera.API.ServiceModel.Enums;

namespace BokaMera.API.ServiceModel.Dtos
{
    public partial class AddCustomField
    {
        public virtual int Id { get; set; }
        public virtual string Value { get; set; }
    }

    public partial class BookedCompany
    {
        public virtual Guid Id { get; set; }
        public virtual string Name { get; set; }
        public virtual Uri LogoType { get; set; }
        public virtual string Category { get; set; }
        public virtual string Street1 { get; set; }
        public virtual string Street2 { get; set; }
        public virtual string ZipCode { get; set; }
        public virtual string City { get; set; }
        public virtual string CountryId { get; set; }
        public virtual string Longitude { get; set; }
        public virtual string Latitude { get; set; }
        public virtual string Phone { get; set; }
        public virtual string Email { get; set; }
        public virtual string HomePage { get; set; }
        public virtual string SitePath { get; set; }
        public virtual bool IsFavorite { get; set; }
        public virtual int? PaymentProviderId { get; set; }
    }

    public partial class BookedCustomer
    {
        public virtual Guid Id { get; set; }
        public virtual string Firstname { get; set; }
        public virtual string Lastname { get; set; }
        public virtual string Email { get; set; }
        public virtual string Phone { get; set; }
        public virtual string FacebookUserName { get; set; }
        public virtual string ImageUrl { get; set; }
        public virtual string CorporateIdentityNumber { get; set; }
        public virtual string InvoiceAddress1 { get; set; }
        public virtual string InvoiceAddress2 { get; set; }
        public virtual string InvoiceCity { get; set; }
        public virtual string InvoicePostalCode { get; set; }
        public virtual string InvoiceCountryCode { get; set; }
    }

    public partial class BookedQuantity
    {
        ///<summary>
        ///The quantity Id
        ///</summary>
        [ApiMember(Description="The quantity Id")]
        public virtual int Id { get; set; }

        ///<summary>
        ///The quantity for booked on this price category
        ///</summary>
        [ApiMember(Description="The quantity for booked on this price category")]
        public virtual int Quantity { get; set; }

        ///<summary>
        ///The price
        ///</summary>
        [ApiMember(Description="The price")]
        public virtual double? Price { get; set; }

        ///<summary>
        ///The price bofore rebate codes
        ///</summary>
        [ApiMember(Description="The price bofore rebate codes")]
        public virtual double? PriceBeforeRebate { get; set; }

        ///<summary>
        ///The price currency
        ///</summary>
        [ApiMember(Description="The price currency")]
        public virtual string CurrencyId { get; set; }

        ///<summary>
        ///The price sign
        ///</summary>
        [ApiMember(Description="The price sign")]
        public virtual string PriceSign { get; set; }

        ///<summary>
        ///The price category
        ///</summary>
        [ApiMember(Description="The price category")]
        public virtual string Category { get; set; }

        ///<summary>
        ///The price VAT in percent
        ///</summary>
        [ApiMember(Description="The price VAT in percent")]
        public virtual decimal? VAT { get; set; }

        ///<summary>
        ///The price text to display
        ///</summary>
        [ApiMember(Description="The price text to display")]
        public virtual string PriceText { get; set; }

        ///<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 virtual bool OccupiesSpot { get; set; }
    }

    public partial class BookedResource
    {
        public virtual int Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string Color { get; set; }
        public virtual Uri ImageUrl { get; set; }
        public virtual string Email { get; set; }
        public virtual string MobilePhone { get; set; }
        public virtual string AccessGroup { get; set; }
        public virtual bool EmailNotification { get; set; }
        public virtual bool SMSNotification { get; set; }
        public virtual bool EmailReminder { get; set; }
        public virtual bool SMSReminder { get; set; }
    }

    public partial class BookedResourceType
    {
        public BookedResourceType()
        {
            Resources = new List<BookedResource>{};
        }

        ///<summary>
        ///The resource type id
        ///</summary>
        [ApiMember(Description="The resource type id")]
        public virtual int Id { get; set; }

        ///<summary>
        ///The resource type name
        ///</summary>
        [ApiMember(Description="The resource type name")]
        public virtual string Name { get; set; }

        ///<summary>
        ///The resources inside resource type
        ///</summary>
        [ApiMember(Description="The resources inside resource type")]
        public virtual List<BookedResource> Resources { get; set; }
    }

    public partial class BookingCalendarExportStatus
    {
        public virtual string CalendarId { get; set; }
        public virtual int BookingId { get; set; }
        public virtual bool? Synced { get; set; }
    }

    public partial class BookingCheckoutQueryResponse
    {
        ///<summary>
        ///The checkout id
        ///</summary>
        [ApiMember(Description="The checkout id")]
        public virtual Guid Id { get; set; }

        ///<summary>
        ///The booking id
        ///</summary>
        [ApiMember(Description="The booking id")]
        public virtual int BookingId { get; set; }

        ///<summary>
        ///The purchase id
        ///</summary>
        [ApiMember(Description="The purchase id")]
        public virtual int? PurchaseId { get; set; }

        ///<summary>
        ///The payment checkout expiration datetime
        ///</summary>
        [ApiMember(Description="The payment checkout expiration datetime")]
        public virtual DateTime? ExpirationTime { get; set; }

        ///<summary>
        ///The payment snippet code
        ///</summary>
        [ApiMember(Description="The payment snippet code")]
        public virtual string Snippet { get; set; }

        ///<summary>
        ///The payment status
        ///</summary>
        [ApiMember(Description="The payment status")]
        public virtual string Status { get; set; }

        ///<summary>
        ///Log message
        ///</summary>
        [ApiMember(Description="Log message")]
        public virtual string Message { get; set; }

        ///<summary>
        ///When the checkout log item was created
        ///</summary>
        [ApiMember(Description="When the checkout log item was created")]
        public virtual DateTime Created { get; set; }

        ///<summary>
        ///When the checkout log item was updated
        ///</summary>
        [ApiMember(Description="When the checkout log item was updated")]
        public virtual DateTime Updated { get; set; }
    }

    public partial class BookingLogEventTypeResponse
    {
        ///<summary>
        ///The event type id
        ///</summary>
        [ApiMember(Description="The event type id")]
        public virtual int Id { get; set; }

        ///<summary>
        ///The event type name
        ///</summary>
        [ApiMember(Description="The event type name")]
        public virtual string Name { get; set; }

        ///<summary>
        ///The event type description
        ///</summary>
        [ApiMember(Description="The event type description")]
        public virtual string Description { get; set; }
    }

    public partial class BookingLogQueryResponse
    {
        ///<summary>
        ///The booking log id
        ///</summary>
        [ApiMember(Description="The booking log id")]
        public virtual int Id { get; set; }

        ///<summary>
        ///The booking id
        ///</summary>
        [ApiMember(Description="The booking id")]
        public virtual int BookingId { get; set; }

        ///<summary>
        ///The type of event
        ///</summary>
        [ApiMember(Description="The type of event")]
        public virtual int EventTypeId { get; set; }

        ///<summary>
        ///The type of event
        ///</summary>
        [ApiMember(Description="The type of event")]
        public virtual BookingLogEventTypeResponse EventType { get; set; }

        ///<summary>
        ///Comments that could be added to the event log item
        ///</summary>
        [ApiMember(Description="Comments that could be added to the event log item")]
        public virtual string Comments { get; set; }

        ///<summary>
        ///The user created the event
        ///</summary>
        [ApiMember(Description="The user created the event")]
        public virtual string UserName { get; set; }

        ///<summary>
        ///Then date when the event occured
        ///</summary>
        [ApiMember(Description="Then date when the event occured")]
        public virtual DateTime Created { get; set; }
    }

    public partial class BookingPaymentLogQueryResponse
    {
        ///<summary>
        ///The booking payment log id
        ///</summary>
        [ApiMember(Description="The booking payment log id")]
        public virtual int Id { get; set; }

        ///<summary>
        ///The booking id
        ///</summary>
        [ApiMember(Description="The booking id")]
        public virtual int BookingId { get; set; }

        ///<summary>
        ///The payment reference id
        ///</summary>
        [ApiMember(Description="The payment reference id")]
        public virtual string PaymentReferenceId { get; set; }

        ///<summary>
        ///The payment order item reference id
        ///</summary>
        [ApiMember(Description="The payment order item reference id")]
        public virtual string OrderItemReferenceId { get; set; }

        ///<summary>
        ///The payment reference id
        ///</summary>
        [ApiMember(Description="The payment reference id")]
        public virtual int? PaymentProviderId { get; set; }

        ///<summary>
        ///The payment amount
        ///</summary>
        [ApiMember(Description="The payment amount")]
        public virtual double Amount { get; set; }

        ///<summary>
        ///The payment VAT in percent
        ///</summary>
        [ApiMember(Description="The payment VAT in percent")]
        public virtual decimal VAT { get; set; }

        ///<summary>
        ///The payment amount that is credited
        ///</summary>
        [ApiMember(Description="The payment amount that is credited")]
        public virtual double AmountCredited { get; set; }

        ///<summary>
        ///The payment currency id
        ///</summary>
        [ApiMember(Description="The payment currency id")]
        public virtual string CurrencyId { get; set; }

        ///<summary>
        ///The payment currency info
        ///</summary>
        [ApiMember(Description="The payment currency info")]
        public virtual CurrencyInfoResponse CurrencyInfo { get; set; }

        ///<summary>
        ///Comments that could be added to the event log item
        ///</summary>
        [ApiMember(Description="Comments that could be added to the event log item")]
        public virtual string Comments { get; set; }

        ///<summary>
        ///The date when the payment items was created
        ///</summary>
        [ApiMember(Description="The date when the payment items was created")]
        public virtual DateTime Created { get; set; }

        ///<summary>
        ///The date when the payment items was update
        ///</summary>
        [ApiMember(Description="The date when the payment items was update")]
        public virtual DateTime Updated { get; set; }
    }

    public partial class BookingQueryResponse
    {
        public BookingQueryResponse()
        {
            CustomFields = new List<CustomFieldConfigData>{};
            CustomFieldValues = new List<CustomFieldDataResponse>{};
            BookedResourceTypes = new List<BookedResourceType>{};
            Quantities = new List<BookedQuantity>{};
            Log = new List<BookingLogQueryResponse>{};
            PaymentLog = new List<BookingPaymentLogQueryResponse>{};
            CheckoutLog = new List<BookingCheckoutQueryResponse>{};
            ExternalReference = new List<ExternalReferenceResponse>{};
        }

        public virtual int Id { get; set; }
        public virtual Guid CompanyId { get; set; }
        public virtual DateTime From { get; set; }
        public virtual DateTime To { get; set; }
        public virtual BookingStatusEnum Status { get; set; }
        public virtual int StatusId { get; set; }
        public virtual string StatusName { get; set; }
        public virtual BookingStatusQueryResponse StatusInfo { get; set; }
        public virtual bool SendEmailReminder { get; set; }
        public virtual bool SendSmsReminder { get; set; }
        public virtual bool SendSmsConfirmation { get; set; }
        public virtual bool SendEmailConfirmation { get; set; }
        public virtual DateTime? LastTimeToUnBook { get; set; }
        public virtual List<CustomFieldConfigData> CustomFields { get; set; }
        public virtual List<CustomFieldDataResponse> CustomFieldValues { get; set; }
        public virtual List<BookedResourceType> BookedResourceTypes { get; set; }
        public virtual BookedCompany Company { get; set; }
        public virtual BookedCustomer Customer { get; set; }
        public virtual List<BookedQuantity> Quantities { get; set; }
        public virtual ServiceInfoResponse Service { get; set; }
        public virtual DateTime? PaymentExpiration { get; set; }
        public virtual List<BookingLogQueryResponse> Log { get; set; }
        public virtual List<BookingPaymentLogQueryResponse> PaymentLog { get; set; }
        public virtual List<BookingCheckoutQueryResponse> CheckoutLog { get; set; }
        public virtual List<ExternalReferenceResponse> ExternalReference { get; set; }
        public virtual ResponseStatus ResponseStatus { get; set; }
        public virtual BookingCalendarExportStatus CalendarExportStatus { get; set; }
        public virtual int? LengthInMinutes { get; set; }
        public virtual string BookedBy { get; set; }
        public virtual string BookedComments { get; set; }
        public virtual string UnbookedComments { get; set; }
        public virtual string CommentsToCustomer { get; set; }
        public virtual DateTime CreatedDate { get; set; }
        public virtual DateTime UpdatedDate { get; set; }
        public virtual DateTime? UnbookedOn { get; set; }
        public virtual string CancellationCode { get; set; }
        public virtual string RatingCode { get; set; }
    }

    public partial class BookingStatusQueryResponse
    {
        public virtual int Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string Description { get; set; }
        public virtual string Icon { get; set; }
        public virtual string Color { get; set; }
    }

    [ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
    public partial class CreateBooking
        : CreateBookingBase, IInterval
    {
        public CreateBooking()
        {
            Quantities = new QuantityToBook[]{};
        }

        ///<summary>
        ///The datetime you want to start the booking.
        ///</summary>
        [ApiMember(Description="The datetime you want to start the booking.", IsRequired=true)]
        public virtual DateTime From { get; set; }

        ///<summary>
        ///The datetime you want to end the booking.
        ///</summary>
        [ApiMember(Description="The datetime you want to end the booking.", IsRequired=true)]
        public virtual DateTime To { get; set; }

        ///<summary>
        ///Set 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.
        ///</summary>
        [ApiMember(Description="Set 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.")]
        public virtual QuantityToBook[] Quantities { get; set; }
    }

    public partial class CreateBookingBase
    {
        public CreateBookingBase()
        {
            Resources = new List<ResourceToBook>{};
            RebateCodeIds = new List<int>{};
            CustomFields = new List<AddCustomField>{};
            CustomerCustomFields = new List<AddCustomField>{};
        }

        ///<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 virtual Guid? CompanyId { get; set; }

        ///<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 virtual Guid? CustomerId { get; set; }

        ///<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 virtual string PinCode { get; set; }

        ///<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 ordinairy 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 ordinairy profile. ")]
        public virtual CustomerToHandle Customer { get; set; }

        ///<summary>
        ///The service to be booked
        ///</summary>
        [ApiMember(Description="The service to be booked", IsRequired=true)]
        public virtual int ServiceId { get; set; }

        ///<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 virtual string BookedComments { get; set; }

        ///<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 virtual string CommentsToCustomer { get; set; }

        public virtual List<ResourceToBook> Resources { get; set; }
        ///<summary>
        ///Rebate codes applied to booking
        ///</summary>
        [ApiMember(Description="Rebate codes applied to booking")]
        public virtual List<int> RebateCodeIds { get; set; }

        ///<summary>
        ///If you want to send Email reminder
        ///</summary>
        [ApiMember(Description="If you want to send Email reminder")]
        public virtual bool? SendEmailReminder { get; set; }

        ///<summary>
        ///If you want to send SMS reminder
        ///</summary>
        [ApiMember(Description="If you want to send SMS reminder")]
        public virtual bool? SendSmsReminder { get; set; }

        ///<summary>
        ///If you want to send SMS confirmation
        ///</summary>
        [ApiMember(Description="If you want to send SMS confirmation")]
        public virtual bool? SendSmsConfirmation { get; set; }

        ///<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 virtual bool? SendEmailConfirmation { get; set; }

        ///<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 virtual PaymentOptions PaymentOption { get; set; }

        ///<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 virtual List<AddCustomField> CustomFields { get; set; }

        ///<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 virtual List<AddCustomField> CustomerCustomFields { get; set; }

        ///<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 virtual bool AllowBookingOutsideSchedules { get; set; }
    }

    public partial class CurrencyInfoResponse
    {
        ///<summary>
        ///The currency id
        ///</summary>
        [ApiMember(Description="The currency id")]
        public virtual string Id { get; set; }

        ///<summary>
        ///The currency id
        ///</summary>
        [ApiMember(Description="The currency id")]
        public virtual string Name { get; set; }

        ///<summary>
        ///The currency id
        ///</summary>
        [ApiMember(Description="The currency id")]
        public virtual string CurrencySign { get; set; }
    }

    public partial class CustomerToHandle
    {
        public virtual Guid? CustomerId { get; set; }
        public virtual string Firstname { get; set; }
        public virtual string Lastname { get; set; }
        public virtual string Email { get; set; }
        public virtual string Phone { get; set; }
        public virtual bool SubscribedToNewsletter { get; set; }
    }

    public partial class CustomFieldConfigData
    {
        public CustomFieldConfigData()
        {
            Values = new List<CustomFieldValueResponse>{};
        }

        ///<summary>
        ///Custom field id
        ///</summary>
        [ApiMember(Description="Custom field id")]
        public virtual int Id { get; set; }

        ///<summary>
        ///Configuration name. Example: 'Number of persons'.
        ///</summary>
        [ApiMember(Description="Configuration name. Example: 'Number of persons'.")]
        public virtual string Name { get; set; }

        ///<summary>
        ///Custom field description. Example: 'For how many persons is this booking?'
        ///</summary>
        [ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'")]
        public virtual string Description { get; set; }

        ///<summary>
        ///Field width. Example: 20 for 20px
        ///</summary>
        [ApiMember(Description="Field width. Example: 20 for 20px")]
        public virtual int? Width { get; set; }

        ///<summary>
        ///Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
        ///</summary>
        [ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")]
        public virtual string DataType { get; set; }

        ///<summary>
        ///Default value of the field. Example: '3'
        ///</summary>
        [ApiMember(Description="Default value of the field. Example: '3'")]
        public virtual string DefaultValue { get; set; }

        ///<summary>
        ///Determines if the field is required to have a value or not
        ///</summary>
        [ApiMember(Description="Determines if the field is required to have a value or not")]
        public virtual bool IsMandatory { get; set; }

        ///<summary>
        ///Error message shown to the user if the field data is required but not entered
        ///</summary>
        [ApiMember(Description="Error message shown to the user if the field data is required but not entered")]
        public virtual string MandatoryErrorMessage { get; set; }

        ///<summary>
        ///Max lenght of the field
        ///</summary>
        [ApiMember(Description="Max lenght of the field")]
        public virtual int MaxLength { get; set; }

        ///<summary>
        ///If the field should have multiple lines
        ///</summary>
        [ApiMember(Description="If the field should have multiple lines")]
        public virtual bool MultipleLineText { get; set; }

        ///<summary>
        ///Regular expression used for validation of the field
        ///</summary>
        [ApiMember(Description="Regular expression used for validation of the field")]
        public virtual string RegEx { get; set; }

        ///<summary>
        ///Error message shown if the regular expression validation failed
        ///</summary>
        [ApiMember(Description="Error message shown if the regular expression validation failed")]
        public virtual string RegExErrorMessage { get; set; }

        ///<summary>
        ///The values to select from if Datatype is DropDown for this custom field
        ///</summary>
        [ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")]
        public virtual List<CustomFieldValueResponse> Values { get; set; }
    }

    public partial class CustomFieldDataResponse
    {
        public virtual int Id { get; set; }
        public virtual string Column { get; set; }
        public virtual string Name { get; set; }
        public virtual string Description { get; set; }
        public virtual string Value { get; set; }
        ///<summary>
        ///Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
        ///</summary>
        [ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")]
        public virtual string DataType { get; set; }
    }

    public partial class CustomFieldValueResponse
    {
        public virtual string Value { get; set; }
    }

    public partial class ExternalReferenceResponse
    {
        public virtual Guid CompanyId { get; set; }
        public virtual Guid Id { get; set; }
        public virtual Guid OwnerId { get; set; }
        public virtual string ReferenceType { get; set; }
        public virtual string ExternalData { get; set; }
        public virtual string CreatedBy { get; set; }
        public virtual DateTime Updated { get; set; }
        public virtual DateTime Created { get; set; }
    }

    public partial class GroupBookingSettings
    {
        public virtual bool Active { get; set; }
        public virtual int Min { get; set; }
        public virtual int Max { get; set; }
    }

    public partial class MultipleResourceSettings
    {
        public virtual bool Active { get; set; }
        public virtual int Min { get; set; }
        public virtual int Max { get; set; }
    }

    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 virtual int PriceId { get; set; }

        ///<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 virtual int Quantity { get; set; }

        ///<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 virtual bool OccupiesSpot { get; set; }
    }

    public partial class ResourceToBook
    {
        public virtual int ResourceTypeId { get; set; }
        public virtual int ResourceId { get; set; }
    }

    public partial class ServiceInfoResponse
    {
        public virtual int Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string Description { get; set; }
        public virtual Uri ImageUrl { get; set; }
        public virtual int? LengthInMinutes { get; set; }
        public virtual int MaxNumberOfSpotsPerBooking { get; set; }
        public virtual int MinNumberOfSpotsPerBooking { get; set; }
        public virtual GroupBookingSettings GroupBooking { get; set; }
        public virtual MultipleResourceSettings MultipleResource { get; set; }
        public virtual bool IsGroupBooking { get; set; }
        public virtual bool IsPaymentEnabled { get; set; }
    }

}

namespace BokaMera.API.ServiceModel.Enums
{
    public enum BookingStatusEnum
    {
        Booked = 1,
        Unbooked = 2,
        Reserved = 3,
        Canceled = 4,
        AwaitingPayment = 5,
        AwaitingPaymentNoTimeLimit = 6,
        Payed = 7,
        AwaitingPaymentRequestFromAdmin = 8,
        AwaitingPaymentFromProvider = 9,
        Invoiced = 10,
    }

    public enum PaymentOptions
    {
        DefaultSetting,
        BookWithoutPayment,
        BookWithPaymentMessageToCustomer,
        BookWithManualPayment,
    }

}

C# CreateBooking 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.

POST /bookings HTTP/1.1 
Host: api.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},"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: application/json
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"}