BokaMera.API.Host

<back to all web services

AddPaymentSettings

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/payment/settingsAdd payment settingsAdd payment settings for the logged in company
"use strict";
export class AdminPaymentOptionsResponse {
    /** @param {{Id?:number,Name?:string,Description?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The payment options id */
    Id;
    /**
     * @type {string}
     * @description The payment options name */
    Name;
    /**
     * @type {string}
     * @description The payment options description */
    Description;
}
export class PaymentProviderOptionsResponse {
    /** @param {{Id?:number,Name?:string,Description?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The payment provider id */
    Id;
    /**
     * @type {string}
     * @description The payment provider name */
    Name;
    /**
     * @type {string}
     * @description The payment provider description */
    Description;
}
export class PaymentSettingsQueryResponse {
    /** @param {{CompanyId?:string,Enabled?:boolean,InvoiceFee?:number,AllowCreditCardPayment?:boolean,AllowInvoicePayment?:boolean,AllowBankPayment?:boolean,RefundOnCancelBooking?:boolean,DefaultPaymentOptionId?:number,PaymentProviderId?:number,AdminPaymentOptions?:AdminPaymentOptionsResponse[],PaymentProviderOptions?:PaymentProviderOptionsResponse[],SendPaymentRequestDirectly?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The company id */
    CompanyId;
    /**
     * @type {boolean}
     * @description The payment is enabled */
    Enabled;
    /**
     * @type {number}
     * @description If there should be any fee added when customer selected invoice payment method */
    InvoiceFee;
    /**
     * @type {boolean}
     * @description If allow credit card payment */
    AllowCreditCardPayment;
    /**
     * @type {boolean}
     * @description If allow invoice payment */
    AllowInvoicePayment;
    /**
     * @type {boolean}
     * @description If allow bank payment */
    AllowBankPayment;
    /**
     * @type {boolean}
     * @description Automatically refund customer on canceled booking */
    RefundOnCancelBooking;
    /**
     * @type {?number}
     * @description The default option when admin creates a new booking */
    DefaultPaymentOptionId;
    /**
     * @type {number}
     * @description What payment provider to use */
    PaymentProviderId;
    /**
     * @type {AdminPaymentOptionsResponse[]}
     * @description If you want to include the admin payment options to select from */
    AdminPaymentOptions;
    /**
     * @type {PaymentProviderOptionsResponse[]}
     * @description If you want to include the payment provider options to select from */
    PaymentProviderOptions;
    /**
     * @type {boolean}
     * @description SendPaymentRequestDirectly */
    SendPaymentRequestDirectly;
}
export class AddPaymentSettings {
    /** @param {{CompanyId?:string,Enabled?:boolean,InvoiceFee?:number,AllowCreditCardPayment?:boolean,AllowInvoicePayment?:boolean,AllowBankPayment?:boolean,RefundOnCancelBooking?:boolean,DefaultAdminPaymentOptionsId?:number,PaymentProviderId?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?string}
     * @description The company id, if empty will use the company id for the user you are logged in with. */
    CompanyId;
    /**
     * @type {boolean}
     * @description The payson payment is enabled */
    Enabled;
    /**
     * @type {number}
     * @description If there should be any fee added when customer selected invoice payment method */
    InvoiceFee;
    /**
     * @type {boolean}
     * @description If allow credit card payment */
    AllowCreditCardPayment;
    /**
     * @type {boolean}
     * @description If allow invoice payment */
    AllowInvoicePayment;
    /**
     * @type {boolean}
     * @description If allow bank payment */
    AllowBankPayment;
    /**
     * @type {boolean}
     * @description Automatically refund customer on canceled booking */
    RefundOnCancelBooking;
    /**
     * @type {?number}
     * @description The default option when admin creates a new booking */
    DefaultAdminPaymentOptionsId;
    /**
     * @type {number}
     * @description What payment provider to use */
    PaymentProviderId;
}

JavaScript AddPaymentSettings DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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

POST /payment/settings HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Enabled":false,"InvoiceFee":0,"AllowCreditCardPayment":false,"AllowInvoicePayment":false,"AllowBankPayment":false,"RefundOnCancelBooking":false,"DefaultAdminPaymentOptionsId":0,"PaymentProviderId":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Enabled":false,"InvoiceFee":0,"AllowCreditCardPayment":false,"AllowInvoicePayment":false,"AllowBankPayment":false,"RefundOnCancelBooking":false,"DefaultPaymentOptionId":0,"PaymentProviderId":0,"AdminPaymentOptions":[{"Id":0,"Name":"String","Description":"String"}],"PaymentProviderOptions":[{"Id":0,"Name":"String","Description":"String"}],"SendPaymentRequestDirectly":false}