BokaMera.API.Host

<back to all web services

CreateServicePrice

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/services/prices/Create a priceCreate a new price on the service
CreateServicePrice Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
ServiceIdbodyintYesThe service id
PricebodydoubleYesThe price
CurrencyIdbodystringYesThe price currency
CalculationTypeIdbodyintYesThe 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
VATbodydecimalYesThe price VAT in percent
CategorybodystringNoThe price category if price has a category
FrombodyDateTimeNoThe valid from date for the price.
TobodyDateTimeNoThe valid to date for the price.
DaysOfWeekbodyint[]NoIf 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.
FromTimebodyTimeSpan?NoIf 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.
ToTimebodyTimeSpan?NoIf the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
ServicePriceResponse Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidNoThe company id
IdformintNoThe price id
ServiceIdformintNoThe service id
PriceformdoubleNoThe price
CalculationTypeIdformintNoThe 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
CurrencyIdformstringNoThe price currency
PriceSignformstringNoThe price sign
VATformdecimalNoThe price VAT in percent
CategoryformstringNoThe price category if price has a category
PriceTextformstringNoThe price text to display
FromformDateTimeNoThe valid from date for the price.
ToformDateTimeNoThe valid to date for the price.
DaysOfWeekformList<DayOfWeekDto>NoIf 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.
FromTimeformTimeSpan?NoIf 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.
ToTimeformTimeSpan?NoIf the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
ServiceformServiceInfoResponseNo
IsTimeSpecificformboolNoIf the price is only valid for a specific time span
IsDaysOfWeekSpecificformboolNoIf the price is only valid for specific days of week
DayOfWeekDto Parameters:
NameParameterData TypeRequiredDescription
DayOfWeekIdformintNo
DotNetDayOfWeekIdformintNo
DayOfWeekformstringNo
ServiceInfoResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringNo
DescriptionformstringNo
ImageUrlformUriNo
LengthInMinutesformint?No
MaxNumberOfSpotsPerBookingformintNo
MinNumberOfSpotsPerBookingformintNo
GroupBookingformGroupBookingSettingsNo
MultipleResourceformMultipleResourceSettingsNo
IsGroupBookingformboolNo
IsPaymentEnabledformboolNo
GroupBookingSettings Parameters:
NameParameterData TypeRequiredDescription
ActiveformboolNo
MinformintNo
MaxformintNo
MultipleResourceSettings Parameters:
NameParameterData TypeRequiredDescription
ActiveformboolNo
MinformintNo
MaxformintNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	ServiceId: 0,
	Price: 0,
	CurrencyId: String,
	CalculationTypeId: 0,
	VAT: 0,
	Category: String,
	DaysOfWeek: 
	[
		0
	],
	FromTime: PT0S,
	ToTime: PT0S
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	ServiceId: 0,
	Price: 0,
	CalculationTypeId: 0,
	CurrencyId: String,
	PriceSign: String,
	VAT: 0,
	Category: String,
	PriceText: String,
	DaysOfWeek: 
	[
		{
			DayOfWeekId: 0,
			DotNetDayOfWeekId: 0,
			DayOfWeek: String
		}
	],
	FromTime: PT0S,
	ToTime: PT0S,
	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
	},
	IsTimeSpecific: False,
	IsDaysOfWeekSpecific: False
}