| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| POST | /rebatecodes | Create RebateCode. | Create RebateCode. |
|---|
"use strict";
export class DaysOfWeekResponse {
/** @param {{Id?:number,DayOfWeek?:string,DayOfWeekTranslation?:string,DayOfWeekActive?:boolean,DayOfWeekSortOrder?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
DayOfWeek;
/** @type {string} */
DayOfWeekTranslation;
/** @type {?boolean} */
DayOfWeekActive;
/** @type {?number} */
DayOfWeekSortOrder;
}
export class RebateCodeServiceResponse {
/** @param {{Id?:number,Name?:string,Description?:string,Active?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
Name;
/** @type {string} */
Description;
/** @type {boolean} */
Active;
}
export class BaseModel {
constructor(init) { Object.assign(this, init) }
}
export class ArticleServiceRelation extends BaseModel {
/** @param {{CompanyId?:string,Id?:number,ServiceId?:number,ArticleId?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {string} */
CompanyId;
/** @type {number} */
Id;
/** @type {number} */
ServiceId;
/** @type {number} */
ArticleId;
}
export class ArticleResponse {
/** @param {{CompanyId?:string,Id?:number,Name?:string,ArticleTypeId?:number,Description?:string,ImageUrl?:string,Active?:boolean,Amount?:number,Price?:number,CurrencyId?:string,SortOrder?:number,UpdatedDate?:string,CreatedDate?:string,Duration?:number,Services?:ArticleServiceRelation[],ServiceIds?:number[],PriceSign?:string,VAT?:number,ValidDays?:number,SendNotification?:boolean,NotificationEmail?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
CompanyId;
/** @type {number} */
Id;
/** @type {string} */
Name;
/** @type {number} */
ArticleTypeId;
/** @type {string} */
Description;
/** @type {string} */
ImageUrl;
/** @type {boolean} */
Active;
/** @type {number} */
Amount;
/** @type {number} */
Price;
/** @type {string} */
CurrencyId;
/** @type {number} */
SortOrder;
/** @type {string} */
UpdatedDate;
/** @type {string} */
CreatedDate;
/** @type {number} */
Duration;
/** @type {ArticleServiceRelation[]} */
Services = [];
/** @type {number[]} */
ServiceIds = [];
/** @type {string} */
PriceSign;
/** @type {?number} */
VAT;
/** @type {number} */
ValidDays;
/** @type {boolean} */
SendNotification;
/** @type {string} */
NotificationEmail;
}
export class RebateCodeCustomerResponse {
/** @param {{Id?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string,ImageUrl?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Firstname;
/** @type {string} */
Lastname;
/** @type {string} */
Email;
/** @type {string} */
Phone;
/** @type {string} */
ImageUrl;
}
export class RebateCodeTransactionQueryResponse {
/** @param {{Id?:number,CompanyId?:string,Note?:string,RebateCodeId?:number,RebateCodeSign?:string,RebateCodeTypeId?:number,RebateCodeTypeName?:string,Amount?:number,Usage?:string,BookingId?:number,UpdatedDate?:string,CreatedDate?:string,Service?:RebateCodeServiceResponse,Customer?:RebateCodeCustomerResponse,PriceSign?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
CompanyId;
/** @type {string} */
Note;
/** @type {number} */
RebateCodeId;
/** @type {string} */
RebateCodeSign;
/** @type {?number} */
RebateCodeTypeId;
/** @type {string} */
RebateCodeTypeName;
/** @type {number} */
Amount;
/** @type {string} */
Usage;
/** @type {?number} */
BookingId;
/** @type {string} */
UpdatedDate;
/** @type {string} */
CreatedDate;
/** @type {RebateCodeServiceResponse} */
Service;
/** @type {RebateCodeCustomerResponse} */
Customer;
/** @type {string} */
PriceSign;
}
export class RebateCodeCompanyResponse {
/** @param {{SitePath?:string,PaymentProviderId?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
SitePath;
/** @type {?number} */
PaymentProviderId;
}
export class PaymentLogResponse {
/** @param {{Id?:number,Amount?:number,AmountCredited?:number,CurrencyId?:string,Comments?:string,Created?:string,Updated?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {?number} */
Amount;
/** @type {?number} */
AmountCredited;
/** @type {string} */
CurrencyId;
/** @type {string} */
Comments;
/** @type {string} */
Created;
/** @type {string} */
Updated;
}
export class RebateCodeResponse {
/** @param {{Id?:number,CompanyId?:string,ValidFrom?:string,ValidTo?:string,FromTime?:string,ToTime?:string,CreatedBy?:string,Created?:string,UpdatedBy?:string,Updated?:string,PersonalNote?:string,RebateCodeSign?:string,RebateCodeValue?:number,RebateCodeTypeId?:number,Name?:string,RebateCodeStatusId?:number,StatusName?:string,MaxNumberOfUses?:number,MaxNumberOfUsesPerCustomer?:number,NumberOfUsesUsed?:number,DaysOfWeek?:DaysOfWeekResponse[],Services?:RebateCodeServiceResponse[],Article?:ArticleResponse,Transactions?:RebateCodeTransactionQueryResponse[],RemainingAmount?:number,RemainingUsage?:number,Customers?:RebateCodeCustomerResponse[],ResponseStatus?:ResponseStatus,PaymentReceived?:boolean,RebateCodeCurrencySign?:string,ActiveByStatus?:boolean,PriceSign?:string,RebateCodeTypeName?:string,Company?:RebateCodeCompanyResponse,PaymentLog?:PaymentLogResponse[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {?string} */
CompanyId;
/** @type {string} */
ValidFrom;
/** @type {string} */
ValidTo;
/**
* @type {string}
* @description 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;
/**
* @type {string}
* @description If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters. */
ToTime;
/** @type {string} */
CreatedBy;
/** @type {string} */
Created;
/** @type {string} */
UpdatedBy;
/** @type {string} */
Updated;
/** @type {string} */
PersonalNote;
/** @type {string} */
RebateCodeSign;
/** @type {number} */
RebateCodeValue;
/** @type {number} */
RebateCodeTypeId;
/** @type {string} */
Name;
/** @type {number} */
RebateCodeStatusId;
/** @type {string} */
StatusName;
/** @type {number} */
MaxNumberOfUses;
/** @type {number} */
MaxNumberOfUsesPerCustomer;
/** @type {number} */
NumberOfUsesUsed;
/** @type {DaysOfWeekResponse[]} */
DaysOfWeek = [];
/** @type {RebateCodeServiceResponse[]} */
Services = [];
/** @type {ArticleResponse} */
Article;
/** @type {RebateCodeTransactionQueryResponse[]} */
Transactions = [];
/** @type {?number} */
RemainingAmount;
/** @type {?number} */
RemainingUsage;
/** @type {RebateCodeCustomerResponse[]} */
Customers = [];
/** @type {ResponseStatus} */
ResponseStatus;
/** @type {boolean} */
PaymentReceived;
/** @type {string} */
RebateCodeCurrencySign;
/** @type {boolean} */
ActiveByStatus;
/** @type {string} */
PriceSign;
/** @type {string} */
RebateCodeTypeName;
/** @type {RebateCodeCompanyResponse} */
Company;
/** @type {PaymentLogResponse[]} */
PaymentLog = [];
}
export class PromoCodeReceiver {
/** @param {{CustomerId?:string,Firstname?:string,Lastname?:string,Email?:string,ReceiverMessage?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?string} */
CustomerId;
/** @type {string} */
Firstname;
/** @type {string} */
Lastname;
/** @type {string} */
Email;
/** @type {string} */
ReceiverMessage;
}
export class InvoiceAddressToHandle {
/** @param {{CorporateIdentityNumber?:string,InvoiceAddress1?:string,InvoiceAddress2?:string,InvoiceCity?:string,InvoicePostalCode?:string,InvoiceCountryCode?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
CorporateIdentityNumber;
/** @type {string} */
InvoiceAddress1;
/** @type {string} */
InvoiceAddress2;
/** @type {string} */
InvoiceCity;
/** @type {string} */
InvoicePostalCode;
/** @type {string} */
InvoiceCountryCode;
}
export class CreateRebateCode {
/** @param {{CompanyId?:string,MaxNumberOfUses?:number,MaxNumberOfUsesPerCustomer?:number,ValidFrom?:string,ValidTo?:string,FromTime?:string,ToTime?:string,RebateCodeTypeId?:number,ArticleId?:number,RebateCodeValue?:number,RebateCodeSign?:string,AutoGenerateRebateCodeSign?:boolean,PersonalNote?:string,DaysOfWeek?:number[],Services?:number[],Customers?:string[],PriceVat?:number,VAT?:number,CurrencyId?:string,PromoCodeReceiver?:PromoCodeReceiver,InvoiceAddress?:InvoiceAddressToHandle,Paid?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?string} */
CompanyId;
/**
* @type {?number}
* @description The default value is 9999 */
MaxNumberOfUses;
/**
* @type {?number}
* @description The default value is 1 */
MaxNumberOfUsesPerCustomer;
/** @type {string} */
ValidFrom;
/** @type {string} */
ValidTo;
/**
* @type {?string}
* @description 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;
/**
* @type {?string}
* @description If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters. */
ToTime;
/**
* @type {number}
* @description 1 - Percent, 2 - Сurrency, 3 - PunchTicket, 4 - ValueCard, 5 - GiftCard */
RebateCodeTypeId;
/**
* @type {?number}
* @description If it's connected to an Article, add the Article Id here. */
ArticleId;
/** @type {number} */
RebateCodeValue;
/**
* @type {string}
* @description If AutoGenerateRebateCodeSign=false - more than four letters, unique among active codes */
RebateCodeSign;
/**
* @type {boolean}
* @description AutoGenerateRebateCodeSign=true - random generate code */
AutoGenerateRebateCodeSign;
/** @type {string} */
PersonalNote;
/** @type {number[]} */
DaysOfWeek = [];
/** @type {number[]} */
Services = [];
/** @type {string[]} */
Customers = [];
/**
* @type {?number}
* @description The price */
PriceVat;
/**
* @type {?number}
* @description The price VAT in percent */
VAT;
/**
* @type {string}
* @description The price currency */
CurrencyId;
/**
* @type {PromoCodeReceiver}
* @description Promo code receiver information */
PromoCodeReceiver;
/**
* @type {?InvoiceAddressToHandle}
* @description If you wish to save some invoice address information for the rebate code, you can do so here. This is optional. */
InvoiceAddress;
/**
* @type {?boolean}
* @description Determines if the rebate code is active on creation or if it should await payment. If you set this to true, make sure to mark the code as payed when you receive the payment, by using the MarkRebateCodeAsPayed endpoint. The default value is false. */
Paid;
}
JavaScript CreateRebateCode DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /rebatecodes HTTP/1.1
Host: testapi.bokamera.se
Accept: application/json
Content-Type: application/json
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","MaxNumberOfUses":0,"MaxNumberOfUsesPerCustomer":0,"FromTime":"00:00:00","ToTime":"00:00:00","RebateCodeTypeId":0,"ArticleId":0,"RebateCodeValue":0,"RebateCodeSign":"String","AutoGenerateRebateCodeSign":false,"PersonalNote":"String","DaysOfWeek":[0],"Services":[0],"Customers":["00000000-0000-0000-0000-000000000000"],"PriceVat":0,"VAT":0,"CurrencyId":"String","PromoCodeReceiver":{"CustomerId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Email":"String","ReceiverMessage":"String"},"InvoiceAddress":{"CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"},"Paid":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Id":0,"CompanyId":"00000000-0000-0000-0000-000000000000","FromTime":"00:00:00","ToTime":"00:00:00","CreatedBy":"String","UpdatedBy":"String","PersonalNote":"String","RebateCodeSign":"String","RebateCodeValue":0,"RebateCodeTypeId":0,"Name":"String","RebateCodeStatusId":0,"StatusName":"String","MaxNumberOfUses":0,"MaxNumberOfUsesPerCustomer":0,"NumberOfUsesUsed":0,"DaysOfWeek":[{"Id":0,"DayOfWeek":"String","DayOfWeekTranslation":"String","DayOfWeekActive":false,"DayOfWeekSortOrder":0}],"Services":[{"Id":0,"Name":"String","Description":"String","Active":false}],"Article":{"Id":0,"Name":"String","ArticleTypeId":0,"Description":"String","ImageUrl":"String","Active":false,"Amount":0,"Price":0,"CurrencyId":"String","SortOrder":0,"Duration":0,"Services":[{"Id":0,"ServiceId":0,"ArticleId":0}],"ServiceIds":[0],"PriceSign":"String","VAT":0,"ValidDays":0,"SendNotification":false,"NotificationEmail":"String"},"Transactions":[{"Id":0,"Note":"String","RebateCodeId":0,"RebateCodeSign":"String","RebateCodeTypeId":0,"RebateCodeTypeName":"String","Amount":0,"Usage":"String","BookingId":0,"Service":{"Id":0,"Name":"String","Description":"String","Active":false},"Customer":{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","ImageUrl":"String"},"PriceSign":"String"}],"RemainingAmount":0,"RemainingUsage":0,"Customers":[{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","ImageUrl":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"PaymentReceived":false,"RebateCodeCurrencySign":"String","ActiveByStatus":false,"PriceSign":"String","RebateCodeTypeName":"String","Company":{"SitePath":"String","PaymentProviderId":0},"PaymentLog":[{"Id":0,"Amount":0,"AmountCredited":0,"CurrencyId":"String","Comments":"String"}]}