@phasesdk/api-client-for-economic
Version:
e-conomic REST API Library for Node.js is a powerful tool designed to simplify integration with the e-conomic platform for developers building Node.js applications. With this library, developers can effortlessly leverage the full functionality of the e-co
62 lines (61 loc) • 1.83 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const RestApi_1 = __importDefault(require("../../modules/RestApi"));
class ProductGroups extends RestApi_1.default {
/**
* @constructor
*/
constructor(props) {
super(props);
}
/**
* This endpoint allows you to fetch a collection of all product groups.
*
* @see https://restdocs.e-conomic.com/#get-payment-terms
*
* @param {number} offset
* @param {number} limit
* @returns {Promise<HttpResponse>}
*
*/
get(offset = 0, limit = 100) {
const requestObj = {
method: "get",
url: `/payment-terms?skippages=${offset}&pagesize=${limit}`,
};
return this._httpRequest(requestObj);
}
/**
* This endpoint allows you to fetch a specific product group.
*
* @see https://restdocs.e-conomic.com/#get-payment-terms
* @param {number} paymentTermsNumber
* @returns {Promise<HttpResponse>}
*/
getFor(paymentTermsNumber) {
const requestObj = {
method: "get",
url: `/payment-terms/${paymentTermsNumber}`,
};
return this._httpRequest(requestObj);
}
/**
* Create a new product
* .
* @see https://restdocs.e-conomic.com/#post-payment-terms
* @param {PaymentTerms} paymentTerms
* @returns {Promise<HttpResponse<PaymentTerms>>}
*/
create(paymentTerms) {
const requestObj = {
method: "post",
url: `/payment-terms`,
data: paymentTerms,
};
return this._httpRequest(requestObj);
}
}
exports.default = ProductGroups;