Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /rebatecodes/transactions | Create transaction for the rebate code | Create transaction for the rebate code |
---|
"use strict";
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 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,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 {?number} */
BookingId;
/** @type {string} */
UpdatedDate;
/** @type {string} */
CreatedDate;
/** @type {RebateCodeServiceResponse} */
Service;
/** @type {RebateCodeCustomerResponse} */
Customer;
/** @type {string} */
PriceSign;
}
export class RebateCodeTransactionResponse {
/** @param {{ResponseStatus?:ResponseStatus,RebateCodeTransactionItem?:RebateCodeTransactionQueryResponse}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ResponseStatus} */
ResponseStatus;
/** @type {RebateCodeTransactionQueryResponse} */
RebateCodeTransactionItem;
}
/** @typedef {'Increase'|'Decrease'} */
export var AmountChangeType;
(function (AmountChangeType) {
AmountChangeType["Increase"] = "Increase"
AmountChangeType["Decrease"] = "Decrease"
})(AmountChangeType || (AmountChangeType = {}));
export class CreateRebateCodeTransaction {
/** @param {{CompanyId?:string,RebateCodeId?:number,Amount?:number,Usage?:number,BookingId?:number,ChangeType?:AmountChangeType}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
CompanyId;
/**
* @type {number}
* @description Rebate code id to which you wish to add transaction */
RebateCodeId;
/** @type {number} */
Amount;
/** @type {number} */
Usage;
/** @type {?number} */
BookingId;
/**
* @type {AmountChangeType}
* @description If you want to Increase = 0 or Decrease = 1 the value */
ChangeType;
}
JavaScript CreateRebateCodeTransaction DTOs
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 /rebatecodes/transactions HTTP/1.1
Host: api.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CompanyId: 00000000-0000-0000-0000-000000000000,
RebateCodeId: 0,
Amount: 0,
Usage: 0,
BookingId: 0,
ChangeType: Increase
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } }, RebateCodeTransactionItem: { Id: 0, Note: String, RebateCodeId: 0, RebateCodeSign: String, RebateCodeTypeId: 0, RebateCodeTypeName: String, Amount: 0, BookingId: 0, Service: { Id: 0, Name: String, Description: String, Active: False }, Customer: { Firstname: String, Lastname: String, Email: String, Phone: String, ImageUrl: String }, PriceSign: String } }