BokaMera.API.Host

<back to all web services

CalculateTotalPriceOnService

The following routes are available for this service:
PUT/services/{Id}/calculatepriceCalculate price on serviceCalculate an price on a service.
CalculateTotalPriceOnService Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
IdpathintYesId of the service
IntervalbodyPriceIntervalYesThe price interval to be used for calculations
RebateCodeIdsbodyList<int>NoIf you have selected to include the prices, here you can include the rebate codes
QuantitiesbodyQuantityToBook[]NoIf you have selected to include the prices, here you can include the quantities to book to get the correct total price.
PriceInterval Parameters:
NameParameterData TypeRequiredDescription
FromformDateTimeYesThe start date and time for the price to be calculated. Normally the booking start datetime.
ToformDateTime?NoThe end date and time for the price to be calculated.Normally the booking end datetime. If nothing entered it will use the service length.
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.
TotalPriceInformationResponse Parameters:
NameParameterData TypeRequiredDescription
TotalPriceformdoubleNo
TotalVatAmountformdoubleNo
TotalPriceBeforeRebateformdoubleNo
AppliedCodesformList<AppliedRebateCodesResponse>No
PriceDetailsformList<TotaPricePriceDetail>No
AppliedRebateCodesResponse Parameters:
NameParameterData TypeRequiredDescription
RebateCodeSignformstringNo
RebateCodeValueformintNo
RebateCodeTypeformRebateCodeTypeItemNo
RebateCodeIdformintNo
RebateAmountformdoubleNo
RebateCodeTypeItem Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringNo
DescriptionformstringNo
TotaPricePriceDetail Parameters:
NameParameterData TypeRequiredDescription
QuantityformintNo
PriceformdoubleNo
VatAmountformdoubleNo
DescriptionformstringNo

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.

PUT /services/{Id}/calculateprice HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"Interval":{"To":"0001-01-01T00:00:00"},"RebateCodeIds":[0],"Quantities":[{"PriceId":0,"Quantity":0,"OccupiesSpot":false}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"TotalPrice":0,"TotalVatAmount":0,"TotalPriceBeforeRebate":0,"AppliedCodes":[{"RebateCodeSign":"String","RebateCodeValue":0,"RebateCodeType":{"Id":0,"Name":"String","Description":"String"},"RebateCodeId":0,"RebateAmount":0}],"PriceDetails":[{"Quantity":0,"Price":0,"VatAmount":0,"Description":"String"}]}