pancake-client-sdk
Version:
Official TypeScript SDK for Pancake POS API
50 lines • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrderResource = void 0;
const base_1 = require("./base");
class OrderResource extends base_1.BaseResource {
/**
* Get list of orders
*/
async list(params) {
return this.client.get(this.getShopPath('/orders'), params);
}
/**
* Get order by ID
*/
async getById(orderId) {
return this.client.get(this.getShopPath(`/orders/${orderId}`));
}
/**
* Create new order
*/
async create(data) {
return this.client.post(this.getShopPath('/orders'), data);
}
/**
* Update order
*/
async update(orderId, data) {
return this.client.put(this.getShopPath(`/orders/${orderId}`), data);
}
/**
* Get order print URL
*/
async getPrintUrl(orderId) {
return this.client.get(this.getShopPath(`/orders/${orderId}/print`));
}
/**
* Get order confirmation URL
*/
async getConfirmationUrl(orderId) {
return this.client.get(this.getShopPath(`/orders/${orderId}/confirmation`));
}
/**
* Get order advanced promotions
*/
async getAdvancedPromotions(orderId) {
return this.client.get(this.getShopPath(`/orders/${orderId}/promotions/advanced`));
}
}
exports.OrderResource = OrderResource;
//# sourceMappingURL=order.js.map