BokaMera.API.Host

<back to all web services

CreateVossUsageTermination

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/voss/usage/{Id}/terminationCreate voss usage terminationAdd new product to company invoicing. Sends that product to VOSS System.
"use strict";
export class SubscriptionItemTerminationReasonDto {
    /** @param {{reasonId?:string,reasonName?:string,reasonExternalId?:string,subReasonId?:string,subReasonName?:string,subReasonExternalId?:string,comment?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    reasonId;
    /** @type {string} */
    reasonName;
    /** @type {string} */
    reasonExternalId;
    /** @type {?string} */
    subReasonId;
    /** @type {string} */
    subReasonName;
    /** @type {string} */
    subReasonExternalId;
    /** @type {string} */
    comment;
}
/** @typedef {'Full'|'None'} */
export var UsageBehaviourEnum;
(function (UsageBehaviourEnum) {
    UsageBehaviourEnum["Full"] = "Full"
    UsageBehaviourEnum["None"] = "None"
})(UsageBehaviourEnum || (UsageBehaviourEnum = {}));
/** @typedef {'Normal'|'Internal'} */
export var CreditKindEnum;
(function (CreditKindEnum) {
    CreditKindEnum["Normal"] = "Normal"
    CreditKindEnum["Internal"] = "Internal"
})(CreditKindEnum || (CreditKindEnum = {}));
export class UsageCreditOptionsDto {
    /** @param {{behaviour?:UsageBehaviourEnum,creditKind?:CreditKindEnum}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {UsageBehaviourEnum} */
    behaviour;
    /** @type {CreditKindEnum} */
    creditKind;
}
/** @typedef {'Main'|'Addon'|'License'|'Usage'} */
export var ProductTypeEnum;
(function (ProductTypeEnum) {
    ProductTypeEnum["Main"] = "Main"
    ProductTypeEnum["Addon"] = "Addon"
    ProductTypeEnum["License"] = "License"
    ProductTypeEnum["Usage"] = "Usage"
})(ProductTypeEnum || (ProductTypeEnum = {}));
export class CustomerBalanceChangeItemDto {
    /** @param {{type?:ProductTypeEnum,id?:string,name?:string,productGroupId?:string,productGroupName?:string,quantity?:number,amount?:number,discountAmount?:number,totalAmount?:number,invoiceRecipientCustomerId?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ProductTypeEnum} */
    type;
    /** @type {string} */
    id;
    /** @type {string} */
    name;
    /** @type {string} */
    productGroupId;
    /** @type {string} */
    productGroupName;
    /** @type {number} */
    quantity;
    /** @type {number} */
    amount;
    /** @type {number} */
    discountAmount;
    /** @type {number} */
    totalAmount;
    /** @type {string} */
    invoiceRecipientCustomerId;
}
export class CustomerBalanceChangeDto {
    /** @param {{items?:CustomerBalanceChangeItemDto[],totalAmount?:number,totalDiscountAmount?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {CustomerBalanceChangeItemDto[]} */
    items = [];
    /** @type {number} */
    totalAmount;
    /** @type {number} */
    totalDiscountAmount;
}
export class CreateUsageTerminationResult {
    /** @param {{scheduledDate?:string,reason?:SubscriptionItemTerminationReasonDto,creditOptions?:UsageCreditOptionsDto,customerBalanceChange?:CustomerBalanceChangeDto}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    scheduledDate;
    /** @type {SubscriptionItemTerminationReasonDto} */
    reason;
    /** @type {UsageCreditOptionsDto} */
    creditOptions;
    /** @type {CustomerBalanceChangeDto} */
    customerBalanceChange;
}
export class CreateVossUsageTermination {
    /** @param {{CompanyId?:string,Id?:string,InvoiceLineTexts?:string[],TerminationReasonComment?:string,TerminationReasonId?:string,Behaviour?:UsageBehaviourEnum,CreditKind?:CreditKindEnum}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The company id */
    CompanyId;
    /**
     * @type {string}
     * @description Usage Id */
    Id;
    /** @type {string[]} */
    InvoiceLineTexts = [];
    /** @type {string} */
    TerminationReasonComment;
    /** @type {string} */
    TerminationReasonId;
    /**
     * @type {UsageBehaviourEnum}
     * @description Credit behaviour:  <br /> 1. Full - usage will be credited in full  <br /> 2. None - no credit will be created */
    Behaviour;
    /**
     * @type {CreditKindEnum}
     * @description Credit kind:  <br /> 1. Normal - default credit type  <br /> 2. Internal - corresponding credit will be marked as internal in invoice file line */
    CreditKind;
}

JavaScript CreateVossUsageTermination 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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /voss/usage/{Id}/termination HTTP/1.1 
Host: api.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Id":"String","InvoiceLineTexts":["String"],"TerminationReasonComment":"String","Behaviour":"Full","CreditKind":"Normal"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}