Requires the role: | superadmin |
POST | /companies/{Id}/copy | Create new company | Copy a company information. |
---|
export enum CodeLockSystemType
{
Sample = 'Sample',
RcoM5 = 'RcoM5',
AxemaVaka = 'AxemaVaka',
VanderbiltOmnis = 'VanderbiltOmnis',
ParakeyParakey = 'ParakeyParakey',
AmidoDax = 'AmidoDax',
TelkeyTelkey = 'TelkeyTelkey',
TechSolutionsSiedle = 'TechSolutionsSiedle',
Accessy = 'Accessy',
Zesec = 'Zesec',
Enabla = 'Enabla',
}
export class CompanyBookingSettings
{
public EnableMobileApp: boolean;
public BookingReceiptMessage: string;
public ShowFreeTimesLeft: boolean;
public EnableShowBookedTimes: boolean;
public BookingAgreement: string;
/** @description The settings for how to display week number. 1 = ShowWeekNumberFromDate, 2 = ShowWeekNumberToDate, 3 = ShowWeekNumberFromToDate, 4 = DontShowWeekNumber */
// @ApiMember(DataType="int", Description="The settings for how to display week number. 1 = ShowWeekNumberFromDate, 2 = ShowWeekNumberToDate, 3 = ShowWeekNumberFromToDate, 4 = DontShowWeekNumber ")
public WeekNumberSetting: number;
public ShowBookedTimes: boolean;
/** @description The payment provider id. 1 = Payson Checkout 1.0, 2= Payson Checkout 2.0 ... To get the full payment provider for the company call GET /payment/settings */
// @ApiMember(Description="The payment provider id. 1 = Payson Checkout 1.0, 2= Payson Checkout 2.0 ... To get the full payment provider for the company call GET /payment/settings")
public PaymentProviderId: number;
/** @description If it's only allowed for existing customers to book */
// @ApiMember(DataType="boolean", Description="If it's only allowed for existing customers to book")
public BookOnlyOnExistingCustomers: boolean;
/** @description If payment is enabled */
// @ApiMember(DataType="boolean", Description="If payment is enabled")
public PaymentEnabled: boolean;
public constructor(init?: Partial<CompanyBookingSettings>) { (Object as any).assign(this, init); }
}
export class CompanySystemSettings
{
/** @description If the booking is active or not */
// @ApiMember(DataType="bool", Description="If the booking is active or not")
public Active: boolean;
/** @description If the booking is not active, what message to show to the customers */
// @ApiMember(DataType="string", Description="If the booking is not active, what message to show to the customers")
public InactiveMessage: string;
/** @description If the company should be visible in search results on hompage */
// @ApiMember(DataType="bool", Description="If the company should be visible in search results on hompage")
public Searchable: boolean;
/** @description If you have a google analytics account and want to track your customers behaviors. */
// @ApiMember(DataType="string", Description="If you have a google analytics account and want to track your customers behaviors.")
public GATrackingId: string;
/** @description If you have a google Ads Conversion Id account and want to track your customers behaviors. */
// @ApiMember(DataType="string", Description="If you have a google Ads Conversion Id account and want to track your customers behaviors.")
public GoogleAdsConversionId: string;
/** @description If you have a LinkedIn account and want to track your customers behaviors. */
// @ApiMember(DataType="string", Description="If you have a LinkedIn account and want to track your customers behaviors.")
public LinkedinTagId: string;
/** @description If you have a Google Ads Conversion Label and want to track your customers behaviors. */
// @ApiMember(DataType="string", Description="If you have a Google Ads Conversion Label and want to track your customers behaviors.")
public GoogleAdsConversionLabel: string;
/** @description If you have a google tag manager account and want to track your customers behaviors. */
// @ApiMember(DataType="string", Description="If you have a google tag manager account and want to track your customers behaviors.")
public GTMTrackingId: string;
/** @description If you have a facebook account and want to track your customers behaviors. */
// @ApiMember(DataType="string", Description="If you have a facebook account and want to track your customers behaviors.")
public FacebookPixelId: string;
/** @description If you want your customers to be albe to change language on your homepage */
// @ApiMember(DataType="bool", Description="If you want your customers to be albe to change language on your homepage")
public MultiLanguage: boolean;
/** @description If the company should be visible on the marketplace */
// @ApiMember(DataType="bool", Description="If the company should be visible on the marketplace")
public ShowOnMarketplace: boolean;
/** @description If you want your own written text on your homepage to be translated using google analytics when a user changes language */
// @ApiMember(DataType="bool", Description="If you want your own written text on your homepage to be translated using google analytics when a user changes language")
public EnableAPITranslation: boolean;
/** @description What is the standard language your homepage information is written in. Select from the different countries, ie. SE,NO,EN */
// @ApiMember(DataType="string", Description="What is the standard language your homepage information is written in. Select from the different countries, ie. SE,NO,EN")
public DefaultLanguage: string;
/** @description If you want to allow to send customer information in the tracking events to the external providers. Note you as a company are responsible for informing your customers and handling the data in terms of GDPR. */
// @ApiMember(Description="If you want to allow to send customer information in the tracking events to the external providers. Note you as a company are responsible for informing your customers and handling the data in terms of GDPR. ")
public SendCustomerInformationToExternalProviders: boolean;
public constructor(init?: Partial<CompanySystemSettings>) { (Object as any).assign(this, init); }
}
export class CompanyWidgetSettings
{
/** @description The service layouts id. */
// @ApiMember(Description="The service layouts id.")
public ServiceLayoutId: number;
/** @description The time layouts id. */
// @ApiMember(Description="The time layouts id.")
public TimeLayoutId: number;
/** @description The booking layouts id. */
// @ApiMember(Description="The booking layouts id.")
public BookingLayoutId: number;
/** @description The primary color of the booking widget. */
// @ApiMember(Description="The primary color of the booking widget.")
public PrimaryColor: string;
/** @description If you should show the service image in the booking widget. */
// @ApiMember(Description="If you should show the service image in the booking widget.")
public ShowServiceImage: boolean;
/** @description If you should show the rebate code field in the booking widget. */
// @ApiMember(Description="If you should show the rebate code field in the booking widget.")
public ShowRebateCodeField: boolean;
/** @description If you should show the next available time in the booking widget. */
// @ApiMember(Description="If you should show the next available time in the booking widget.")
public ShowNextAvailableTime: boolean;
/** @description If you should show the end time in the booking widget. */
// @ApiMember(Description="If you should show the end time in the booking widget.")
public ShowEndTime: boolean;
/** @description What text to show on booked time slots. Default text is Booked */
// @ApiMember(Description="What text to show on booked time slots. Default text is Booked")
public BookedTimeSlotText: string;
/** @description If the widget should be displayed in dark theme */
// @ApiMember(Description="If the widget should be displayed in dark theme")
public DarkTheme: boolean;
/** @description If you should show the subscribe to newsletter checkbox in the booking widget. */
// @ApiMember(Description="If you should show the subscribe to newsletter checkbox in the booking widget.")
public ShowSubscribeToNewsletter: boolean;
public constructor(init?: Partial<CompanyWidgetSettings>) { (Object as any).assign(this, init); }
}
export class HomepageSettingsResponse
{
/** @description The text for homepage heading */
// @ApiMember(Description="The text for homepage heading")
public HomepageHeading: string;
/** @description The text for homepage startpage heading */
// @ApiMember(Description="The text for homepage startpage heading")
public WelcomePageHeading: string;
/** @description The text for homepage startpage body */
// @ApiMember(Description="The text for homepage startpage body")
public WelcomePageBody: string;
/** @description The text for homepage about us page heading */
// @ApiMember(Description="The text for homepage about us page heading")
public AboutUsPageHeading: string;
/** @description The text for homepage about us page body */
// @ApiMember(Description="The text for homepage about us page body")
public AboutUsPageBody: string;
/** @description The startpage image url */
// @ApiMember(Description="The startpage image url")
public ImageUrl: string;
/** @description The cover image url */
// @ApiMember(Description="The cover image url")
public CoverImage: string;
/** @description Show rating on the page */
// @ApiMember(Description="Show rating on the page")
public ShowRating: boolean;
/** @description The template for the homepage */
// @ApiMember(Description="The template for the homepage")
public HomePageTemplateId: number;
/** @description The hero section style for the homepage */
// @ApiMember(Description="The hero section style for the homepage")
public HeroSectionStyleId: number;
/** @description Enable the BokaMera Homepage */
// @ApiMember(Description="Enable the BokaMera Homepage")
public EnableHomepage: boolean;
public constructor(init?: Partial<HomepageSettingsResponse>) { (Object as any).assign(this, init); }
}
export class CompanyRatingSummary
{
/** @description The average rating score */
// @ApiMember(Description="The average rating score")
public AverageScore: number;
/** @description The number of ratings of score 1 */
// @ApiMember(Description="The number of ratings of score 1")
public RatingScore1Count: number;
/** @description The number of ratings of score 2 */
// @ApiMember(Description="The number of ratings of score 2")
public RatingScore2Count: number;
/** @description The number of ratings of score 3 */
// @ApiMember(Description="The number of ratings of score 3")
public RatingScore3Count: number;
/** @description The number of ratings of score 4 */
// @ApiMember(Description="The number of ratings of score 4")
public RaingScore4Count: number;
/** @description The number of ratings of score 5 */
// @ApiMember(Description="The number of ratings of score 5")
public RatingScore5Count: number;
/** @description The number of ratings */
// @ApiMember(Description="The number of ratings")
public Count: number;
public constructor(init?: Partial<CompanyRatingSummary>) { (Object as any).assign(this, init); }
}
export class RatingReviewResponse
{
/** @description The title for the review */
// @ApiMember(Description="The title for the review")
public Title: string;
/** @description The description for the review */
// @ApiMember(Description="The description for the review")
public Description: string;
/** @description The rating score */
// @ApiMember(Description="The rating score")
public RatingScore: number;
/** @description The review author */
// @ApiMember(Description="The review author")
public Author: string;
/** @description The created date */
// @ApiMember(Description="The created date")
public Created: string;
/** @description The review answer from the company */
// @ApiMember(Description="The review answer from the company")
public ReviewAnswer: string;
public constructor(init?: Partial<RatingReviewResponse>) { (Object as any).assign(this, init); }
}
export class CustomFieldValueResponse
{
public Value: string;
public constructor(init?: Partial<CustomFieldValueResponse>) { (Object as any).assign(this, init); }
}
export class CustomFieldConfigData
{
/** @description Custom field id */
// @ApiMember(Description="Custom field id")
public Id: number;
/** @description Configuration name. Example: 'Number of persons'. */
// @ApiMember(Description="Configuration name. Example: 'Number of persons'.")
public Name: string;
/** @description Custom field description. Example: 'For how many persons is this booking?' */
// @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'")
public Description: string;
/** @description Field width. Example: 20 for 20px */
// @ApiMember(Description="Field width. Example: 20 for 20px")
public Width?: number;
/** @description Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' */
// @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
public DataType: string;
/** @description Default value of the field. Example: '3' */
// @ApiMember(Description="Default value of the field. Example: '3'")
public DefaultValue: string;
/** @description Determines if the field is required to have a value or not */
// @ApiMember(Description="Determines if the field is required to have a value or not")
public IsMandatory: boolean;
/** @description Error message shown to the user if the field data is required but not entered */
// @ApiMember(Description="Error message shown to the user if the field data is required but not entered")
public MandatoryErrorMessage: string;
/** @description Max lenght of the field */
// @ApiMember(Description="Max lenght of the field")
public MaxLength: number;
/** @description If the field should have multiple lines */
// @ApiMember(Description="If the field should have multiple lines")
public MultipleLineText: boolean;
/** @description Regular expression used for validation of the field */
// @ApiMember(Description="Regular expression used for validation of the field")
public RegEx: string;
/** @description Error message shown if the regular expression validation failed */
// @ApiMember(Description="Error message shown if the regular expression validation failed")
public RegExErrorMessage: string;
/** @description The values to select from if Datatype is DropDown for this custom field */
// @ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")
public Values: CustomFieldValueResponse[];
public constructor(init?: Partial<CustomFieldConfigData>) { (Object as any).assign(this, init); }
}
export class CompanyQueryResponse
{
public Id: string;
public Name: string;
/** @description The organisation number will only be visible if your owner to the company */
// @ApiMember(DataType="string", Description="The organisation number will only be visible if your owner to the company")
public OrganisationNumber: string;
/** @description What type of company. If it's used for personal use or as a company. */
// @ApiMember(DataType="int", Description="What type of company. If it's used for personal use or as a company.")
public TypeId?: number;
public Details: string;
public CategoryId: number;
public Category: string;
public LogoType: string;
public CoverImage: string;
public Street1: string;
public Street2: string;
public ZipCode: string;
public City: string;
public CountryId: string;
public Longitude: string;
public Latitude: string;
public Distance?: number;
public Phone: string;
public Email: string;
public Homepage: string;
public SitePath: string;
public Active: boolean;
public CodeLockSystem?: CodeLockSystemType;
public IsFreeAccount: boolean;
/** @description Will show when the company was updated, note it will only be shown if your logged in as admin for the company. */
// @ApiMember(DataType="datetime", Description="Will show when the company was updated, note it will only be shown if your logged in as admin for the company.")
public Updated?: string;
/** @description Will show when the company was created, note it will only be shown if your logged in as admin for the company. */
// @ApiMember(DataType="datetime", Description="Will show when the company was created, note it will only be shown if your logged in as admin for the company.")
public Created?: string;
public StatusId: number;
/** @description If the company is marked as favourite for the logged in user */
// @ApiMember(DataType="boolean", Description="If the company is marked as favourite for the logged in user")
public IsFavorite: boolean;
public BookingAgreements: string;
public BookingSettings: CompanyBookingSettings;
public SystemSettings: CompanySystemSettings;
public WidgetSettings: CompanyWidgetSettings;
public HomepageSettings: HomepageSettingsResponse;
public RatingSummary: CompanyRatingSummary;
public Reviews: RatingReviewResponse[];
public CustomerCustomFields: CustomFieldConfigData[];
public ResponseStatus: ResponseStatus;
public constructor(init?: Partial<CompanyQueryResponse>) { (Object as any).assign(this, init); }
}
export class CreateCompanyCompanyUser
{
// @ApiMember(IsRequired=true)
public Firstname: string;
// @ApiMember(IsRequired=true)
public Lastname: string;
// @ApiMember(IsRequired=true)
public Phone: string;
// @ApiMember(IsRequired=true)
public Email: string;
// @ApiMember()
public WorkerId?: number;
public constructor(init?: Partial<CreateCompanyCompanyUser>) { (Object as any).assign(this, init); }
}
export class CreateCompanyBillingInformation
{
/** @description The prefered billing method. */
// @ApiMember(Description="The prefered billing method.", IsRequired=true)
public BillingMethodId: number;
/** @description 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 Name: string;
/** @description 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 Attention: string;
/** @description 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 Street1: string;
/** @description The street for the billing adress. */
// @ApiMember(Description="The street for the billing adress.")
public Street2: string;
/** @description 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 ZipCode: string;
/** @description 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 City: string;
/** @description 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 CountryId: string;
/** @description 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 Email: string;
/** @description 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 PaymentTermsDays?: number;
/** @description The company vat registration number. */
// @ApiMember(Description="The company vat registration number.")
public VatRegistrationNumber: string;
public constructor(init?: Partial<CreateCompanyBillingInformation>) { (Object as any).assign(this, init); }
}
// @ValidateRequest(Validator="IsAuthenticated")
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
export class CopyCompany
{
/** @description Id for a specific company you want to copy. */
// @ApiMember(Description="Id for a specific company you want to copy.", ParameterType="query")
public Id?: string;
/** @description */
// @ApiMember(DataType="string", Description="", IsRequired=true)
public Name: string;
/** @description */
// @ApiMember(DataType="string", Description="", IsRequired=true)
public OrganisationNumber: string;
/** @description What type of company. If it's used for personal use or as a company. 1 = Company use, 2 = Personal use */
// @ApiMember(DataType="int", Description="What type of company. If it's used for personal use or as a company. 1 = Company use, 2 = Personal use", IsRequired=true)
public TypeId: number;
/** @description What company owner. 1 = BokaMera (default) */
// @ApiMember(DataType="int", Description="What company owner. 1 = BokaMera (default)", IsRequired=true)
public CompanyOwnerId: number;
/** @description Include following services, if null all active services will be copied. */
// @ApiMember(Description="Include following services, if null all active services will be copied.", ParameterType="query")
public Services: number[];
/** @description Include following resource types, if null all active resource types will be copied. */
// @ApiMember(Description="Include following resource types, if null all active resource types will be copied.", ParameterType="query")
public ResourceTypes: number[];
/** @description Include following resources, if null all active resources will be copied. */
// @ApiMember(Description="Include following resources, if null all active resources will be copied.", ParameterType="query")
public Resources: number[];
/** @description Include following recurring schedules, if null all active recurring schedules will be copied. */
// @ApiMember(Description="Include following recurring schedules, if null all active recurring schedules will be copied.", ParameterType="query")
public RecurringSchedules: number[];
/** @description Include following date schedules, if null all active date schedules will be copied. */
// @ApiMember(Description="Include following date schedules, if null all active date schedules will be copied.", ParameterType="query")
public DateSchedules: number[];
/** @description */
// @ApiMember(DataType="string", Description="", IsRequired=true)
public OpeningHours: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public Details: string;
/** @description */
// @ApiMember(DataType="string", Description="", IsRequired=true)
public CategoryId: number;
/** @description */
// @ApiMember(DataType="uri", Description="", IsRequired=true)
public LogoType: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public Street1: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public Street2: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public ZipCode: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public City: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public CountryId: string;
/** @description */
// @ApiMember(DataType="string", Description="", IsRequired=true)
public Longitude: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public Latitude: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public Phone: string;
/** @description */
// @ApiMember(DataType="string", Description="", IsRequired=true)
public Email: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public Fax: string;
/** @description */
// @ApiMember(DataType="string", Description="")
public Homepage: string;
/** @description */
// @ApiMember(DataType="string", Description="", IsRequired=true)
public SitePath: string;
/** @description */
// @ApiMember(Description="", IsRequired=true)
public CompanyUser: CreateCompanyCompanyUser;
public BillingInformation: CreateCompanyBillingInformation;
/** @description Id of the license type */
// @ApiMember(Description="Id of the license type", IsRequired=true)
public LicenseTypeId: number;
/** @description */
// @ApiMember(DataType="string", Description="")
public DomainName: string;
public constructor(init?: Partial<CopyCompany>) { (Object as any).assign(this, init); }
}
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.
POST /companies/{Id}/copy HTTP/1.1
Host: api.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Id: 00000000-0000-0000-0000-000000000000,
Name: String,
OrganisationNumber: String,
TypeId: 0,
CompanyOwnerId: 0,
Services:
[
0
],
ResourceTypes:
[
0
],
Resources:
[
0
],
RecurringSchedules:
[
0
],
DateSchedules:
[
0
],
OpeningHours: String,
Details: String,
CategoryId: 0,
Street1: String,
Street2: String,
ZipCode: String,
City: String,
CountryId: String,
Longitude: String,
Latitude: String,
Phone: String,
Email: String,
Fax: String,
Homepage: String,
SitePath: String,
CompanyUser:
{
Firstname: String,
Lastname: String,
Phone: String,
Email: String,
WorkerId: 0
},
BillingInformation:
{
BillingMethodId: 0,
Name: String,
Attention: String,
Street1: String,
Street2: String,
ZipCode: String,
City: String,
CountryId: String,
Email: String,
PaymentTermsDays: 0,
VatRegistrationNumber: String
},
LicenseTypeId: 0,
DomainName: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Name: String, OrganisationNumber: String, TypeId: 0, Details: String, CategoryId: 0, Category: String, Street1: String, Street2: String, ZipCode: String, City: String, CountryId: String, Longitude: String, Latitude: String, Distance: 0, Phone: String, Email: String, Homepage: String, SitePath: String, Active: False, CodeLockSystem: Sample, IsFreeAccount: False, Updated: "0001-01-01T00:00:00", Created: "0001-01-01T00:00:00", StatusId: 0, IsFavorite: False, BookingAgreements: String, BookingSettings: { EnableMobileApp: False, BookingReceiptMessage: String, ShowFreeTimesLeft: False, EnableShowBookedTimes: False, BookingAgreement: String, WeekNumberSetting: 0, ShowBookedTimes: False, PaymentProviderId: 0, BookOnlyOnExistingCustomers: False, PaymentEnabled: False }, SystemSettings: { Active: False, InactiveMessage: String, Searchable: False, GATrackingId: String, GoogleAdsConversionId: String, LinkedinTagId: String, GoogleAdsConversionLabel: String, GTMTrackingId: String, FacebookPixelId: String, MultiLanguage: False, ShowOnMarketplace: False, EnableAPITranslation: False, DefaultLanguage: String, SendCustomerInformationToExternalProviders: False }, WidgetSettings: { ServiceLayoutId: 0, TimeLayoutId: 0, BookingLayoutId: 0, PrimaryColor: String, ShowServiceImage: False, ShowRebateCodeField: False, ShowNextAvailableTime: False, ShowEndTime: False, BookedTimeSlotText: String, DarkTheme: False, ShowSubscribeToNewsletter: False }, HomepageSettings: { HomepageHeading: String, WelcomePageHeading: String, WelcomePageBody: String, AboutUsPageHeading: String, AboutUsPageBody: String, ShowRating: False, HomePageTemplateId: 0, HeroSectionStyleId: 0, EnableHomepage: False }, RatingSummary: { AverageScore: 0, RatingScore1Count: 0, RatingScore2Count: 0, RatingScore3Count: 0, RaingScore4Count: 0, RatingScore5Count: 0, Count: 0 }, Reviews: [ { Title: String, Description: String, RatingScore: 0, Author: String, ReviewAnswer: String } ], CustomerCustomFields: [ { "Id": 0, "Name": "String", "Description": "String", "Width": 0, "DataType": "String", "DefaultValue": "String", "IsMandatory": false, "MandatoryErrorMessage": "String", "MaxLength": 0, "MultipleLineText": false, "RegEx": "String", "RegExErrorMessage": "String", "Values": [ { "Value": "String" } ] } ], ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } } }