BokaMera.API.Host

<back to all web services

GetPricesAfterRebateCode

Requires Authentication
The following routes are available for this service:
POST/rebatecodes/pricesGet the new pricesGet the new prices after applying RebateCodes
"use strict";
export class RebateCodeTypeResponse {
    /** @param {{Id?:number,Name?:string,Description?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Id;
    /** @type {string} */
    Name;
    /** @type {string} */
    Description;
}
export class AppliedRebateCodesResponse {
    /** @param {{RebateCodeSign?:string,RebateCodeValue?:number,RebateCodeType?:RebateCodeTypeResponse,RebateCodeId?:number,RebateAmount?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    RebateCodeSign;
    /** @type {number} */
    RebateCodeValue;
    /** @type {RebateCodeTypeResponse} */
    RebateCodeType;
    /** @type {number} */
    RebateCodeId;
    /** @type {number} */
    RebateAmount;
}
export class RebateCodePrice {
    /** @param {{PriceId?:number,PriceText?:string,PriceBeforeRebate?:number,Price?:number,VAT?:number,AppliedCodes?:AppliedRebateCodesResponse[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?number}
     * @description Price Id */
    PriceId;
    /** @type {string} */
    PriceText;
    /** @type {?number} */
    PriceBeforeRebate;
    /** @type {?number} */
    Price;
    /** @type {?number} */
    VAT;
    /** @type {AppliedRebateCodesResponse[]} */
    AppliedCodes;
}
export class RebateCodePriceResponse {
    /** @param {{RebateCodePrices?:RebateCodePrice[],ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {RebateCodePrice[]} */
    RebateCodePrices;
    /** @type {ResponseStatus} */
    ResponseStatus;
}
export class GetPricesAfterRebateCode {
    /** @param {{CompanyId?:string,ServiceId?:number,RebateCodeIds?:number[],RebateCodeSigns?:string[],DateFrom?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    CompanyId;
    /**
     * @type {?number}
     * @description The service you want to get the prices with rebates on */
    ServiceId;
    /**
     * @type {number[]}
     * @description Provide this if you like to the prices with rebate code ids */
    RebateCodeIds;
    /**
     * @type {string[]}
     * @description Provide this if you like to the prices with rebate code signs instead of ids */
    RebateCodeSigns;
    /**
     * @type {string}
     * @description Provide this if you like to calculate the prices with the provided datetime */
    DateFrom;
}

JavaScript GetPricesAfterRebateCode DTOs

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

{
	ServiceId: 0,
	RebateCodeIds: 
	[
		0
	],
	RebateCodeSigns: 
	[
		String
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	RebateCodePrices: 
	[
		{
			PriceId: 0,
			PriceText: String,
			PriceBeforeRebate: 0,
			Price: 0,
			VAT: 0,
			AppliedCodes: 
			[
				{
					RebateCodeSign: String,
					RebateCodeValue: 0,
					RebateCodeType: 
					{
						Id: 0,
						Name: String,
						Description: String
					},
					RebateCodeId: 0,
					RebateAmount: 0
				}
			]
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}