BokaMera.API.Host

<back to all web services

CreateLicense

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/licenses/companyAdd new license to a companyAdd a new license to the company for the logged in user.
CreateLicense Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
TypeIdbodyint?YesId of the license type
MetaDatabodystringYesAny metadata connected to the license. In example for domain license set the requested domain name here.
BillingInformationbodyBillingInformationResponseYesIf you want to update your company billing information. Note, if no billing information is added before, you need to set this.
BillingInformationResponse Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidNoThe company id.
BillingMethodIdformintYesThe prefered billing method.
NameformstringYesThe name that should be printed on the billing information, normally this would be your company name.
FirstNameformstringYesBilling person first name
LastNameformstringYesBilling person last name
PhoneNumberformstringYesBilling person phone numbers
AttentionformstringYesIf you want to add the attention to the billing address.
Street1formstringYesThe street for the billing adress. This is required when having postal invoice as billing method.
Street2formstringYesThe street for the billing adress.
ZipCodeformstringYesThe zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.
CityformstringYesThe city for the billing adress. This is required when having postal invoice as billing method.
CountryIdformstringYesThe country for the billing adress. This is required when having postal invoice as billing method.
EmailformstringYesThe billing email. This is required when having email invoice as billing method.
GLNformstringYesThe company global location number.
ReferenceLine1formstringYesYour internal reference.
ReferenceLine2formstringYesYour internal reference.
PaymentTermsDaysformintNoThe billing payment terms in days. This is default 15 days.
VatRegistrationNumberformstringYesThe company vat registration number.
BillingMethodOptionsformList<BillingMethod>YesThe billing method options to choose from
BillingMethod Parameters:
NameParameterData TypeRequiredDescription
BillingMethodCountriesRelationformList<BillingMethodCountriesRelation>Yes
NameformstringYes
DescriptionformstringYes
ModifiedDateformDateTimeOffset?No
IdformintNo
BillingMethodCountriesRelation Parameters:
NameParameterData TypeRequiredDescription
BillingMethodIdformintYes
CountryIdformstringYes
ModifiedDateformDateTimeOffset?No
CompanyLicenseQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
TypeIdformintNo
TypeformLicenseTypeQueryResponseYes
ValidFromformDateTimeNo
ValidToformDateTimeNo
MetaDataformstringYes
ActiveformboolNo
CanceledformboolNo
UpdatedformDateTimeNo
CreatedformDateTimeNo
LicenseTypeQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe license type id
NameformstringYesThe license type name
DescriptionformstringYesThe license type description
IsExtraLicenseOptionformboolNoIf the license type is not a standard license but instead an extra license option. An example would be sending newsletter license.
PeriodOfNoticeDaysformintNoThe period of notice for the license in days.
ItemsformList<LicenseItemsResponse>YesThe license items for the license type
PricesformList<LicensePrice>YesThe license prices in each country for the license type
LicenseItemsResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringYes
AllowedItemsformintNo
LicensePrice Parameters:
NameParameterData TypeRequiredDescription
CountryformCountryYes
MonthlyPaymentformboolNo
LicenseTypeIdformintYes
CountryIdformstringYes
PriceformintYes
ModifiedDateformDateTimeOffset?No
Country Parameters:
NameParameterData TypeRequiredDescription
CurrencyIdformstringYes
CurrencyInfoformCurrencyYes
NameformstringYes
CultureformstringNo
TimeZoneformstringNo
ModifiedDateformDateTimeOffset?No
IdformstringYes
Currency Parameters:
NameParameterData TypeRequiredDescription
NameformstringYes
CurrencySignformstringYes
ActiveformboolYes
ModifiedDateformDateTimeOffset?No
IdformstringYes

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 /licenses/company HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	TypeId: 0,
	MetaData: String,
	BillingInformation: 
	{
		BillingMethodId: 0,
		Name: String,
		FirstName: String,
		LastName: String,
		PhoneNumber: String,
		Attention: String,
		Street1: String,
		Street2: String,
		ZipCode: String,
		City: String,
		CountryId: String,
		Email: String,
		GLN: String,
		ReferenceLine1: String,
		ReferenceLine2: String,
		PaymentTermsDays: 0,
		VatRegistrationNumber: String,
		BillingMethodOptions: 
		[
			{
				BillingMethodCountriesRelation: 
				[
					{
						BillingMethodId: 0,
						CountryId: String,
						ModifiedDate: 0001-01-01T00:00:00.0000000+00:00
					}
				],
				Name: String,
				Description: String,
				ModifiedDate: 0001-01-01T00:00:00.0000000+00:00,
				Id: 0
			}
		]
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	TypeId: 0,
	Type: 
	{
		Id: 0,
		Name: String,
		Description: String,
		IsExtraLicenseOption: False,
		PeriodOfNoticeDays: 0,
		Items: 
		[
			{
				Id: 0,
				Name: String,
				AllowedItems: 0
			}
		],
		Prices: 
		[
			{
				Country: 
				{
					CurrencyId: String,
					CurrencyInfo: 
					{
						Name: String,
						CurrencySign: String,
						Active: False,
						ModifiedDate: 0001-01-01T00:00:00.0000000+00:00,
						Id: String
					},
					Name: String,
					Culture: String,
					TimeZone: String,
					ModifiedDate: 0001-01-01T00:00:00.0000000+00:00,
					Id: String
				},
				MonthlyPayment: True,
				LicenseTypeId: 0,
				CountryId: String,
				Price: 0,
				ModifiedDate: 0001-01-01T00:00:00.0000000+00:00
			}
		]
	},
	MetaData: String,
	Active: False,
	Canceled: False
}