| PUT | /bookingreservations/{SessionKey} | Update a booking reservation | Updates 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. |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
@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 static class UpdateBookingReservation extends CreateBookingBase implements IInterval
{
/**
* The opaque session key that identifies the reservation.
*/
@ApiMember(Description="The opaque session key that identifies the reservation.", IsRequired=true, ParameterType="path")
public UUID SessionKey = null;
/**
* The datetime you want to start the reservation.
*/
@ApiMember(Description="The datetime you want to start the reservation.", IsRequired=true)
public Date From = null;
/**
* The datetime you want to end the reservation.
*/
@ApiMember(Description="The datetime you want to end the reservation.", IsRequired=true)
public Date To = null;
/**
* 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.
*/
@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 ArrayList<QuantityToBook> Quantities = new ArrayList<QuantityToBook>();
public UUID getSessionKey() { return SessionKey; }
public UpdateBookingReservation setSessionKey(UUID value) { this.SessionKey = value; return this; }
public Date getFrom() { return From; }
public UpdateBookingReservation setFrom(Date value) { this.From = value; return this; }
public Date getTo() { return To; }
public UpdateBookingReservation setTo(Date value) { this.To = value; return this; }
public ArrayList<QuantityToBook> getQuantities() { return Quantities; }
public UpdateBookingReservation setQuantities(ArrayList<QuantityToBook> value) { this.Quantities = value; return this; }
}
public static class CreateBookingBase implements ICreateBookingBase
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
@ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
public UUID CompanyId = null;
/**
* 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.
*/
@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 UUID CustomerId = null;
/**
* If company requires to be authenticated or a pin code entered to book on a specific customer, enter it here.
*/
@ApiMember(Description="If company requires to be authenticated or a pin code entered to book on a specific customer, enter it here.")
public String PinCode = null;
/**
* 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.
*/
@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 CustomerToHandle Customer = null;
/**
* 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.
*/
@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 InvoiceAddressToHandle InvoiceAddress = null;
/**
* The service to be booked
*/
@ApiMember(Description="The service to be booked", IsRequired=true)
public Integer ServiceId = null;
/**
* If you want to add comments to a booking you can add them here, this comments are never shared with the customer
*/
@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 String BookedComments = null;
/**
* 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
*/
@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 String CommentsToCustomer = null;
public ArrayList<ResourceToBook> Resources = new ArrayList<ResourceToBook>();
/**
* Rebate codes applied to booking
*/
@ApiMember(Description="Rebate codes applied to booking")
public ArrayList<Integer> RebateCodeIds = null;
/**
* Article ids that should be booked with the service. The articles must be of type ServiceAddonArticle and connected to the service.
*/
@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 ArrayList<ArticleToCreateBase> Articles = new ArrayList<ArticleToCreateBase>();
/**
* If you want to send Email reminder
*/
@ApiMember(Description="If you want to send Email reminder")
public Boolean SendEmailReminder = null;
/**
* If you want to send SMS reminder
*/
@ApiMember(Description="If you want to send SMS reminder")
public Boolean SendSmsReminder = null;
/**
* If you want to send SMS confirmation
*/
@ApiMember(Description="If you want to send SMS confirmation")
public Boolean SendSmsConfirmation = null;
/**
* Only admins are allowed to not send an email confirmation. Default is true
*/
@ApiMember(Description="Only admins are allowed to not send an email confirmation. Default is true")
public Boolean SendEmailConfirmation = null;
/**
* 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).
*/
@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 PaymentOptions PaymentOption = null;
/**
* If Custom Fields are added to the booking, here you will send the id and the value for each custom field to be saved
*/
@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 ArrayList<AddCustomField> CustomFields = new ArrayList<AddCustomField>();
/**
* If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated
*/
@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 ArrayList<AddCustomField> CustomerCustomFields = new ArrayList<AddCustomField>();
/**
* 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
*/
@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 Boolean AllowBookingOutsideSchedules = null;
/**
* Ids of tags to attach to the booking at creation time. Tags must have Scope = Booking and belong to the company.
*/
@ApiMember(Description="Ids of tags to attach to the booking at creation time. Tags must have Scope = Booking and belong to the company.")
public ArrayList<Integer> TagIds = new ArrayList<Integer>();
public UUID getCompanyId() { return CompanyId; }
public CreateBookingBase setCompanyId(UUID value) { this.CompanyId = value; return this; }
public UUID getCustomerId() { return CustomerId; }
public CreateBookingBase setCustomerId(UUID value) { this.CustomerId = value; return this; }
public String getPinCode() { return PinCode; }
public CreateBookingBase setPinCode(String value) { this.PinCode = value; return this; }
public CustomerToHandle getCustomer() { return Customer; }
public CreateBookingBase setCustomer(CustomerToHandle value) { this.Customer = value; return this; }
public InvoiceAddressToHandle getInvoiceAddress() { return InvoiceAddress; }
public CreateBookingBase setInvoiceAddress(InvoiceAddressToHandle value) { this.InvoiceAddress = value; return this; }
public Integer getServiceId() { return ServiceId; }
public CreateBookingBase setServiceId(Integer value) { this.ServiceId = value; return this; }
public String getBookedComments() { return BookedComments; }
public CreateBookingBase setBookedComments(String value) { this.BookedComments = value; return this; }
public String getCommentsToCustomer() { return CommentsToCustomer; }
public CreateBookingBase setCommentsToCustomer(String value) { this.CommentsToCustomer = value; return this; }
public ArrayList<ResourceToBook> getResources() { return Resources; }
public CreateBookingBase setResources(ArrayList<ResourceToBook> value) { this.Resources = value; return this; }
public ArrayList<Integer> getRebateCodeIds() { return RebateCodeIds; }
public CreateBookingBase setRebateCodeIds(ArrayList<Integer> value) { this.RebateCodeIds = value; return this; }
public ArrayList<ArticleToCreateBase> getArticles() { return Articles; }
public CreateBookingBase setArticles(ArrayList<ArticleToCreateBase> value) { this.Articles = value; return this; }
public Boolean isSendEmailReminder() { return SendEmailReminder; }
public CreateBookingBase setSendEmailReminder(Boolean value) { this.SendEmailReminder = value; return this; }
public Boolean isSendSmsReminder() { return SendSmsReminder; }
public CreateBookingBase setSendSmsReminder(Boolean value) { this.SendSmsReminder = value; return this; }
public Boolean isSendSmsConfirmation() { return SendSmsConfirmation; }
public CreateBookingBase setSendSmsConfirmation(Boolean value) { this.SendSmsConfirmation = value; return this; }
public Boolean isSendEmailConfirmation() { return SendEmailConfirmation; }
public CreateBookingBase setSendEmailConfirmation(Boolean value) { this.SendEmailConfirmation = value; return this; }
public PaymentOptions getPaymentOption() { return PaymentOption; }
public CreateBookingBase setPaymentOption(PaymentOptions value) { this.PaymentOption = value; return this; }
public ArrayList<AddCustomField> getCustomFields() { return CustomFields; }
public CreateBookingBase setCustomFields(ArrayList<AddCustomField> value) { this.CustomFields = value; return this; }
public ArrayList<AddCustomField> getCustomerCustomFields() { return CustomerCustomFields; }
public CreateBookingBase setCustomerCustomFields(ArrayList<AddCustomField> value) { this.CustomerCustomFields = value; return this; }
public Boolean isAllowBookingOutsideSchedules() { return AllowBookingOutsideSchedules; }
public CreateBookingBase setAllowBookingOutsideSchedules(Boolean value) { this.AllowBookingOutsideSchedules = value; return this; }
public ArrayList<Integer> getTagIds() { return TagIds; }
public CreateBookingBase setTagIds(ArrayList<Integer> value) { this.TagIds = value; return this; }
}
public static class CustomerToHandle extends CustomerBase
{
}
public static class CustomerBase implements ICustomerBase
{
public UUID CustomerId = null;
public String Firstname = null;
public String Lastname = null;
public String Email = null;
public String Phone = null;
public Boolean SubscribedToNewsletter = null;
public String PersonalIdentityNumber = null;
public UUID getCustomerId() { return CustomerId; }
public CustomerBase setCustomerId(UUID value) { this.CustomerId = value; return this; }
public String getFirstname() { return Firstname; }
public CustomerBase setFirstname(String value) { this.Firstname = value; return this; }
public String getLastname() { return Lastname; }
public CustomerBase setLastname(String value) { this.Lastname = value; return this; }
public String getEmail() { return Email; }
public CustomerBase setEmail(String value) { this.Email = value; return this; }
public String getPhone() { return Phone; }
public CustomerBase setPhone(String value) { this.Phone = value; return this; }
public Boolean isSubscribedToNewsletter() { return SubscribedToNewsletter; }
public CustomerBase setSubscribedToNewsletter(Boolean value) { this.SubscribedToNewsletter = value; return this; }
public String getPersonalIdentityNumber() { return PersonalIdentityNumber; }
public CustomerBase setPersonalIdentityNumber(String value) { this.PersonalIdentityNumber = value; return this; }
}
public static class InvoiceAddressToHandle implements IInvoiceAddress
{
public String CorporateIdentityNumber = null;
public String InvoiceAddress1 = null;
public String InvoiceAddress2 = null;
public String InvoiceCity = null;
public String InvoicePostalCode = null;
public String InvoiceCountryCode = null;
public String getCorporateIdentityNumber() { return CorporateIdentityNumber; }
public InvoiceAddressToHandle setCorporateIdentityNumber(String value) { this.CorporateIdentityNumber = value; return this; }
public String getInvoiceAddress1() { return InvoiceAddress1; }
public InvoiceAddressToHandle setInvoiceAddress1(String value) { this.InvoiceAddress1 = value; return this; }
public String getInvoiceAddress2() { return InvoiceAddress2; }
public InvoiceAddressToHandle setInvoiceAddress2(String value) { this.InvoiceAddress2 = value; return this; }
public String getInvoiceCity() { return InvoiceCity; }
public InvoiceAddressToHandle setInvoiceCity(String value) { this.InvoiceCity = value; return this; }
public String getInvoicePostalCode() { return InvoicePostalCode; }
public InvoiceAddressToHandle setInvoicePostalCode(String value) { this.InvoicePostalCode = value; return this; }
public String getInvoiceCountryCode() { return InvoiceCountryCode; }
public InvoiceAddressToHandle setInvoiceCountryCode(String value) { this.InvoiceCountryCode = value; return this; }
}
public static class ResourceToBook
{
public Integer ResourceTypeId = null;
public Integer ResourceId = null;
public Integer getResourceTypeId() { return ResourceTypeId; }
public ResourceToBook setResourceTypeId(Integer value) { this.ResourceTypeId = value; return this; }
public Integer getResourceId() { return ResourceId; }
public ResourceToBook setResourceId(Integer value) { this.ResourceId = value; return this; }
}
public static class ArticleToCreateBase
{
public Integer ArticleId = null;
public Integer Quantity = null;
public Integer getArticleId() { return ArticleId; }
public ArticleToCreateBase setArticleId(Integer value) { this.ArticleId = value; return this; }
public Integer getQuantity() { return Quantity; }
public ArticleToCreateBase setQuantity(Integer value) { this.Quantity = value; return this; }
}
public static enum PaymentOptions
{
DefaultSetting,
BookWithoutPayment,
BookWithPaymentMessageToCustomer,
BookWithManualPayment;
}
public static class AddCustomField
{
public Integer Id = null;
public String Value = null;
public Integer getId() { return Id; }
public AddCustomField setId(Integer value) { this.Id = value; return this; }
public String getValue() { return Value; }
public AddCustomField setValue(String value) { this.Value = value; return this; }
}
public static class QuantityToBook
{
/**
* 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)
*/
@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 Integer PriceId = null;
/**
* Set the number of spots or resources you want to book on the specific price category
*/
@ApiMember(Description="Set the number of spots or resources you want to book on the specific price category", IsRequired=true)
public Integer Quantity = null;
/**
* If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.
*/
@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 Boolean OccupiesSpot = null;
public Integer getPriceId() { return PriceId; }
public QuantityToBook setPriceId(Integer value) { this.PriceId = value; return this; }
public Integer getQuantity() { return Quantity; }
public QuantityToBook setQuantity(Integer value) { this.Quantity = value; return this; }
public Boolean isOccupiesSpot() { return OccupiesSpot; }
public QuantityToBook setOccupiesSpot(Boolean value) { this.OccupiesSpot = value; return this; }
}
public static class BookingReservationResponse
{
/**
* The opaque session key that identifies the reservation.
*/
@ApiMember(Description="The opaque session key that identifies the reservation.")
public UUID SessionKey = null;
/**
* The company id.
*/
@ApiMember(Description="The company id.")
public UUID CompanyId = null;
/**
* The reserved service id.
*/
@ApiMember(Description="The reserved service id.")
public Integer ServiceId = null;
/**
* The reservation start.
*/
@ApiMember(Description="The reservation start.")
public Date From = null;
/**
* The reservation end.
*/
@ApiMember(Description="The reservation end.")
public Date To = null;
/**
* The BookingReservationStatus value.
*/
@ApiMember(Description="The BookingReservationStatus value.")
public Integer StatusCode = null;
/**
* The BookingReservationStatus name.
*/
@ApiMember(Description="The BookingReservationStatus name.")
public String StatusName = null;
/**
* When the hold expires (company-local time).
*/
@ApiMember(Description="When the hold expires (company-local time).")
public Date ExpirationDatetime = null;
/**
* Number of reserved spots.
*/
@ApiMember(Description="Number of reserved spots.")
public Integer NumberOfBookedSpots = null;
/**
* The computed price of the reservation, if any.
*/
@ApiMember(Description="The computed price of the reservation, if any.")
public BigDecimal Price = null;
/**
* The currency of the price, if any.
*/
@ApiMember(Description="The currency of the price, if any.")
public String CurrencyId = null;
/**
* Ids of the resources held by the reservation.
*/
@ApiMember(Description="Ids of the resources held by the reservation.")
public ArrayList<Integer> ResourceIds = new ArrayList<Integer>();
/**
* The full in-progress selection payload (wizard/session state) as JSON.
*/
@ApiMember(Description="The full in-progress selection payload (wizard/session state) as JSON.")
public String SelectionPayload = null;
public ResponseStatus ResponseStatus = null;
public UUID getSessionKey() { return SessionKey; }
public BookingReservationResponse setSessionKey(UUID value) { this.SessionKey = value; return this; }
public UUID getCompanyId() { return CompanyId; }
public BookingReservationResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getServiceId() { return ServiceId; }
public BookingReservationResponse setServiceId(Integer value) { this.ServiceId = value; return this; }
public Date getFrom() { return From; }
public BookingReservationResponse setFrom(Date value) { this.From = value; return this; }
public Date getTo() { return To; }
public BookingReservationResponse setTo(Date value) { this.To = value; return this; }
public Integer getStatusCode() { return StatusCode; }
public BookingReservationResponse setStatusCode(Integer value) { this.StatusCode = value; return this; }
public String getStatusName() { return StatusName; }
public BookingReservationResponse setStatusName(String value) { this.StatusName = value; return this; }
public Date getExpirationDatetime() { return ExpirationDatetime; }
public BookingReservationResponse setExpirationDatetime(Date value) { this.ExpirationDatetime = value; return this; }
public Integer getNumberOfBookedSpots() { return NumberOfBookedSpots; }
public BookingReservationResponse setNumberOfBookedSpots(Integer value) { this.NumberOfBookedSpots = value; return this; }
public BigDecimal getPrice() { return Price; }
public BookingReservationResponse setPrice(BigDecimal value) { this.Price = value; return this; }
public String getCurrencyId() { return CurrencyId; }
public BookingReservationResponse setCurrencyId(String value) { this.CurrencyId = value; return this; }
public ArrayList<Integer> getResourceIds() { return ResourceIds; }
public BookingReservationResponse setResourceIds(ArrayList<Integer> value) { this.ResourceIds = value; return this; }
public String getSelectionPayload() { return SelectionPayload; }
public BookingReservationResponse setSelectionPayload(String value) { this.SelectionPayload = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public BookingReservationResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
}
Java 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
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"}}}