| PUT | /services/{Id}/calculateprice | Calculate price on service | Calculate an price on a service. |
|---|
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| CompanyId | body | Guid? | No | The company id, if empty will use the company id for the user you are logged in with. |
| Id | path | int | Yes | Id of the service |
| Interval | body | PriceInterval | Yes | The price interval to be used for calculations |
| RebateCodeIds | body | List<int> | Yes | Rebate codes applied to booking |
| Quantities | body | QuantityToBook[] | Yes | If you have selected to include the prices, here you can include the quantities to book to get the correct total price. |
| CustomerEmail | body | string | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| From | form | DateTime | Yes | The start date and time for the price to be calculated. Normally the booking start datetime. |
| To | form | DateTime? | No | The end date and time for the price to be calculated.Normally the booking end datetime. If nothing entered it will use the service length. |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| PriceId | form | int | Yes | 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) |
| Quantity | form | int | Yes | Set the number of spots or resources you want to book on the specific price category |
| OccupiesSpot | form | bool | No | If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information. |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| PriceSign | form | string | Yes | |
| CurrencyId | form | string | Yes | |
| TotalPrice | form | double | No | |
| TotalVatAmount | form | double | No | |
| TotalPriceBeforeRebate | form | double | No | |
| AppliedCodes | form | List<AppliedRebateCodesResponse> | Yes | |
| PriceDetails | form | List<TotalPricePriceDetail> | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| RebateCodeSign | form | string | Yes | |
| RebateCodeValue | form | int | No | |
| RebateCodeType | form | RebateCodeTypeResponse | Yes | |
| RebateCodeId | form | int | No | |
| RebateAmount | form | double | No |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | |
| Name | form | string | Yes | |
| Description | form | string | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Quantity | form | int | No | |
| Price | form | double | No | |
| VatAmount | form | double | No | |
| Description | form | string | Yes |
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: api.bookmore.com
Accept: text/jsv
Content-Type: text/jsv
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
}
],
CustomerEmail: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
PriceSign: String,
CurrencyId: String,
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
}
]
}