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.
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    @ValidateRequest(Validator="IsAuthenticated")
    public static class CreateLicense implements ICompany
    {
        /**
        * The company id, if empty will use the company id for the user you are logged in with.
        */
        @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
        public UUID CompanyId = null;

        /**
        * Id of the license type
        */
        @ApiMember(Description="Id of the license type", IsRequired=true)
        public Integer TypeId = null;

        /**
        * Any metadata connected to the license. In example for domain license set the requested domain name here.
        */
        @ApiMember(Description="Any metadata connected to the license. In example for domain license set the requested domain name here.", IsRequired=true)
        public String MetaData = null;

        /**
        * If you want to update your company billing information. Note, if no billing information is added before, you need to set this.
        */
        @ApiMember(Description="If you want to update your company billing information. Note, if no billing information is added before, you need to set this.")
        public BillingInformationResponse BillingInformation = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public CreateLicense setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getTypeId() { return TypeId; }
        public CreateLicense setTypeId(Integer value) { this.TypeId = value; return this; }
        public String getMetaData() { return MetaData; }
        public CreateLicense setMetaData(String value) { this.MetaData = value; return this; }
        public BillingInformationResponse getBillingInformation() { return BillingInformation; }
        public CreateLicense setBillingInformation(BillingInformationResponse value) { this.BillingInformation = value; return this; }
    }

    public static class BillingInformationResponse
    {
        /**
        * The company id.
        */
        @ApiMember(Description="The company id.")
        public UUID CompanyId = null;

        /**
        * The prefered billing method.
        */
        @ApiMember(Description="The prefered billing method.", IsRequired=true)
        public Integer BillingMethodId = null;

        /**
        * The name that should be printed on the billing information, normally this would be your company name.
        */
        @ApiMember(Description="The name that should be printed on the billing information, normally this would be your company name.")
        public String Name = null;

        /**
        * If you want to add the attention to the billing address.
        */
        @ApiMember(Description="If you want to add the attention to the billing address.")
        public String Attention = null;

        /**
        * The street for the billing adress. This is required when having postal invoice as billing method.
        */
        @ApiMember(Description="The street for the billing adress. This is required when having postal invoice as billing method.")
        public String Street1 = null;

        /**
        * The street for the billing adress.
        */
        @ApiMember(Description="The street for the billing adress.")
        public String Street2 = null;

        /**
        * The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.
        */
        @ApiMember(Description="The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.")
        public String ZipCode = null;

        /**
        * The city for the billing adress. This is required when having postal invoice as billing method.
        */
        @ApiMember(Description="The city for the billing adress. This is required when having postal invoice as billing method.")
        public String City = null;

        /**
        * The country for the billing adress. This is required when having postal invoice as billing method.
        */
        @ApiMember(Description="The country for the billing adress. This is required when having postal invoice as billing method.")
        public String CountryId = null;

        /**
        * The billing email. This is required when having email invoice as billing method.
        */
        @ApiMember(Description="The billing email. This is required when having email invoice as billing method.")
        public String Email = null;

        /**
        * The company global location number.
        */
        @ApiMember(Description="The company global location number.")
        public String GLN = null;

        /**
        * You're internal rereference.
        */
        @ApiMember(Description="You're internal rereference.")
        public String ReferenceLine1 = null;

        /**
        * You're internal rereference.
        */
        @ApiMember(Description="You're internal rereference.")
        public String ReferenceLine2 = null;

        /**
        * The billing payment terms in days. This is default 15 days.
        */
        @ApiMember(Description="The billing payment terms in days. This is default 15 days.")
        public Integer PaymentTermsDays = null;

        /**
        * The company vat registration number.
        */
        @ApiMember(Description="The company vat registration number.")
        public String VatRegistrationNumber = null;

        /**
        * The billing method options to choose from
        */
        @ApiMember(Description="The billing method options to choose from")
        public ArrayList<BillingMethod> BillingMethodOptions = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public BillingInformationResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getBillingMethodId() { return BillingMethodId; }
        public BillingInformationResponse setBillingMethodId(Integer value) { this.BillingMethodId = value; return this; }
        public String getName() { return Name; }
        public BillingInformationResponse setName(String value) { this.Name = value; return this; }
        public String getAttention() { return Attention; }
        public BillingInformationResponse setAttention(String value) { this.Attention = value; return this; }
        public String getStreet1() { return Street1; }
        public BillingInformationResponse setStreet1(String value) { this.Street1 = value; return this; }
        public String getStreet2() { return Street2; }
        public BillingInformationResponse setStreet2(String value) { this.Street2 = value; return this; }
        public String getZipCode() { return ZipCode; }
        public BillingInformationResponse setZipCode(String value) { this.ZipCode = value; return this; }
        public String getCity() { return City; }
        public BillingInformationResponse setCity(String value) { this.City = value; return this; }
        public String getCountryId() { return CountryId; }
        public BillingInformationResponse setCountryId(String value) { this.CountryId = value; return this; }
        public String getEmail() { return Email; }
        public BillingInformationResponse setEmail(String value) { this.Email = value; return this; }
        public String getGln() { return GLN; }
        public BillingInformationResponse setGln(String value) { this.GLN = value; return this; }
        public String getReferenceLine1() { return ReferenceLine1; }
        public BillingInformationResponse setReferenceLine1(String value) { this.ReferenceLine1 = value; return this; }
        public String getReferenceLine2() { return ReferenceLine2; }
        public BillingInformationResponse setReferenceLine2(String value) { this.ReferenceLine2 = value; return this; }
        public Integer getPaymentTermsDays() { return PaymentTermsDays; }
        public BillingInformationResponse setPaymentTermsDays(Integer value) { this.PaymentTermsDays = value; return this; }
        public String getVatRegistrationNumber() { return VatRegistrationNumber; }
        public BillingInformationResponse setVatRegistrationNumber(String value) { this.VatRegistrationNumber = value; return this; }
        public ArrayList<BillingMethod> getBillingMethodOptions() { return BillingMethodOptions; }
        public BillingInformationResponse setBillingMethodOptions(ArrayList<BillingMethod> value) { this.BillingMethodOptions = value; return this; }
    }

    public static class BillingMethod extends BaseModel
    {
        public ArrayList<BillingMethodCountriesRelation> BillingMethodCountriesRelation = null;
        @Required()
        public String Name = null;

        @Required()
        public String Description = null;

        public Date ModifiedDate = null;
        public Integer Id = null;
        
        public ArrayList<BillingMethodCountriesRelation> getBillingMethodCountriesRelation() { return BillingMethodCountriesRelation; }
        public BillingMethod setBillingMethodCountriesRelation(ArrayList<BillingMethodCountriesRelation> value) { this.BillingMethodCountriesRelation = value; return this; }
        public String getName() { return Name; }
        public BillingMethod setName(String value) { this.Name = value; return this; }
        public String getDescription() { return Description; }
        public BillingMethod setDescription(String value) { this.Description = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public BillingMethod setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
        public Integer getId() { return Id; }
        public BillingMethod setId(Integer value) { this.Id = value; return this; }
    }

    public static class BaseModel
    {
        
    }

    public static class BillingMethodCountriesRelation extends BaseModel
    {
        @Required()
        public Integer BillingMethodId = null;

        @Required()
        public String CountryId = null;

        public Date ModifiedDate = null;
        
        public Integer getBillingMethodId() { return BillingMethodId; }
        public BillingMethodCountriesRelation setBillingMethodId(Integer value) { this.BillingMethodId = value; return this; }
        public String getCountryId() { return CountryId; }
        public BillingMethodCountriesRelation setCountryId(String value) { this.CountryId = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public BillingMethodCountriesRelation setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
    }

    public static class CompanyLicenseQueryResponse
    {
        public Integer Id = null;
        public Integer TypeId = null;
        public LicenseTypeQueryResponse Type = null;
        public Date ValidFrom = null;
        public Date ValidTo = null;
        public String MetaData = null;
        public Boolean Active = null;
        public Boolean Canceled = null;
        public Date Updated = null;
        public Date Created = null;
        
        public Integer getId() { return Id; }
        public CompanyLicenseQueryResponse setId(Integer value) { this.Id = value; return this; }
        public Integer getTypeId() { return TypeId; }
        public CompanyLicenseQueryResponse setTypeId(Integer value) { this.TypeId = value; return this; }
        public LicenseTypeQueryResponse getType() { return Type; }
        public CompanyLicenseQueryResponse setType(LicenseTypeQueryResponse value) { this.Type = value; return this; }
        public Date getValidFrom() { return ValidFrom; }
        public CompanyLicenseQueryResponse setValidFrom(Date value) { this.ValidFrom = value; return this; }
        public Date getValidTo() { return ValidTo; }
        public CompanyLicenseQueryResponse setValidTo(Date value) { this.ValidTo = value; return this; }
        public String getMetaData() { return MetaData; }
        public CompanyLicenseQueryResponse setMetaData(String value) { this.MetaData = value; return this; }
        public Boolean isActive() { return Active; }
        public CompanyLicenseQueryResponse setActive(Boolean value) { this.Active = value; return this; }
        public Boolean isCanceled() { return Canceled; }
        public CompanyLicenseQueryResponse setCanceled(Boolean value) { this.Canceled = value; return this; }
        public Date getUpdated() { return Updated; }
        public CompanyLicenseQueryResponse setUpdated(Date value) { this.Updated = value; return this; }
        public Date getCreated() { return Created; }
        public CompanyLicenseQueryResponse setCreated(Date value) { this.Created = value; return this; }
    }

    public static class LicenseTypeQueryResponse
    {
        /**
        * The license type id
        */
        @ApiMember(Description="The license type id")
        public Integer Id = null;

        /**
        * The license type name
        */
        @ApiMember(Description="The license type name")
        public String Name = null;

        /**
        * The license type description
        */
        @ApiMember(Description="The license type description")
        public String Description = null;

        /**
        * If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.
        */
        @ApiMember(Description="If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.")
        public Boolean IsExtraLicenseOption = null;

        /**
        * The period of notice for the license in days.
        */
        @ApiMember(Description="The period of notice for the license in days.")
        public Integer PeriodOfNoticeDays = null;

        /**
        * The license items for the license type
        */
        @ApiMember(Description="The license items for the license type")
        public ArrayList<LicenseItemsResponse> Items = null;

        /**
        * The license prices in each country for the license type
        */
        @ApiMember(Description="The license prices in each country for the license type")
        public ArrayList<LicensePrice> Prices = null;
        
        public Integer getId() { return Id; }
        public LicenseTypeQueryResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public LicenseTypeQueryResponse setName(String value) { this.Name = value; return this; }
        public String getDescription() { return Description; }
        public LicenseTypeQueryResponse setDescription(String value) { this.Description = value; return this; }
        public Boolean getIsExtraLicenseOption() { return IsExtraLicenseOption; }
        public LicenseTypeQueryResponse setIsExtraLicenseOption(Boolean value) { this.IsExtraLicenseOption = value; return this; }
        public Integer getPeriodOfNoticeDays() { return PeriodOfNoticeDays; }
        public LicenseTypeQueryResponse setPeriodOfNoticeDays(Integer value) { this.PeriodOfNoticeDays = value; return this; }
        public ArrayList<LicenseItemsResponse> getItems() { return Items; }
        public LicenseTypeQueryResponse setItems(ArrayList<LicenseItemsResponse> value) { this.Items = value; return this; }
        public ArrayList<LicensePrice> getPrices() { return Prices; }
        public LicenseTypeQueryResponse setPrices(ArrayList<LicensePrice> value) { this.Prices = value; return this; }
    }

    public static class LicenseItemsResponse
    {
        public Integer Id = null;
        public String Name = null;
        public Integer AllowedItems = null;
        
        public Integer getId() { return Id; }
        public LicenseItemsResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public LicenseItemsResponse setName(String value) { this.Name = value; return this; }
        public Integer getAllowedItems() { return AllowedItems; }
        public LicenseItemsResponse setAllowedItems(Integer value) { this.AllowedItems = value; return this; }
    }

    public static class LicensePrice extends BaseModel
    {
        @Ignore()
        public Country Country = null;

        @Ignore()
        public Boolean MonthlyPayment = null;

        @Required()
        public Integer LicenseTypeId = null;

        @Required()
        public String CountryId = null;

        @Required()
        public Integer Price = null;

        public Date ModifiedDate = null;
        
        public Country getCountry() { return Country; }
        public LicensePrice setCountry(Country value) { this.Country = value; return this; }
        public Boolean isMonthlyPayment() { return MonthlyPayment; }
        public LicensePrice setMonthlyPayment(Boolean value) { this.MonthlyPayment = value; return this; }
        public Integer getLicenseTypeId() { return LicenseTypeId; }
        public LicensePrice setLicenseTypeId(Integer value) { this.LicenseTypeId = value; return this; }
        public String getCountryId() { return CountryId; }
        public LicensePrice setCountryId(String value) { this.CountryId = value; return this; }
        public Integer getPrice() { return Price; }
        public LicensePrice setPrice(Integer value) { this.Price = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public LicensePrice setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
    }

    public static class Country extends BaseModel
    {
        @References(Currency.class)
        public String CurrencyId = null;

        public Currency CurrencyInfo = null;
        @Required()
        public String Name = null;

        public String Culture = null;
        public String TimeZone = null;
        public Date ModifiedDate = null;
        @Required()
        public String Id = null;
        
        public String getCurrencyId() { return CurrencyId; }
        public Country setCurrencyId(String value) { this.CurrencyId = value; return this; }
        public Currency getCurrencyInfo() { return CurrencyInfo; }
        public Country setCurrencyInfo(Currency value) { this.CurrencyInfo = value; return this; }
        public String getName() { return Name; }
        public Country setName(String value) { this.Name = value; return this; }
        public String getCulture() { return Culture; }
        public Country setCulture(String value) { this.Culture = value; return this; }
        public String getTimeZone() { return TimeZone; }
        public Country setTimeZone(String value) { this.TimeZone = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public Country setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
        public String getId() { return Id; }
        public Country setId(String value) { this.Id = value; return this; }
    }

    public static class Currency extends BaseModel
    {
        @Required()
        public String Name = null;

        @Required()
        public String CurrencySign = null;

        @Required()
        public Boolean Active = null;

        public Date ModifiedDate = null;
        @Required()
        public String Id = null;
        
        public String getName() { return Name; }
        public Currency setName(String value) { this.Name = value; return this; }
        public String getCurrencySign() { return CurrencySign; }
        public Currency setCurrencySign(String value) { this.CurrencySign = value; return this; }
        public Boolean isActive() { return Active; }
        public Currency setActive(Boolean value) { this.Active = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public Currency setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
        public String getId() { return Id; }
        public Currency setId(String value) { this.Id = value; return this; }
    }

}

Java CreateLicense DTOs

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

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<CreateLicense xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <BillingInformation>
    <Attention>String</Attention>
    <BillingMethodId>0</BillingMethodId>
    <BillingMethodOptions xmlns:d3p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
      <d3p1:BillingMethod>
        <d3p1:BillingMethodCountriesRelation>
          <d3p1:BillingMethodCountriesRelation>
            <d3p1:BillingMethodId>0</d3p1:BillingMethodId>
            <d3p1:CountryId>String</d3p1:CountryId>
            <d3p1:ModifiedDate xmlns:d7p1="http://schemas.datacontract.org/2004/07/System">
              <d7p1:DateTime>0001-01-01T00:00:00Z</d7p1:DateTime>
              <d7p1:OffsetMinutes>0</d7p1:OffsetMinutes>
            </d3p1:ModifiedDate>
          </d3p1:BillingMethodCountriesRelation>
        </d3p1:BillingMethodCountriesRelation>
        <d3p1:Description>String</d3p1:Description>
        <d3p1:Id>0</d3p1:Id>
        <d3p1:ModifiedDate xmlns:d5p1="http://schemas.datacontract.org/2004/07/System">
          <d5p1:DateTime>0001-01-01T00:00:00Z</d5p1:DateTime>
          <d5p1:OffsetMinutes>0</d5p1:OffsetMinutes>
        </d3p1:ModifiedDate>
        <d3p1:Name>String</d3p1:Name>
      </d3p1:BillingMethod>
    </BillingMethodOptions>
    <City>String</City>
    <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
    <CountryId>String</CountryId>
    <Email>String</Email>
    <GLN>String</GLN>
    <Name>String</Name>
    <PaymentTermsDays>0</PaymentTermsDays>
    <ReferenceLine1>String</ReferenceLine1>
    <ReferenceLine2>String</ReferenceLine2>
    <Street1>String</Street1>
    <Street2>String</Street2>
    <VatRegistrationNumber>String</VatRegistrationNumber>
    <ZipCode>String</ZipCode>
  </BillingInformation>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <MetaData>String</MetaData>
  <TypeId>0</TypeId>
</CreateLicense>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CompanyLicenseQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Active>false</Active>
  <Canceled>false</Canceled>
  <Created>0001-01-01T00:00:00</Created>
  <Id>0</Id>
  <MetaData>String</MetaData>
  <Type>
    <Description>String</Description>
    <Id>0</Id>
    <IsExtraLicenseOption>false</IsExtraLicenseOption>
    <Items>
      <LicenseItemsResponse>
        <AllowedItems>0</AllowedItems>
        <Id>0</Id>
        <Name>String</Name>
      </LicenseItemsResponse>
    </Items>
    <Name>String</Name>
    <PeriodOfNoticeDays>0</PeriodOfNoticeDays>
    <Prices xmlns:d3p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
      <d3p1:LicensePrice>
        <d3p1:Country>
          <d3p1:Culture>String</d3p1:Culture>
          <d3p1:CurrencyId>String</d3p1:CurrencyId>
          <d3p1:CurrencyInfo>
            <d3p1:Active>false</d3p1:Active>
            <d3p1:CurrencySign>String</d3p1:CurrencySign>
            <d3p1:Id>String</d3p1:Id>
            <d3p1:ModifiedDate xmlns:d7p1="http://schemas.datacontract.org/2004/07/System">
              <d7p1:DateTime>0001-01-01T00:00:00Z</d7p1:DateTime>
              <d7p1:OffsetMinutes>0</d7p1:OffsetMinutes>
            </d3p1:ModifiedDate>
            <d3p1:Name>String</d3p1:Name>
          </d3p1:CurrencyInfo>
          <d3p1:Id>String</d3p1:Id>
          <d3p1:ModifiedDate xmlns:d6p1="http://schemas.datacontract.org/2004/07/System">
            <d6p1:DateTime>0001-01-01T00:00:00Z</d6p1:DateTime>
            <d6p1:OffsetMinutes>0</d6p1:OffsetMinutes>
          </d3p1:ModifiedDate>
          <d3p1:Name>String</d3p1:Name>
          <d3p1:TimeZone>String</d3p1:TimeZone>
        </d3p1:Country>
        <d3p1:CountryId>String</d3p1:CountryId>
        <d3p1:LicenseTypeId>0</d3p1:LicenseTypeId>
        <d3p1:ModifiedDate xmlns:d5p1="http://schemas.datacontract.org/2004/07/System">
          <d5p1:DateTime>0001-01-01T00:00:00Z</d5p1:DateTime>
          <d5p1:OffsetMinutes>0</d5p1:OffsetMinutes>
        </d3p1:ModifiedDate>
        <d3p1:Price>0</d3p1:Price>
      </d3p1:LicensePrice>
    </Prices>
  </Type>
  <TypeId>0</TypeId>
  <Updated>0001-01-01T00:00:00</Updated>
  <ValidFrom>0001-01-01T00:00:00</ValidFrom>
  <ValidTo>0001-01-01T00:00:00</ValidTo>
</CompanyLicenseQueryResponse>