Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /services/prices/ | Create a price | Create a new price on the 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. |
ServiceId | body | int | Yes | The service id |
Price | body | double | Yes | The price |
CurrencyId | body | string | Yes | The price currency |
CalculationTypeId | body | int | Yes | The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day |
VAT | body | decimal | Yes | The price VAT in percent |
Category | body | string | No | The price category if price has a category |
From | body | DateTime | No | The valid from date for the price. |
To | body | DateTime | No | The valid to date for the price. |
DaysOfWeek | body | int[] | No | If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. |
FromTime | body | TimeSpan? | No | If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. |
ToTime | body | TimeSpan? | No | If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters. |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
CompanyId | form | Guid | No | The company id |
Id | form | int | No | The price id |
ServiceId | form | int | No | The service id |
Price | form | double | No | The price |
CalculationTypeId | form | int | No | The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day |
CurrencyId | form | string | No | The price currency |
PriceSign | form | string | No | The price sign |
VAT | form | decimal | No | The price VAT in percent |
Category | form | string | No | The price category if price has a category |
PriceText | form | string | No | The price text to display |
From | form | DateTime | No | The valid from date for the price. |
To | form | DateTime | No | The valid to date for the price. |
DaysOfWeek | form | List<DayOfWeekDto> | No | If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. |
FromTime | form | TimeSpan? | No | If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. |
ToTime | form | TimeSpan? | No | If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters. |
Service | form | ServiceInfoResponse | No | |
IsTimeSpecific | form | bool | No | If the price is only valid for a specific time span |
IsDaysOfWeekSpecific | form | bool | No | If the price is only valid for specific days of week |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
DayOfWeekId | form | int | No | |
DotNetDayOfWeekId | form | int | No | |
DayOfWeek | form | string | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | |
Name | form | string | No | |
Description | form | string | No | |
ImageUrl | form | Uri | No | |
LengthInMinutes | form | int? | No | |
MaxNumberOfSpotsPerBooking | form | int | No | |
MinNumberOfSpotsPerBooking | form | int | No | |
GroupBooking | form | GroupBookingSettings | No | |
MultipleResource | form | MultipleResourceSettings | No | |
IsGroupBooking | form | bool | No | |
IsPaymentEnabled | form | bool | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Active | form | bool | No | |
Min | form | int | No | |
Max | form | int | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Active | form | bool | No | |
Min | form | int | No | |
Max | form | int | No |
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /services/prices/ HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateServicePrice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CalculationTypeId>0</CalculationTypeId>
<Category>String</Category>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CurrencyId>String</CurrencyId>
<DaysOfWeek xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</DaysOfWeek>
<From>0001-01-01T00:00:00</From>
<FromTime>PT0S</FromTime>
<Price>0</Price>
<ServiceId>0</ServiceId>
<To>0001-01-01T00:00:00</To>
<ToTime>PT0S</ToTime>
<VAT>0</VAT>
</CreateServicePrice>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ServicePriceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <CalculationTypeId>0</CalculationTypeId> <Category>String</Category> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <CurrencyId>String</CurrencyId> <DaysOfWeek> <DayOfWeekDto> <DayOfWeek>String</DayOfWeek> <DayOfWeekId>0</DayOfWeekId> <DotNetDayOfWeekId>0</DotNetDayOfWeekId> </DayOfWeekDto> </DaysOfWeek> <From>0001-01-01T00:00:00</From> <FromTime>PT0S</FromTime> <Id>0</Id> <IsDaysOfWeekSpecific>false</IsDaysOfWeekSpecific> <IsTimeSpecific>false</IsTimeSpecific> <Price>0</Price> <PriceSign>String</PriceSign> <PriceText>String</PriceText> <Service> <Description>String</Description> <GroupBooking> <Active>false</Active> <Max>0</Max> <Min>0</Min> </GroupBooking> <Id>0</Id> <ImageUrl i:nil="true" /> <IsGroupBooking>false</IsGroupBooking> <IsPaymentEnabled>false</IsPaymentEnabled> <LengthInMinutes>0</LengthInMinutes> <MaxNumberOfSpotsPerBooking>0</MaxNumberOfSpotsPerBooking> <MinNumberOfSpotsPerBooking>0</MinNumberOfSpotsPerBooking> <MultipleResource> <Active>false</Active> <Max>0</Max> <Min>0</Min> </MultipleResource> <Name>String</Name> </Service> <ServiceId>0</ServiceId> <To>0001-01-01T00:00:00</To> <ToTime>PT0S</ToTime> <VAT>0</VAT> </ServicePriceResponse>